mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
d5cddd4696
Previously, the parent CSS stylesheet, owner node and owner CSS rule properties were not unset when removing a sheet from a StyleSheetList. This change moves the methods for adding and removing sheets to and from a StyleSheetList, directly into the StyleSheetList class and ensures they are called as required by the CSSOM specification.
28 lines
665 B
C++
28 lines
665 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);
|
|
|
|
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;
|
|
};
|
|
|
|
}
|