1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

LibWeb: Make StyleSheet and CSSStyleSheet GC-allocated

This commit is contained in:
Andreas Kling 2022-08-07 13:14:54 +02:00
parent 0fe923e355
commit 5d60212076
21 changed files with 166 additions and 96 deletions

View file

@ -5,12 +5,25 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/StyleSheetPrototype.h>
#include <LibWeb/Bindings/WindowObject.h>
#include <LibWeb/CSS/CSSStyleSheet.h>
#include <LibWeb/CSS/StyleSheet.h>
#include <LibWeb/DOM/Element.h>
namespace Web::CSS {
StyleSheet::StyleSheet(Bindings::WindowObject& window_object)
: PlatformObject(window_object.ensure_web_prototype<Bindings::StyleSheetPrototype>("StyleSheet"))
{
}
void StyleSheet::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_parent_style_sheet);
}
void StyleSheet::set_owner_node(DOM::Element* element)
{
if (element)