mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:27:35 +00:00
LibWeb: Start exposing CSS style sheets to JavaScript :^)
This patch adds bindings for the following objects: - StyleSheet - StyleSheetList - CSSStyleSheet You can get to a document's style sheets via Document.styleSheets and iterate through them using StyleSheetList's item() and length(). That's it in terms of functionality at this point, but still neat. :^)
This commit is contained in:
parent
0d515dea5d
commit
a9830d9a55
12 changed files with 86 additions and 13 deletions
|
@ -92,6 +92,8 @@ public:
|
|||
CSS::StyleSheetList& style_sheets() { return *m_style_sheets; }
|
||||
const CSS::StyleSheetList& style_sheets() const { return *m_style_sheets; }
|
||||
|
||||
NonnullRefPtr<CSS::StyleSheetList> style_sheets_for_bindings() { return *m_style_sheets; }
|
||||
|
||||
virtual FlyString node_name() const override { return "#document"; }
|
||||
|
||||
void set_hovered_node(Node*);
|
||||
|
|
|
@ -29,6 +29,8 @@ interface Document : Node {
|
|||
Comment createComment(DOMString data);
|
||||
Range createRange();
|
||||
|
||||
[ImplementedAs=style_sheets_for_bindings] readonly attribute StyleSheetList styleSheets;
|
||||
|
||||
readonly attribute DOMString compatMode;
|
||||
readonly attribute DocumentType? doctype;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue