mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 04:32:51 +00:00
LibWeb: Implement HTMLStyleElement.sheet
This commit is contained in:
parent
2c6c9b73c8
commit
10d4f2fc1e
Notes:
sideshowbarker
2024-07-18 03:16:44 +09:00
Author: https://github.com/Lubrsi
Commit: 10d4f2fc1e
Pull-request: https://github.com/SerenityOS/serenity/pull/10282
Reviewed-by: https://github.com/linusg ✅
3 changed files with 12 additions and 0 deletions
|
@ -144,4 +144,11 @@ void HTMLStyleElement::update_a_style_block()
|
||||||
sheet.release_nonnull());
|
sheet.release_nonnull());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://drafts.csswg.org/cssom/#dom-linkstyle-sheet
|
||||||
|
RefPtr<CSS::CSSStyleSheet> 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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@ public:
|
||||||
|
|
||||||
void update_a_style_block();
|
void update_a_style_block();
|
||||||
|
|
||||||
|
RefPtr<CSS::CSSStyleSheet> sheet() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// https://drafts.csswg.org/cssom/#associated-css-style-sheet
|
// https://drafts.csswg.org/cssom/#associated-css-style-sheet
|
||||||
RefPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
|
RefPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
|
||||||
|
|
|
@ -4,4 +4,7 @@ interface HTMLStyleElement : HTMLElement {
|
||||||
|
|
||||||
[Reflect] attribute DOMString type;
|
[Reflect] attribute DOMString type;
|
||||||
|
|
||||||
|
// FIXME: This should come from a LinkStyle mixin
|
||||||
|
readonly attribute CSSStyleSheet? sheet;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue