mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:47:34 +00:00
LibWeb: Make StyleSheet::m_parent_style_sheet a WeakPtr
It's not safe for this to be a raw pointer, as the child can outlive the parent.
This commit is contained in:
parent
e8b85b13e2
commit
58b99df16d
3 changed files with 11 additions and 4 deletions
|
@ -41,7 +41,7 @@ public:
|
|||
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; }
|
||||
void set_parent_css_style_sheet(CSSStyleSheet*);
|
||||
|
||||
protected:
|
||||
StyleSheet() = default;
|
||||
|
@ -49,8 +49,7 @@ protected:
|
|||
private:
|
||||
WeakPtr<DOM::Element> m_owner_node;
|
||||
|
||||
// FIXME: Use WeakPtr.
|
||||
CSSStyleSheet* m_parent_style_sheet { nullptr };
|
||||
WeakPtr<CSSStyleSheet> m_parent_style_sheet;
|
||||
|
||||
String m_title;
|
||||
String m_type_string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue