LibWeb: Implement the HTMLLinkElement.sheet attribute

This returns the link element's associated style sheet.
This commit is contained in:
Tim Ledbetter 2025-03-15 15:39:32 +01:00 committed by Alexander Kalenik
commit 1821896ecf
Notes: github-actions[bot] 2025-03-17 13:48:19 +00:00
5 changed files with 26 additions and 1 deletions

View file

@ -138,6 +138,12 @@ String HTMLLinkElement::media() const
return attribute(HTML::AttributeNames::media).value_or(String {});
}
// https://drafts.csswg.org/cssom/#dom-linkstyle-sheet
GC::Ptr<CSS::CSSStyleSheet> HTMLLinkElement::sheet() const
{
return m_loaded_style_sheet;
}
bool HTMLLinkElement::has_loaded_icon() const
{
return m_relationship & Relationship::Icon && resource() && resource()->is_loaded() && resource()->has_encoded_data();

View file

@ -48,6 +48,8 @@ public:
void set_media(String);
String media() const;
GC::Ptr<CSS::CSSStyleSheet> sheet() const;
private:
HTMLLinkElement(DOM::Document&, DOM::QualifiedName);

View file

@ -60,4 +60,4 @@ interface HTMLLinkElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString target;
};
// FIXME: HTMLLinkElement includes LinkStyle;
HTMLLinkElement includes LinkStyle;