mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
ffad902c07
Unlike ensure_web_prototype<T>(), the cached version doesn't require the prototype type to be fully formed, so we can use it without including the FooPrototype.h header. It's also a bit less verbose. :^)
37 lines
816 B
C++
37 lines
816 B
C++
/*
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/CSS/CSSStyleSheet.h>
|
|
#include <LibWeb/CSS/StyleSheet.h>
|
|
#include <LibWeb/DOM/Element.h>
|
|
#include <LibWeb/HTML/Window.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
StyleSheet::StyleSheet(HTML::Window& window_object)
|
|
: PlatformObject(window_object.cached_web_prototype("StyleSheet"))
|
|
{
|
|
}
|
|
|
|
void StyleSheet::visit_edges(Cell::Visitor& visitor)
|
|
{
|
|
Base::visit_edges(visitor);
|
|
visitor.visit(m_owner_node);
|
|
visitor.visit(m_parent_style_sheet);
|
|
}
|
|
|
|
void StyleSheet::set_owner_node(DOM::Element* element)
|
|
{
|
|
m_owner_node = element;
|
|
}
|
|
|
|
void StyleSheet::set_parent_css_style_sheet(CSSStyleSheet* parent)
|
|
{
|
|
m_parent_style_sheet = parent;
|
|
}
|
|
|
|
}
|