mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-27 01:50:24 +00:00
3b7534b362
Before this change, removing a style element from inside a shadow tree would cause it to be unregistered with the document-level list of sheets instead of the shadow-root-level list. This would eventually lead to a verification failure if someone tried to update the text contents of that style element, since it was still in the shadow-root-level list, but now with a null owner element. Fixes a crash on https://www.swedbank.se/
27 lines
724 B
C++
27 lines
724 B
C++
/*
|
|
* Copyright (c) 2023, Preston Taylor <PrestonLeeTaylor@proton.me>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/CSS/CSSStyleSheet.h>
|
|
#include <LibWeb/DOM/Element.h>
|
|
#include <LibWeb/WebIDL/ObservableArray.h>
|
|
|
|
namespace Web::DOM {
|
|
|
|
class StyleElementUtils {
|
|
public:
|
|
void update_a_style_block(DOM::Element& style_element, JS::GCPtr<DOM::Node> old_parent_if_removed_from = nullptr);
|
|
|
|
CSS::CSSStyleSheet* sheet() { return m_associated_css_style_sheet; }
|
|
CSS::CSSStyleSheet const* sheet() const { return m_associated_css_style_sheet; }
|
|
|
|
private:
|
|
// https://www.w3.org/TR/cssom/#associated-css-style-sheet
|
|
JS::GCPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
|
|
};
|
|
|
|
}
|