diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp index 4ff31bd113..ed853c2a07 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp @@ -144,4 +144,11 @@ void HTMLStyleElement::update_a_style_block() sheet.release_nonnull()); } +// https://drafts.csswg.org/cssom/#dom-linkstyle-sheet +RefPtr HTMLStyleElement::sheet() const +{ + // The sheet attribute must return the associated CSS style sheet for the node or null if there is no associated CSS style sheet. + return m_associated_css_style_sheet; +} + } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h index 9643e33ad3..a96393093d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h @@ -23,6 +23,8 @@ public: void update_a_style_block(); + RefPtr sheet() const; + private: // https://drafts.csswg.org/cssom/#associated-css-style-sheet RefPtr m_associated_css_style_sheet; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.idl index a5ab2934f3..bab3c4d8ab 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.idl @@ -4,4 +4,7 @@ interface HTMLStyleElement : HTMLElement { [Reflect] attribute DOMString type; + // FIXME: This should come from a LinkStyle mixin + readonly attribute CSSStyleSheet? sheet; + };