Browse Source

LibWeb: Add HTMLTableCellElement::colSpan

Simon Wanner 3 years ago
parent
commit
b7b647e9cd

+ 10 - 0
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));
+}
+
 }

+ 3 - 0
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;
 };

+ 1 - 0
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;