summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorSimon Wanner <skyrising@pvpctutorials.de>2022-03-28 23:27:56 +0200
committerAndreas Kling <kling@serenityos.org>2022-03-29 00:39:57 +0200
commitb7b647e9cde65fd92b74942c6c0f6852ef87f5a6 (patch)
tree3c75426945e0f60d47ae9ca382126467eb470d76 /Userland/Libraries
parentb92cc3670b530a7c3659266b2e57dab0541ea2f7 (diff)
downloadserenity-b7b647e9cde65fd92b74942c6c0f6852ef87f5a6.zip
LibWeb: Add HTMLTableCellElement::colSpan
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp10
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h3
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.idl1
3 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp
index b71aad7073..7e1efec139 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp
@@ -48,4 +48,14 @@ void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& styl
});
}
+unsigned int HTMLTableCellElement::col_span() const
+{
+ return attribute(HTML::AttributeNames::colspan).to_uint().value_or(1);
+}
+
+void HTMLTableCellElement::set_col_span(unsigned int value)
+{
+ set_attribute(HTML::AttributeNames::colspan, String::number(value));
+}
+
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h
index 4fbceaac1e..dcddbbbb84 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h
@@ -17,6 +17,9 @@ public:
HTMLTableCellElement(DOM::Document&, DOM::QualifiedName);
virtual ~HTMLTableCellElement() override;
+ unsigned col_span() const;
+ void set_col_span(unsigned);
+
private:
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
};
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.idl
index 8c13607b04..5b5bfeac44 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.idl
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.idl
@@ -2,6 +2,7 @@
interface HTMLTableCellElement : HTMLElement {
+ attribute unsigned long colSpan;
[Reflect] attribute DOMString headers;
[Reflect] attribute DOMString abbr;