mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
58b99df16d
It's not safe for this to be a raw pointer, as the child can outlive the parent.
28 lines
585 B
C++
28 lines
585 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>
|
|
|
|
namespace Web::CSS {
|
|
|
|
void StyleSheet::set_owner_node(DOM::Element* element)
|
|
{
|
|
if (element)
|
|
m_owner_node = element->make_weak_ptr<DOM::Element>();
|
|
else
|
|
m_owner_node = nullptr;
|
|
}
|
|
|
|
void StyleSheet::set_parent_css_style_sheet(CSSStyleSheet* parent)
|
|
{
|
|
m_parent_style_sheet = parent;
|
|
}
|
|
|
|
}
|