mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:27:34 +00:00
LibWeb: Reimplement the <style> element following the spec
We now follow the "update a style block" algorithm from the HTML spec instead of using the ad-hoc CSSLoader mechanism. This necessitated improving our StyleSheet and CSSStyleSheet classes as well, so that's baked into this commit.
This commit is contained in:
parent
6cda24097b
commit
d462a6720a
7 changed files with 163 additions and 24 deletions
|
@ -26,11 +26,39 @@ public:
|
|||
DOM::Element* owner_node() { return m_owner_node; }
|
||||
void set_owner_node(DOM::Element*);
|
||||
|
||||
String title() const { return m_title; }
|
||||
void set_title(String title) { m_title = move(title); }
|
||||
|
||||
void set_type(String type) { m_type_string = move(type); }
|
||||
void set_media(String media) { m_media_string = move(media); }
|
||||
|
||||
bool is_alternate() const { return m_alternate; }
|
||||
void set_alternate(bool alternate) { m_alternate = alternate; }
|
||||
|
||||
void set_origin_clean(bool origin_clean) { m_origin_clean = origin_clean; }
|
||||
|
||||
bool disabled() const { return m_disabled; }
|
||||
void set_disabled(bool disabled) { m_disabled = disabled; }
|
||||
|
||||
CSSStyleSheet* parent_style_sheet() { return m_parent_style_sheet; }
|
||||
void set_parent_css_style_sheet(CSSStyleSheet* sheet) { m_parent_style_sheet = sheet; }
|
||||
|
||||
protected:
|
||||
StyleSheet() = default;
|
||||
|
||||
private:
|
||||
WeakPtr<DOM::Element> m_owner_node;
|
||||
|
||||
// FIXME: Use WeakPtr.
|
||||
CSSStyleSheet* m_parent_style_sheet { nullptr };
|
||||
|
||||
String m_title;
|
||||
String m_type_string;
|
||||
String m_media_string;
|
||||
|
||||
bool m_disabled { false };
|
||||
bool m_alternate { false };
|
||||
bool m_origin_clean { true };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue