/src/serenity/Userland/Libraries/LibWeb/DOM/StyleElementUtils.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2023, Preston Taylor <PrestonLeeTaylor@proton.me> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <LibWeb/CSS/CSSStyleSheet.h> |
10 | | #include <LibWeb/DOM/Element.h> |
11 | | #include <LibWeb/WebIDL/ObservableArray.h> |
12 | | |
13 | | namespace Web::DOM { |
14 | | |
15 | | class StyleElementUtils { |
16 | | public: |
17 | | void update_a_style_block(DOM::Element& style_element); |
18 | | |
19 | 0 | CSS::CSSStyleSheet* sheet() { return m_associated_css_style_sheet; } |
20 | 0 | CSS::CSSStyleSheet const* sheet() const { return m_associated_css_style_sheet; } |
21 | | |
22 | 0 | [[nodiscard]] JS::GCPtr<CSS::StyleSheetList> style_sheet_list() { return m_style_sheet_list; } |
23 | 0 | [[nodiscard]] JS::GCPtr<CSS::StyleSheetList const> style_sheet_list() const { return m_style_sheet_list; } |
24 | | |
25 | | void visit_edges(JS::Cell::Visitor&); |
26 | | |
27 | | private: |
28 | | // https://www.w3.org/TR/cssom/#associated-css-style-sheet |
29 | | JS::GCPtr<CSS::CSSStyleSheet> m_associated_css_style_sheet; |
30 | | |
31 | | JS::GCPtr<CSS::StyleSheetList> m_style_sheet_list; |
32 | | }; |
33 | | |
34 | | } |