1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +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:
Andreas Kling 2021-12-05 15:33:49 +01:00
parent e8b85b13e2
commit 58b99df16d
3 changed files with 11 additions and 4 deletions

View file

@ -5,6 +5,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/CSS/CSSStyleSheet.h>
#include <LibWeb/CSS/StyleSheet.h>
#include <LibWeb/DOM/Element.h>
@ -18,4 +19,9 @@ void StyleSheet::set_owner_node(DOM::Element* element)
m_owner_node = nullptr;
}
void StyleSheet::set_parent_css_style_sheet(CSSStyleSheet* parent)
{
m_parent_style_sheet = parent;
}
}