diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.idl index 28b72d0529..8d99e30bdd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.idl @@ -9,7 +9,7 @@ interface HTMLMetaElement : HTMLElement { [CEReactions, Reflect] attribute DOMString name; [CEReactions, Reflect=http-equiv] attribute DOMString httpEquiv; [CEReactions, Reflect] attribute DOMString content; - // FIXME: [CEReactions] attribute DOMString media; + [CEReactions, Reflect] attribute DOMString media; // Obsolete [CEReactions, Reflect] attribute DOMString scheme; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp index 2378fa7bc4..dd87b46ff0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp @@ -6,6 +6,7 @@ #include #include +#include namespace Web::HTML { @@ -24,4 +25,22 @@ void HTMLTableColElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableColElement"_fly_string)); } +// https://html.spec.whatwg.org/multipage/tables.html#dom-colgroup-span +unsigned int HTMLTableColElement::span() const +{ + // The span IDL attribute must reflect the content attribute of the same name. It is clamped to the range [1, 1000], and its default value is 1. + auto maybe_span_string = get_attribute(HTML::AttributeNames::span); + if (maybe_span_string.has_value()) { + auto maybe_span = parse_non_negative_integer(maybe_span_string.value()); + if (maybe_span.has_value()) + return clamp(maybe_span.value(), 1, 1000); + } + return 1; +} + +WebIDL::ExceptionOr HTMLTableColElement::set_span(unsigned int value) +{ + return set_attribute(HTML::AttributeNames::span, MUST(String::number(value))); +} + } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h index 589d03849e..178248213a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h @@ -17,6 +17,9 @@ class HTMLTableColElement final : public HTMLElement { public: virtual ~HTMLTableColElement() override; + unsigned span() const; + WebIDL::ExceptionOr set_span(unsigned); + private: HTMLTableColElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.idl index 0a479fe59a..5eb13bc7a7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.idl @@ -6,7 +6,7 @@ interface HTMLTableColElement : HTMLElement { [HTMLConstructor] constructor(); - // FIXME: [CEReactions] attribute unsigned long span; + [CEReactions] attribute unsigned long span; // Obsolete [CEReactions, Reflect] attribute DOMString align;