2023-06-08 16:07:12 +01:00
|
|
|
/*
|
|
|
|
* 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>
|
2024-03-08 19:27:24 +01:00
|
|
|
#include <LibWeb/WebIDL/ObservableArray.h>
|
2023-06-08 16:07:12 +01:00
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
|
|
|
class StyleElementUtils {
|
|
|
|
public:
|
2024-09-21 08:11:49 +02:00
|
|
|
void update_a_style_block(DOM::Element& style_element);
|
2023-06-08 16:07:12 +01:00
|
|
|
|
|
|
|
CSS::CSSStyleSheet* sheet() { return m_associated_css_style_sheet; }
|
|
|
|
CSS::CSSStyleSheet const* sheet() const { return m_associated_css_style_sheet; }
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
[[nodiscard]] GC::Ptr<CSS::StyleSheetList> style_sheet_list() { return m_style_sheet_list; }
|
|
|
|
[[nodiscard]] GC::Ptr<CSS::StyleSheetList const> style_sheet_list() const { return m_style_sheet_list; }
|
2024-09-21 08:11:49 +02:00
|
|
|
|
|
|
|
void visit_edges(JS::Cell::Visitor&);
|
2024-09-21 07:47:37 +02:00
|
|
|
|
2023-06-08 16:07:12 +01:00
|
|
|
private:
|
|
|
|
// https://www.w3.org/TR/cssom/#associated-css-style-sheet
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ptr<CSS::CSSStyleSheet> m_associated_css_style_sheet;
|
2024-09-21 08:11:49 +02:00
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ptr<CSS::StyleSheetList> m_style_sheet_list;
|
2023-06-08 16:07:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|