2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2018-2021, Andreas Kling <andreas@ladybird.org>
|
2021-02-21 13:45:26 +02:00
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2019-06-15 18:55:47 +02:00
|
|
|
#pragma once
|
|
|
|
|
2020-12-08 22:11:02 +01:00
|
|
|
#include <AK/Forward.h>
|
2025-07-19 19:35:33 -07:00
|
|
|
#include <LibWeb/Export.h>
|
2020-03-29 22:24:23 +02:00
|
|
|
#include <LibWeb/Forward.h>
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2020-03-29 22:24:23 +02:00
|
|
|
namespace Web {
|
2019-06-15 18:55:47 +02:00
|
|
|
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API void dump_tree(HTML::TraversableNavigable&);
|
2021-07-12 14:13:29 +01:00
|
|
|
void dump_tree(StringBuilder&, DOM::Node const&);
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API void dump_tree(DOM::Node const&);
|
2025-08-27 11:25:04 +02:00
|
|
|
WEB_API void dump_tree(StringBuilder&, Layout::Node const&, bool show_cascaded_properties = false, bool colorize = false);
|
|
|
|
WEB_API void dump_tree(Layout::Node const&, bool show_cascaded_properties = false);
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API void dump_tree(StringBuilder&, Painting::Paintable const&, bool colorize = false, int indent = 0);
|
|
|
|
WEB_API void dump_tree(Painting::Paintable const&);
|
2024-10-15 11:35:01 +01:00
|
|
|
void dump_sheet(StringBuilder&, CSS::StyleSheet const&);
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API void dump_sheet(CSS::StyleSheet const&);
|
2024-10-15 11:35:01 +01:00
|
|
|
void dump_rule(StringBuilder&, CSS::CSSRule const&, int indent_levels = 0);
|
|
|
|
void dump_rule(CSS::CSSRule const&);
|
LibWeb/CSS: Merge style declaration subclasses into CSSStyleProperties
We previously had PropertyOwningCSSStyleDeclaration and
ResolvedCSSStyleDeclaration, representing the current style properties
and resolved style respectively. Both of these were the
CSSStyleDeclaration type in the CSSOM. (We also had
ElementInlineCSSStyleDeclaration but I removed that in a previous
commit.)
In the meantime, the spec has changed so that these should now be a new
CSSStyleProperties type in the CSSOM. Also, we need to subclass
CSSStyleDeclaration for things like CSSFontFaceRule's list of
descriptors, which means it wouldn't hold style properties.
So, this commit does the fairly messy work of combining these two types
into a new CSSStyleProperties class. A lot of what previously was done
as separate methods in the two classes, now follows the spec steps of
"if the readonly flag is set, do X" instead, which is hopefully easier
to follow too.
There is still some functionality in CSSStyleDeclaration that belongs in
CSSStyleProperties, but I'll do that next. To avoid a huge diff for
"CSSStyleDeclaration-all-supported-properties-and-default-values.txt"
both here and in the following commit, we don't apply the (currently
empty) CSSStyleProperties prototype yet.
2025-03-17 17:50:49 +00:00
|
|
|
void dump_style_properties(StringBuilder&, CSS::CSSStyleProperties const&, int indent_levels = 0);
|
2025-05-08 14:37:25 +01:00
|
|
|
void dump_descriptors(StringBuilder&, CSS::CSSDescriptors const&, int indent_levels = 0);
|
2022-03-28 20:30:26 +01:00
|
|
|
void dump_font_face_rule(StringBuilder&, CSS::CSSFontFaceRule const&, int indent_levels = 0);
|
2021-09-29 12:48:04 +01:00
|
|
|
void dump_import_rule(StringBuilder&, CSS::CSSImportRule const&, int indent_levels = 0);
|
2025-05-08 12:11:52 +01:00
|
|
|
void dump_keyframe_rule(StringBuilder&, CSS::CSSKeyframeRule const&, int indent_levels = 0);
|
|
|
|
void dump_keyframes_rule(StringBuilder&, CSS::CSSKeyframesRule const&, int indent_levels = 0);
|
2024-10-15 11:35:01 +01:00
|
|
|
void dump_media_rule(StringBuilder&, CSS::CSSMediaRule const&, int indent_levels = 0);
|
2025-05-13 12:17:41 +01:00
|
|
|
void dump_page_rule(StringBuilder&, CSS::CSSPageRule const&, int indent_levels = 0);
|
2025-05-15 11:48:56 +01:00
|
|
|
void dump_margin_rule(StringBuilder&, CSS::CSSMarginRule const&, int indent_levels = 0);
|
2024-10-15 11:35:01 +01:00
|
|
|
void dump_style_rule(StringBuilder&, CSS::CSSStyleRule const&, int indent_levels = 0);
|
|
|
|
void dump_supports_rule(StringBuilder&, CSS::CSSSupportsRule const&, int indent_levels = 0);
|
2024-10-17 23:28:09 +01:00
|
|
|
void dump_property_rule(StringBuilder&, CSS::CSSPropertyRule const&, int indent_levels = 0);
|
2024-10-15 11:35:01 +01:00
|
|
|
void dump_namespace_rule(StringBuilder&, CSS::CSSNamespaceRule const&, int indent_levels = 0);
|
2024-10-15 15:59:31 +01:00
|
|
|
void dump_nested_declarations(StringBuilder&, CSS::CSSNestedDeclarations const&, int indent_levels = 0);
|
2024-09-02 16:45:25 +01:00
|
|
|
void dump_layer_block_rule(StringBuilder&, CSS::CSSLayerBlockRule const&, int indent_levels = 0);
|
|
|
|
void dump_layer_statement_rule(StringBuilder&, CSS::CSSLayerStatementRule const&, int indent_levels = 0);
|
2024-10-15 15:12:34 +01:00
|
|
|
void dump_selector(StringBuilder&, CSS::Selector const&, int indent_levels = 0);
|
2021-07-12 14:13:29 +01:00
|
|
|
void dump_selector(CSS::Selector const&);
|
2019-09-25 12:42:10 +03:00
|
|
|
|
2020-03-07 10:27:02 +01:00
|
|
|
}
|