From c1cad8fa0e10827b71d14311b17a5c66e7c0b2a5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 20 Dec 2024 11:32:17 +0100 Subject: [PATCH] LibWeb: Rename CSS::StyleProperties => CSS::ComputedProperties Now that StyleProperties is only used to hold computed properties, let's name it ComputedProperties. --- Libraries/LibWeb/Animations/AnimationEffect.h | 2 +- .../LibWeb/Animations/KeyframeEffect.cpp | 6 +- Libraries/LibWeb/Animations/KeyframeEffect.h | 2 +- Libraries/LibWeb/CMakeLists.txt | 2 +- ...eProperties.cpp => ComputedProperties.cpp} | 256 +++++++++--------- ...StyleProperties.h => ComputedProperties.h} | 10 +- Libraries/LibWeb/CSS/SelectorEngine.cpp | 2 +- Libraries/LibWeb/CSS/StyleComputer.cpp | 64 ++--- Libraries/LibWeb/CSS/StyleComputer.h | 32 +-- Libraries/LibWeb/CSS/StyleInvalidation.cpp | 6 +- Libraries/LibWeb/DOM/Document.cpp | 2 +- Libraries/LibWeb/DOM/Element.cpp | 20 +- Libraries/LibWeb/DOM/Element.h | 26 +- Libraries/LibWeb/Forward.h | 2 +- .../LibWeb/Geometry/DOMMatrixReadOnly.cpp | 4 +- Libraries/LibWeb/HTML/HTMLAudioElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLAudioElement.h | 4 +- Libraries/LibWeb/HTML/HTMLBRElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLBRElement.h | 4 +- Libraries/LibWeb/HTML/HTMLBodyElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLCanvasElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLCanvasElement.h | 4 +- Libraries/LibWeb/HTML/HTMLDivElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLElement.h | 2 +- Libraries/LibWeb/HTML/HTMLEmbedElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLEmbedElement.h | 2 +- Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLFieldSetElement.h | 2 +- Libraries/LibWeb/HTML/HTMLFontElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLFrameElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLFrameElement.h | 2 +- Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLFrameSetElement.h | 2 +- Libraries/LibWeb/HTML/HTMLHRElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLHeadingElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLIFrameElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLIFrameElement.h | 4 +- Libraries/LibWeb/HTML/HTMLImageElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLImageElement.h | 4 +- Libraries/LibWeb/HTML/HTMLInputElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLInputElement.h | 4 +- Libraries/LibWeb/HTML/HTMLLabelElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLLabelElement.h | 2 +- Libraries/LibWeb/HTML/HTMLLegendElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLLegendElement.h | 2 +- Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLMeterElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLMeterElement.h | 2 +- Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLObjectElement.h | 4 +- .../LibWeb/HTML/HTMLParagraphElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLPreElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLProgressElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLProgressElement.h | 2 +- Libraries/LibWeb/HTML/HTMLSelectElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLSelectElement.h | 2 +- .../LibWeb/HTML/HTMLTableCaptionElement.cpp | 2 +- .../LibWeb/HTML/HTMLTableCellElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTableColElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTableElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTableRowElement.cpp | 2 +- .../LibWeb/HTML/HTMLTableSectionElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLTextAreaElement.h | 2 +- Libraries/LibWeb/HTML/HTMLVideoElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLVideoElement.h | 4 +- Libraries/LibWeb/Layout/AudioBox.cpp | 2 +- Libraries/LibWeb/Layout/AudioBox.h | 2 +- Libraries/LibWeb/Layout/BlockContainer.cpp | 2 +- Libraries/LibWeb/Layout/BlockContainer.h | 2 +- Libraries/LibWeb/Layout/Box.cpp | 2 +- Libraries/LibWeb/Layout/Box.h | 2 +- Libraries/LibWeb/Layout/BreakNode.cpp | 2 +- Libraries/LibWeb/Layout/BreakNode.h | 2 +- Libraries/LibWeb/Layout/CanvasBox.cpp | 2 +- Libraries/LibWeb/Layout/CanvasBox.h | 2 +- Libraries/LibWeb/Layout/CheckBox.cpp | 2 +- Libraries/LibWeb/Layout/CheckBox.h | 2 +- Libraries/LibWeb/Layout/FieldSetBox.cpp | 2 +- Libraries/LibWeb/Layout/FieldSetBox.h | 2 +- .../Layout/FormAssociatedLabelableNode.h | 2 +- Libraries/LibWeb/Layout/ImageBox.cpp | 2 +- Libraries/LibWeb/Layout/ImageBox.h | 2 +- Libraries/LibWeb/Layout/InlineNode.cpp | 2 +- Libraries/LibWeb/Layout/InlineNode.h | 2 +- Libraries/LibWeb/Layout/Label.cpp | 2 +- Libraries/LibWeb/Layout/Label.h | 2 +- Libraries/LibWeb/Layout/LabelableNode.h | 2 +- Libraries/LibWeb/Layout/LegendBox.cpp | 2 +- Libraries/LibWeb/Layout/LegendBox.h | 2 +- Libraries/LibWeb/Layout/ListItemBox.cpp | 2 +- Libraries/LibWeb/Layout/ListItemBox.h | 2 +- Libraries/LibWeb/Layout/ListItemMarkerBox.cpp | 2 +- Libraries/LibWeb/Layout/ListItemMarkerBox.h | 2 +- .../Layout/NavigableContainerViewport.cpp | 2 +- .../Layout/NavigableContainerViewport.h | 2 +- Libraries/LibWeb/Layout/Node.cpp | 4 +- Libraries/LibWeb/Layout/Node.h | 8 +- Libraries/LibWeb/Layout/RadioButton.cpp | 2 +- Libraries/LibWeb/Layout/RadioButton.h | 2 +- Libraries/LibWeb/Layout/ReplacedBox.cpp | 2 +- Libraries/LibWeb/Layout/ReplacedBox.h | 2 +- Libraries/LibWeb/Layout/SVGBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGBox.h | 2 +- Libraries/LibWeb/Layout/SVGClipBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGClipBox.h | 2 +- .../LibWeb/Layout/SVGForeignObjectBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGForeignObjectBox.h | 2 +- Libraries/LibWeb/Layout/SVGGeometryBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGGeometryBox.h | 2 +- Libraries/LibWeb/Layout/SVGGraphicsBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGGraphicsBox.h | 2 +- Libraries/LibWeb/Layout/SVGImageBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGImageBox.h | 2 +- Libraries/LibWeb/Layout/SVGMaskBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGMaskBox.h | 2 +- Libraries/LibWeb/Layout/SVGSVGBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGSVGBox.h | 2 +- Libraries/LibWeb/Layout/SVGTextBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGTextBox.h | 2 +- Libraries/LibWeb/Layout/SVGTextPathBox.cpp | 2 +- Libraries/LibWeb/Layout/SVGTextPathBox.h | 2 +- Libraries/LibWeb/Layout/TableWrapper.cpp | 2 +- Libraries/LibWeb/Layout/TableWrapper.h | 2 +- Libraries/LibWeb/Layout/TreeBuilder.cpp | 2 +- Libraries/LibWeb/Layout/VideoBox.cpp | 2 +- Libraries/LibWeb/Layout/VideoBox.h | 2 +- Libraries/LibWeb/Layout/Viewport.cpp | 2 +- Libraries/LibWeb/Layout/Viewport.h | 2 +- Libraries/LibWeb/SVG/SVGAElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGAElement.h | 2 +- Libraries/LibWeb/SVG/SVGClipPathElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGClipPathElement.h | 2 +- Libraries/LibWeb/SVG/SVGDefsElement.h | 2 +- Libraries/LibWeb/SVG/SVGDescElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGDescElement.h | 2 +- Libraries/LibWeb/SVG/SVGElement.cpp | 2 +- .../LibWeb/SVG/SVGForeignObjectElement.cpp | 2 +- .../LibWeb/SVG/SVGForeignObjectElement.h | 2 +- Libraries/LibWeb/SVG/SVGGElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGGElement.h | 2 +- Libraries/LibWeb/SVG/SVGGeometryElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGGeometryElement.h | 2 +- Libraries/LibWeb/SVG/SVGImageElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGImageElement.h | 2 +- Libraries/LibWeb/SVG/SVGMaskElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGMaskElement.h | 2 +- Libraries/LibWeb/SVG/SVGMetadataElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGMetadataElement.h | 2 +- Libraries/LibWeb/SVG/SVGSVGElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGSVGElement.h | 2 +- Libraries/LibWeb/SVG/SVGStopElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGSymbolElement.cpp | 4 +- Libraries/LibWeb/SVG/SVGSymbolElement.h | 2 +- Libraries/LibWeb/SVG/SVGTSpanElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGTSpanElement.h | 2 +- Libraries/LibWeb/SVG/SVGTextElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGTextElement.h | 2 +- Libraries/LibWeb/SVG/SVGTextPathElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGTextPathElement.h | 2 +- Libraries/LibWeb/SVG/SVGTitleElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGTitleElement.h | 2 +- Libraries/LibWeb/SVG/SVGUseElement.cpp | 2 +- Libraries/LibWeb/SVG/SVGUseElement.h | 2 +- .../Userland/Libraries/LibWeb/CSS/BUILD.gn | 2 +- Services/WebContent/ConnectionFromClient.cpp | 6 +- Services/WebContent/WebDriverConnection.cpp | 2 +- 168 files changed, 397 insertions(+), 397 deletions(-) rename Libraries/LibWeb/CSS/{StyleProperties.cpp => ComputedProperties.cpp} (82%) rename Libraries/LibWeb/CSS/{StyleProperties.h => ComputedProperties.h} (97%) diff --git a/Libraries/LibWeb/Animations/AnimationEffect.h b/Libraries/LibWeb/Animations/AnimationEffect.h index 11b6d2676aa..371d3b740d5 100644 --- a/Libraries/LibWeb/Animations/AnimationEffect.h +++ b/Libraries/LibWeb/Animations/AnimationEffect.h @@ -143,7 +143,7 @@ public: virtual DOM::Element* target() const { return {}; } virtual bool is_keyframe_effect() const { return false; } - virtual void update_style_properties() = 0; + virtual void update_computed_properties() = 0; protected: AnimationEffect(JS::Realm&); diff --git a/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Libraries/LibWeb/Animations/KeyframeEffect.cpp index 96d2ba375bd..4c0ee04fc35 100644 --- a/Libraries/LibWeb/Animations/KeyframeEffect.cpp +++ b/Libraries/LibWeb/Animations/KeyframeEffect.cpp @@ -915,13 +915,13 @@ static CSS::RequiredInvalidationAfterStyleChange compute_required_invalidation(H return invalidation; } -void KeyframeEffect::update_style_properties() +void KeyframeEffect::update_computed_properties() { auto target = this->target(); if (!target) return; - Optional style = {}; + Optional style = {}; if (!pseudo_element_type().has_value()) style = target->computed_css_values(); else @@ -944,7 +944,7 @@ void KeyframeEffect::update_style_properties() for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) { if (element_style->is_property_inherited(static_cast(i))) { auto new_value = CSS::StyleComputer::get_inherit_value(static_cast(i), &element); - element_style->set_property(static_cast(i), *new_value, CSS::StyleProperties::Inherited::Yes); + element_style->set_property(static_cast(i), *new_value, CSS::ComputedProperties::Inherited::Yes); } } diff --git a/Libraries/LibWeb/Animations/KeyframeEffect.h b/Libraries/LibWeb/Animations/KeyframeEffect.h index 305babea3d4..405773dd943 100644 --- a/Libraries/LibWeb/Animations/KeyframeEffect.h +++ b/Libraries/LibWeb/Animations/KeyframeEffect.h @@ -105,7 +105,7 @@ public: virtual bool is_keyframe_effect() const override { return true; } - virtual void update_style_properties() override; + virtual void update_computed_properties() override; Optional last_css_animation_play_state() const { return m_last_css_animation_play_state; } void set_last_css_animation_play_state(CSS::AnimationPlayState state) { m_last_css_animation_play_state = state; } diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 78147441af0..b67b1623791 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -71,6 +71,7 @@ set(SOURCES CSS/CSSSupportsRule.cpp CSS/CSSTransition.cpp CSS/CascadedProperties.cpp + CSS/ComputedProperties.cpp CSS/Display.cpp CSS/EdgeRect.cpp CSS/FontFace.cpp @@ -114,7 +115,6 @@ set(SOURCES CSS/Sizing.cpp CSS/StyleComputer.cpp CSS/StyleInvalidation.cpp - CSS/StyleProperties.cpp CSS/StyleProperty.cpp CSS/StyleSheet.cpp CSS/StyleSheetIdentifier.cpp diff --git a/Libraries/LibWeb/CSS/StyleProperties.cpp b/Libraries/LibWeb/CSS/ComputedProperties.cpp similarity index 82% rename from Libraries/LibWeb/CSS/StyleProperties.cpp rename to Libraries/LibWeb/CSS/ComputedProperties.cpp index 657ef4a8e1b..bbe2b29a3ca 100644 --- a/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Libraries/LibWeb/CSS/ComputedProperties.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,9 +42,9 @@ namespace Web::CSS { -NonnullRefPtr StyleProperties::Data::clone() const +NonnullRefPtr ComputedProperties::Data::clone() const { - auto clone = adopt_ref(*new StyleProperties::Data); + auto clone = adopt_ref(*new ComputedProperties::Data); clone->m_animation_name_source = m_animation_name_source; clone->m_transition_property_source = m_transition_property_source; clone->m_property_values = m_property_values; @@ -57,13 +57,13 @@ NonnullRefPtr StyleProperties::Data::clone() const return clone; } -bool StyleProperties::is_property_important(CSS::PropertyID property_id) const +bool ComputedProperties::is_property_important(CSS::PropertyID property_id) const { size_t n = to_underlying(property_id); return m_data->m_property_important[n / 8] & (1 << (n % 8)); } -void StyleProperties::set_property_important(CSS::PropertyID property_id, Important important) +void ComputedProperties::set_property_important(CSS::PropertyID property_id, Important important) { size_t n = to_underlying(property_id); if (important == Important::Yes) @@ -72,13 +72,13 @@ void StyleProperties::set_property_important(CSS::PropertyID property_id, Import m_data->m_property_important[n / 8] &= ~(1 << (n % 8)); } -bool StyleProperties::is_property_inherited(CSS::PropertyID property_id) const +bool ComputedProperties::is_property_inherited(CSS::PropertyID property_id) const { size_t n = to_underlying(property_id); return m_data->m_property_inherited[n / 8] & (1 << (n % 8)); } -void StyleProperties::set_property_inherited(CSS::PropertyID property_id, Inherited inherited) +void ComputedProperties::set_property_inherited(CSS::PropertyID property_id, Inherited inherited) { size_t n = to_underlying(property_id); if (inherited == Inherited::Yes) @@ -87,31 +87,31 @@ void StyleProperties::set_property_inherited(CSS::PropertyID property_id, Inheri m_data->m_property_inherited[n / 8] &= ~(1 << (n % 8)); } -void StyleProperties::set_property(CSS::PropertyID id, NonnullRefPtr value, Inherited inherited, Important important) +void ComputedProperties::set_property(CSS::PropertyID id, NonnullRefPtr value, Inherited inherited, Important important) { m_data->m_property_values[to_underlying(id)] = move(value); set_property_important(id, important); set_property_inherited(id, inherited); } -void StyleProperties::revert_property(CSS::PropertyID id, StyleProperties const& style_for_revert) +void ComputedProperties::revert_property(CSS::PropertyID id, ComputedProperties const& style_for_revert) { m_data->m_property_values[to_underlying(id)] = style_for_revert.m_data->m_property_values[to_underlying(id)]; set_property_important(id, style_for_revert.is_property_important(id) ? Important::Yes : Important::No); set_property_inherited(id, style_for_revert.is_property_inherited(id) ? Inherited::Yes : Inherited::No); } -void StyleProperties::set_animated_property(CSS::PropertyID id, NonnullRefPtr value) +void ComputedProperties::set_animated_property(CSS::PropertyID id, NonnullRefPtr value) { m_data->m_animated_property_values.set(id, move(value)); } -void StyleProperties::reset_animated_properties() +void ComputedProperties::reset_animated_properties() { m_data->m_animated_property_values.clear(); } -CSSStyleValue const& StyleProperties::property(CSS::PropertyID property_id, WithAnimationsApplied return_animated_value) const +CSSStyleValue const& ComputedProperties::property(CSS::PropertyID property_id, WithAnimationsApplied return_animated_value) const { if (return_animated_value == WithAnimationsApplied::Yes) { if (auto animated_value = m_data->m_animated_property_values.get(property_id); animated_value.has_value()) @@ -122,14 +122,14 @@ CSSStyleValue const& StyleProperties::property(CSS::PropertyID property_id, With return *m_data->m_property_values[to_underlying(property_id)]; } -CSSStyleValue const* StyleProperties::maybe_null_property(CSS::PropertyID property_id) const +CSSStyleValue const* ComputedProperties::maybe_null_property(CSS::PropertyID property_id) const { if (auto animated_value = m_data->m_animated_property_values.get(property_id); animated_value.has_value()) return animated_value.value(); return m_data->m_property_values[to_underlying(property_id)]; } -Variant StyleProperties::gap_value(CSS::PropertyID id) const +Variant ComputedProperties::gap_value(CSS::PropertyID id) const { auto const& value = property(id); if (value.is_keyword()) { @@ -149,7 +149,7 @@ Variant StyleProperties::gap_value(CSS::PropertyID VERIFY_NOT_REACHED(); } -CSS::Size StyleProperties::size_value(CSS::PropertyID id) const +CSS::Size ComputedProperties::size_value(CSS::PropertyID id) const { auto const& value = property(id); if (value.is_keyword()) { @@ -187,12 +187,12 @@ CSS::Size StyleProperties::size_value(CSS::PropertyID id) const return CSS::Size::make_auto(); } -LengthPercentage StyleProperties::length_percentage_or_fallback(CSS::PropertyID id, LengthPercentage const& fallback) const +LengthPercentage ComputedProperties::length_percentage_or_fallback(CSS::PropertyID id, LengthPercentage const& fallback) const { return length_percentage(id).value_or(fallback); } -Optional StyleProperties::length_percentage(CSS::PropertyID id) const +Optional ComputedProperties::length_percentage(CSS::PropertyID id) const { auto const& value = property(id); @@ -211,7 +211,7 @@ Optional StyleProperties::length_percentage(CSS::PropertyID id return {}; } -LengthBox StyleProperties::length_box(CSS::PropertyID left_id, CSS::PropertyID top_id, CSS::PropertyID right_id, CSS::PropertyID bottom_id, const CSS::Length& default_value) const +LengthBox ComputedProperties::length_box(CSS::PropertyID left_id, CSS::PropertyID top_id, CSS::PropertyID right_id, CSS::PropertyID bottom_id, const CSS::Length& default_value) const { LengthBox box; box.left() = length_percentage_or_fallback(left_id, default_value); @@ -221,7 +221,7 @@ LengthBox StyleProperties::length_box(CSS::PropertyID left_id, CSS::PropertyID t return box; } -Color StyleProperties::color_or_fallback(CSS::PropertyID id, Layout::NodeWithStyle const& node, Color fallback) const +Color ComputedProperties::color_or_fallback(CSS::PropertyID id, Layout::NodeWithStyle const& node, Color fallback) const { auto const& value = property(id); if (!value.has_color()) @@ -229,7 +229,7 @@ Color StyleProperties::color_or_fallback(CSS::PropertyID id, Layout::NodeWithSty return value.to_color(node); } -NonnullRefPtr StyleProperties::font_fallback(bool monospace, bool bold) +NonnullRefPtr ComputedProperties::font_fallback(bool monospace, bool bold) { if (monospace && bold) return Platform::FontPlugin::the().default_fixed_width_font().bold_variant(); @@ -243,7 +243,7 @@ NonnullRefPtr StyleProperties::font_fallback(bool monospace, bo return Platform::FontPlugin::the().default_font(); } -CSSPixels StyleProperties::compute_line_height(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const +CSSPixels ComputedProperties::compute_line_height(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const { auto const& line_height = property(CSS::PropertyID::LineHeight); @@ -286,7 +286,7 @@ CSSPixels StyleProperties::compute_line_height(CSSPixelRect const& viewport_rect return font_metrics.line_height; } -Optional StyleProperties::z_index() const +Optional ComputedProperties::z_index() const { auto const& value = property(CSS::PropertyID::ZIndex); if (value.has_auto()) @@ -303,7 +303,7 @@ Optional StyleProperties::z_index() const return {}; } -float StyleProperties::resolve_opacity_value(CSSStyleValue const& value) +float ComputedProperties::resolve_opacity_value(CSSStyleValue const& value) { float unclamped_opacity = 1.0f; @@ -331,31 +331,31 @@ float StyleProperties::resolve_opacity_value(CSSStyleValue const& value) return clamp(unclamped_opacity, 0.0f, 1.0f); } -float StyleProperties::opacity() const +float ComputedProperties::opacity() const { auto const& value = property(CSS::PropertyID::Opacity); return resolve_opacity_value(value); } -float StyleProperties::fill_opacity() const +float ComputedProperties::fill_opacity() const { auto const& value = property(CSS::PropertyID::FillOpacity); return resolve_opacity_value(value); } -Optional StyleProperties::stroke_linecap() const +Optional ComputedProperties::stroke_linecap() const { auto const& value = property(CSS::PropertyID::StrokeLinecap); return keyword_to_stroke_linecap(value.to_keyword()); } -Optional StyleProperties::stroke_linejoin() const +Optional ComputedProperties::stroke_linejoin() const { auto const& value = property(CSS::PropertyID::StrokeLinejoin); return keyword_to_stroke_linejoin(value.to_keyword()); } -NumberOrCalculated StyleProperties::stroke_miterlimit() const +NumberOrCalculated ComputedProperties::stroke_miterlimit() const { auto const& value = property(CSS::PropertyID::StrokeMiterlimit); @@ -368,43 +368,43 @@ NumberOrCalculated StyleProperties::stroke_miterlimit() const return NumberOrCalculated { value.as_number().number() }; } -float StyleProperties::stroke_opacity() const +float ComputedProperties::stroke_opacity() const { auto const& value = property(CSS::PropertyID::StrokeOpacity); return resolve_opacity_value(value); } -float StyleProperties::stop_opacity() const +float ComputedProperties::stop_opacity() const { auto const& value = property(CSS::PropertyID::StopOpacity); return resolve_opacity_value(value); } -Optional StyleProperties::fill_rule() const +Optional ComputedProperties::fill_rule() const { auto const& value = property(CSS::PropertyID::FillRule); return keyword_to_fill_rule(value.to_keyword()); } -Optional StyleProperties::clip_rule() const +Optional ComputedProperties::clip_rule() const { auto const& value = property(CSS::PropertyID::ClipRule); return keyword_to_fill_rule(value.to_keyword()); } -Optional StyleProperties::flex_direction() const +Optional ComputedProperties::flex_direction() const { auto const& value = property(CSS::PropertyID::FlexDirection); return keyword_to_flex_direction(value.to_keyword()); } -Optional StyleProperties::flex_wrap() const +Optional ComputedProperties::flex_wrap() const { auto const& value = property(CSS::PropertyID::FlexWrap); return keyword_to_flex_wrap(value.to_keyword()); } -Optional StyleProperties::flex_basis() const +Optional ComputedProperties::flex_basis() const { auto const& value = property(CSS::PropertyID::FlexBasis); @@ -414,7 +414,7 @@ Optional StyleProperties::flex_basis() const return size_value(CSS::PropertyID::FlexBasis); } -float StyleProperties::flex_grow() const +float ComputedProperties::flex_grow() const { auto const& value = property(CSS::PropertyID::FlexGrow); if (!value.is_number()) @@ -422,7 +422,7 @@ float StyleProperties::flex_grow() const return value.as_number().number(); } -float StyleProperties::flex_shrink() const +float ComputedProperties::flex_shrink() const { auto const& value = property(CSS::PropertyID::FlexShrink); if (!value.is_number()) @@ -430,7 +430,7 @@ float StyleProperties::flex_shrink() const return value.as_number().number(); } -int StyleProperties::order() const +int ComputedProperties::order() const { auto const& value = property(CSS::PropertyID::Order); if (!value.is_integer()) @@ -438,13 +438,13 @@ int StyleProperties::order() const return value.as_integer().integer(); } -Optional StyleProperties::image_rendering() const +Optional ComputedProperties::image_rendering() const { auto const& value = property(CSS::PropertyID::ImageRendering); return keyword_to_image_rendering(value.to_keyword()); } -CSS::Length StyleProperties::border_spacing_horizontal(Layout::Node const& layout_node) const +CSS::Length ComputedProperties::border_spacing_horizontal(Layout::Node const& layout_node) const { auto const& value = property(CSS::PropertyID::BorderSpacing); if (value.is_length()) @@ -455,7 +455,7 @@ CSS::Length StyleProperties::border_spacing_horizontal(Layout::Node const& layou return list.value_at(0, false)->as_length().length(); } -CSS::Length StyleProperties::border_spacing_vertical(Layout::Node const& layout_node) const +CSS::Length ComputedProperties::border_spacing_vertical(Layout::Node const& layout_node) const { auto const& value = property(CSS::PropertyID::BorderSpacing); if (value.is_length()) @@ -466,13 +466,13 @@ CSS::Length StyleProperties::border_spacing_vertical(Layout::Node const& layout_ return list.value_at(1, false)->as_length().length(); } -Optional StyleProperties::caption_side() const +Optional ComputedProperties::caption_side() const { auto const& value = property(CSS::PropertyID::CaptionSide); return keyword_to_caption_side(value.to_keyword()); } -CSS::Clip StyleProperties::clip() const +CSS::Clip ComputedProperties::clip() const { auto const& value = property(CSS::PropertyID::Clip); if (!value.is_rect()) @@ -480,25 +480,25 @@ CSS::Clip StyleProperties::clip() const return CSS::Clip(value.as_rect().rect()); } -Optional StyleProperties::justify_content() const +Optional ComputedProperties::justify_content() const { auto const& value = property(CSS::PropertyID::JustifyContent); return keyword_to_justify_content(value.to_keyword()); } -Optional StyleProperties::justify_items() const +Optional ComputedProperties::justify_items() const { auto const& value = property(CSS::PropertyID::JustifyItems); return keyword_to_justify_items(value.to_keyword()); } -Optional StyleProperties::justify_self() const +Optional ComputedProperties::justify_self() const { auto const& value = property(CSS::PropertyID::JustifySelf); return keyword_to_justify_self(value.to_keyword()); } -Vector StyleProperties::transformations_for_style_value(CSSStyleValue const& value) +Vector ComputedProperties::transformations_for_style_value(CSSStyleValue const& value) { if (value.is_keyword() && value.to_keyword() == CSS::Keyword::None) return {}; @@ -559,12 +559,12 @@ Vector StyleProperties::transformations_for_style_value(CSS return transformations; } -Vector StyleProperties::transformations() const +Vector ComputedProperties::transformations() const { return transformations_for_style_value(property(CSS::PropertyID::Transform)); } -Optional StyleProperties::rotate(Layout::Node const& layout_node) const +Optional ComputedProperties::rotate(Layout::Node const& layout_node) const { auto const& value = property(CSS::PropertyID::Rotate); if (!value.is_rotation()) @@ -601,7 +601,7 @@ Optional StyleProperties::rotate(Layout::Node const& layout return CSS::Transformation(CSS::TransformFunction::Rotate3d, move(values)); } -Optional StyleProperties::translate() const +Optional ComputedProperties::translate() const { auto const& value = property(CSS::PropertyID::Translate); if (!value.is_translation()) @@ -615,7 +615,7 @@ Optional StyleProperties::translate() const return CSS::Transformation(CSS::TransformFunction::Translate, move(values)); } -Optional StyleProperties::scale() const +Optional ComputedProperties::scale() const { auto const& value = property(CSS::PropertyID::Scale); if (!value.is_scale()) @@ -640,13 +640,13 @@ static Optional length_percentage_for_style_value(CSSStyleValu return {}; } -Optional StyleProperties::transform_box() const +Optional ComputedProperties::transform_box() const { auto const& value = property(CSS::PropertyID::TransformBox); return keyword_to_transform_box(value.to_keyword()); } -CSS::TransformOrigin StyleProperties::transform_origin() const +CSS::TransformOrigin ComputedProperties::transform_origin() const { auto const& value = property(CSS::PropertyID::TransformOrigin); if (!value.is_value_list() || value.as_value_list().size() != 2) @@ -660,7 +660,7 @@ CSS::TransformOrigin StyleProperties::transform_origin() const return { x_value.value(), y_value.value() }; } -Optional StyleProperties::accent_color(Layout::NodeWithStyle const& node) const +Optional ComputedProperties::accent_color(Layout::NodeWithStyle const& node) const { auto const& value = property(CSS::PropertyID::AccentColor); if (value.has_color()) @@ -668,25 +668,25 @@ Optional StyleProperties::accent_color(Layout::NodeWithStyle const& node) return {}; } -Optional StyleProperties::align_content() const +Optional ComputedProperties::align_content() const { auto const& value = property(CSS::PropertyID::AlignContent); return keyword_to_align_content(value.to_keyword()); } -Optional StyleProperties::align_items() const +Optional ComputedProperties::align_items() const { auto const& value = property(CSS::PropertyID::AlignItems); return keyword_to_align_items(value.to_keyword()); } -Optional StyleProperties::align_self() const +Optional ComputedProperties::align_self() const { auto const& value = property(CSS::PropertyID::AlignSelf); return keyword_to_align_self(value.to_keyword()); } -Optional StyleProperties::appearance() const +Optional ComputedProperties::appearance() const { auto const& value = property(CSS::PropertyID::Appearance); auto appearance = keyword_to_appearance(value.to_keyword()); @@ -716,7 +716,7 @@ Optional StyleProperties::appearance() const return appearance; } -CSS::Filter StyleProperties::backdrop_filter() const +CSS::Filter ComputedProperties::backdrop_filter() const { auto const& value = property(CSS::PropertyID::BackdropFilter); if (value.is_filter_value_list()) @@ -724,7 +724,7 @@ CSS::Filter StyleProperties::backdrop_filter() const return Filter::make_none(); } -CSS::Filter StyleProperties::filter() const +CSS::Filter ComputedProperties::filter() const { auto const& value = property(CSS::PropertyID::Filter); if (value.is_filter_value_list()) @@ -732,13 +732,13 @@ CSS::Filter StyleProperties::filter() const return Filter::make_none(); } -Optional StyleProperties::position() const +Optional ComputedProperties::position() const { auto const& value = property(CSS::PropertyID::Position); return keyword_to_positioning(value.to_keyword()); } -bool StyleProperties::operator==(StyleProperties const& other) const +bool ComputedProperties::operator==(ComputedProperties const& other) const { if (m_data->m_property_values.size() != other.m_data->m_property_values.size()) return false; @@ -764,37 +764,37 @@ bool StyleProperties::operator==(StyleProperties const& other) const return true; } -Optional StyleProperties::text_anchor() const +Optional ComputedProperties::text_anchor() const { auto const& value = property(CSS::PropertyID::TextAnchor); return keyword_to_text_anchor(value.to_keyword()); } -Optional StyleProperties::text_align() const +Optional ComputedProperties::text_align() const { auto const& value = property(CSS::PropertyID::TextAlign); return keyword_to_text_align(value.to_keyword()); } -Optional StyleProperties::text_justify() const +Optional ComputedProperties::text_justify() const { auto const& value = property(CSS::PropertyID::TextJustify); return keyword_to_text_justify(value.to_keyword()); } -Optional StyleProperties::text_overflow() const +Optional ComputedProperties::text_overflow() const { auto const& value = property(CSS::PropertyID::TextOverflow); return keyword_to_text_overflow(value.to_keyword()); } -Optional StyleProperties::pointer_events() const +Optional ComputedProperties::pointer_events() const { auto const& value = property(CSS::PropertyID::PointerEvents); return keyword_to_pointer_events(value.to_keyword()); } -Variant StyleProperties::tab_size() const +Variant ComputedProperties::tab_size() const { auto const& value = property(CSS::PropertyID::TabSize); if (value.is_calculated()) { @@ -813,13 +813,13 @@ Variant StyleProperties::tab_size() cons return NumberOrCalculated { value.as_number().number() }; } -Optional StyleProperties::word_break() const +Optional ComputedProperties::word_break() const { auto const& value = property(CSS::PropertyID::WordBreak); return keyword_to_word_break(value.to_keyword()); } -Optional StyleProperties::word_spacing() const +Optional ComputedProperties::word_spacing() const { auto const& value = property(CSS::PropertyID::WordSpacing); if (value.is_calculated()) { @@ -835,13 +835,13 @@ Optional StyleProperties::word_spacing() const return {}; } -Optional StyleProperties::white_space() const +Optional ComputedProperties::white_space() const { auto const& value = property(CSS::PropertyID::WhiteSpace); return keyword_to_white_space(value.to_keyword()); } -Optional StyleProperties::letter_spacing() const +Optional ComputedProperties::letter_spacing() const { auto const& value = property(CSS::PropertyID::LetterSpacing); if (value.is_calculated()) { @@ -857,37 +857,37 @@ Optional StyleProperties::letter_spacing() const return {}; } -Optional StyleProperties::line_style(CSS::PropertyID property_id) const +Optional ComputedProperties::line_style(CSS::PropertyID property_id) const { auto const& value = property(property_id); return keyword_to_line_style(value.to_keyword()); } -Optional StyleProperties::outline_style() const +Optional ComputedProperties::outline_style() const { auto const& value = property(CSS::PropertyID::OutlineStyle); return keyword_to_outline_style(value.to_keyword()); } -Optional StyleProperties::float_() const +Optional ComputedProperties::float_() const { auto const& value = property(CSS::PropertyID::Float); return keyword_to_float(value.to_keyword()); } -Optional StyleProperties::clear() const +Optional ComputedProperties::clear() const { auto const& value = property(CSS::PropertyID::Clear); return keyword_to_clear(value.to_keyword()); } -Optional StyleProperties::column_span() const +Optional ComputedProperties::column_span() const { auto const& value = property(CSS::PropertyID::ColumnSpan); return keyword_to_column_span(value.to_keyword()); } -StyleProperties::ContentDataAndQuoteNestingLevel StyleProperties::content(DOM::Element& element, u32 initial_quote_nesting_level) const +ComputedProperties::ContentDataAndQuoteNestingLevel ComputedProperties::content(DOM::Element& element, u32 initial_quote_nesting_level) const { auto const& value = property(CSS::PropertyID::Content); auto quotes_data = quotes(); @@ -989,19 +989,19 @@ StyleProperties::ContentDataAndQuoteNestingLevel StyleProperties::content(DOM::E return { {}, quote_nesting_level }; } -Optional StyleProperties::content_visibility() const +Optional ComputedProperties::content_visibility() const { auto const& value = property(CSS::PropertyID::ContentVisibility); return keyword_to_content_visibility(value.to_keyword()); } -Optional StyleProperties::cursor() const +Optional ComputedProperties::cursor() const { auto const& value = property(CSS::PropertyID::Cursor); return keyword_to_cursor(value.to_keyword()); } -Optional StyleProperties::visibility() const +Optional ComputedProperties::visibility() const { auto const& value = property(CSS::PropertyID::Visibility); if (!value.is_keyword()) @@ -1009,7 +1009,7 @@ Optional StyleProperties::visibility() const return keyword_to_visibility(value.to_keyword()); } -Display StyleProperties::display() const +Display ComputedProperties::display() const { auto const& value = property(PropertyID::Display); if (value.is_display()) { @@ -1018,7 +1018,7 @@ Display StyleProperties::display() const return Display::from_short(Display::Short::Inline); } -Vector StyleProperties::text_decoration_line() const +Vector ComputedProperties::text_decoration_line() const { auto const& value = property(CSS::PropertyID::TextDecorationLine); @@ -1038,47 +1038,47 @@ Vector StyleProperties::text_decoration_line() const return {}; } -Optional StyleProperties::text_decoration_style() const +Optional ComputedProperties::text_decoration_style() const { auto const& value = property(CSS::PropertyID::TextDecorationStyle); return keyword_to_text_decoration_style(value.to_keyword()); } -Optional StyleProperties::text_transform() const +Optional ComputedProperties::text_transform() const { auto const& value = property(CSS::PropertyID::TextTransform); return keyword_to_text_transform(value.to_keyword()); } -Optional StyleProperties::list_style_type() const +Optional ComputedProperties::list_style_type() const { auto const& value = property(CSS::PropertyID::ListStyleType); return keyword_to_list_style_type(value.to_keyword()); } -Optional StyleProperties::list_style_position() const +Optional ComputedProperties::list_style_position() const { auto const& value = property(CSS::PropertyID::ListStylePosition); return keyword_to_list_style_position(value.to_keyword()); } -Optional StyleProperties::overflow_x() const +Optional ComputedProperties::overflow_x() const { return overflow(CSS::PropertyID::OverflowX); } -Optional StyleProperties::overflow_y() const +Optional ComputedProperties::overflow_y() const { return overflow(CSS::PropertyID::OverflowY); } -Optional StyleProperties::overflow(CSS::PropertyID property_id) const +Optional ComputedProperties::overflow(CSS::PropertyID property_id) const { auto const& value = property(property_id); return keyword_to_overflow(value.to_keyword()); } -Vector StyleProperties::shadow(PropertyID property_id, Layout::Node const& layout_node) const +Vector ComputedProperties::shadow(PropertyID property_id, Layout::Node const& layout_node) const { auto const& value = property(property_id); @@ -1138,23 +1138,23 @@ Vector StyleProperties::shadow(PropertyID property_id, Layout::Node return {}; } -Vector StyleProperties::box_shadow(Layout::Node const& layout_node) const +Vector ComputedProperties::box_shadow(Layout::Node const& layout_node) const { return shadow(PropertyID::BoxShadow, layout_node); } -Vector StyleProperties::text_shadow(Layout::Node const& layout_node) const +Vector ComputedProperties::text_shadow(Layout::Node const& layout_node) const { return shadow(PropertyID::TextShadow, layout_node); } -Optional StyleProperties::box_sizing() const +Optional ComputedProperties::box_sizing() const { auto const& value = property(CSS::PropertyID::BoxSizing); return keyword_to_box_sizing(value.to_keyword()); } -Variant StyleProperties::vertical_align() const +Variant ComputedProperties::vertical_align() const { auto const& value = property(CSS::PropertyID::VerticalAlign); @@ -1173,7 +1173,7 @@ Variant StyleProperties::vertical_ali VERIFY_NOT_REACHED(); } -Optional StyleProperties::font_language_override() const +Optional ComputedProperties::font_language_override() const { auto const& value = property(CSS::PropertyID::FontLanguageOverride); if (value.is_string()) @@ -1181,49 +1181,49 @@ Optional StyleProperties::font_language_override() const return {}; } -Optional StyleProperties::font_variant_alternates() const +Optional ComputedProperties::font_variant_alternates() const { auto const& value = property(CSS::PropertyID::FontVariantAlternates); return value.to_font_variant_alternates(); } -Optional StyleProperties::font_variant_caps() const +Optional ComputedProperties::font_variant_caps() const { auto const& value = property(CSS::PropertyID::FontVariantCaps); return value.to_font_variant_caps(); } -Optional StyleProperties::font_variant_east_asian() const +Optional ComputedProperties::font_variant_east_asian() const { auto const& value = property(CSS::PropertyID::FontVariantEastAsian); return value.to_font_variant_east_asian(); } -Optional StyleProperties::font_variant_emoji() const +Optional ComputedProperties::font_variant_emoji() const { auto const& value = property(CSS::PropertyID::FontVariantEmoji); return value.to_font_variant_emoji(); } -Optional StyleProperties::font_variant_ligatures() const +Optional ComputedProperties::font_variant_ligatures() const { auto const& value = property(CSS::PropertyID::FontVariantLigatures); return value.to_font_variant_ligatures(); } -Optional StyleProperties::font_variant_numeric() const +Optional ComputedProperties::font_variant_numeric() const { auto const& value = property(CSS::PropertyID::FontVariantNumeric); return value.to_font_variant_numeric(); } -Optional StyleProperties::font_variant_position() const +Optional ComputedProperties::font_variant_position() const { auto const& value = property(CSS::PropertyID::FontVariantPosition); return value.to_font_variant_position(); } -Optional> StyleProperties::font_feature_settings() const +Optional> ComputedProperties::font_feature_settings() const { auto const& value = property(PropertyID::FontFeatureSettings); @@ -1250,7 +1250,7 @@ Optional> StyleProperties::font_feature_ return {}; } -Optional> StyleProperties::font_variation_settings() const +Optional> ComputedProperties::font_variation_settings() const { auto const& value = property(CSS::PropertyID::FontVariationSettings); @@ -1277,31 +1277,31 @@ Optional> StyleProperties::font_variation return {}; } -CSS::GridTrackSizeList StyleProperties::grid_auto_columns() const +CSS::GridTrackSizeList ComputedProperties::grid_auto_columns() const { auto const& value = property(CSS::PropertyID::GridAutoColumns); return value.as_grid_track_size_list().grid_track_size_list(); } -CSS::GridTrackSizeList StyleProperties::grid_auto_rows() const +CSS::GridTrackSizeList ComputedProperties::grid_auto_rows() const { auto const& value = property(CSS::PropertyID::GridAutoRows); return value.as_grid_track_size_list().grid_track_size_list(); } -CSS::GridTrackSizeList StyleProperties::grid_template_columns() const +CSS::GridTrackSizeList ComputedProperties::grid_template_columns() const { auto const& value = property(CSS::PropertyID::GridTemplateColumns); return value.as_grid_track_size_list().grid_track_size_list(); } -CSS::GridTrackSizeList StyleProperties::grid_template_rows() const +CSS::GridTrackSizeList ComputedProperties::grid_template_rows() const { auto const& value = property(CSS::PropertyID::GridTemplateRows); return value.as_grid_track_size_list().grid_track_size_list(); } -CSS::GridAutoFlow StyleProperties::grid_auto_flow() const +CSS::GridAutoFlow ComputedProperties::grid_auto_flow() const { auto const& value = property(CSS::PropertyID::GridAutoFlow); if (!value.is_grid_auto_flow()) @@ -1310,49 +1310,49 @@ CSS::GridAutoFlow StyleProperties::grid_auto_flow() const return CSS::GridAutoFlow { .row = grid_auto_flow_value.is_row(), .dense = grid_auto_flow_value.is_dense() }; } -CSS::GridTrackPlacement StyleProperties::grid_column_end() const +CSS::GridTrackPlacement ComputedProperties::grid_column_end() const { auto const& value = property(CSS::PropertyID::GridColumnEnd); return value.as_grid_track_placement().grid_track_placement(); } -CSS::GridTrackPlacement StyleProperties::grid_column_start() const +CSS::GridTrackPlacement ComputedProperties::grid_column_start() const { auto const& value = property(CSS::PropertyID::GridColumnStart); return value.as_grid_track_placement().grid_track_placement(); } -CSS::GridTrackPlacement StyleProperties::grid_row_end() const +CSS::GridTrackPlacement ComputedProperties::grid_row_end() const { auto const& value = property(CSS::PropertyID::GridRowEnd); return value.as_grid_track_placement().grid_track_placement(); } -CSS::GridTrackPlacement StyleProperties::grid_row_start() const +CSS::GridTrackPlacement ComputedProperties::grid_row_start() const { auto const& value = property(CSS::PropertyID::GridRowStart); return value.as_grid_track_placement().grid_track_placement(); } -Optional StyleProperties::border_collapse() const +Optional ComputedProperties::border_collapse() const { auto const& value = property(CSS::PropertyID::BorderCollapse); return keyword_to_border_collapse(value.to_keyword()); } -Vector> StyleProperties::grid_template_areas() const +Vector> ComputedProperties::grid_template_areas() const { auto const& value = property(CSS::PropertyID::GridTemplateAreas); return value.as_grid_template_area().grid_template_area(); } -Optional StyleProperties::object_fit() const +Optional ComputedProperties::object_fit() const { auto const& value = property(CSS::PropertyID::ObjectFit); return keyword_to_object_fit(value.to_keyword()); } -CSS::ObjectPosition StyleProperties::object_position() const +CSS::ObjectPosition ComputedProperties::object_position() const { auto const& value = property(CSS::PropertyID::ObjectPosition); auto const& position = value.as_position(); @@ -1372,37 +1372,37 @@ CSS::ObjectPosition StyleProperties::object_position() const return object_position; } -Optional StyleProperties::table_layout() const +Optional ComputedProperties::table_layout() const { auto const& value = property(CSS::PropertyID::TableLayout); return keyword_to_table_layout(value.to_keyword()); } -Optional StyleProperties::direction() const +Optional ComputedProperties::direction() const { auto const& value = property(CSS::PropertyID::Direction); return keyword_to_direction(value.to_keyword()); } -Optional StyleProperties::unicode_bidi() const +Optional ComputedProperties::unicode_bidi() const { auto const& value = property(CSS::PropertyID::UnicodeBidi); return keyword_to_unicode_bidi(value.to_keyword()); } -Optional StyleProperties::writing_mode() const +Optional ComputedProperties::writing_mode() const { auto const& value = property(CSS::PropertyID::WritingMode); return keyword_to_writing_mode(value.to_keyword()); } -Optional StyleProperties::mask_type() const +Optional ComputedProperties::mask_type() const { auto const& value = property(CSS::PropertyID::MaskType); return keyword_to_mask_type(value.to_keyword()); } -Color StyleProperties::stop_color() const +Color ComputedProperties::stop_color() const { NonnullRawPtr value = property(CSS::PropertyID::StopColor); if (value->is_keyword()) { @@ -1419,14 +1419,14 @@ Color StyleProperties::stop_color() const return Color::Black; } -void StyleProperties::set_math_depth(int math_depth) +void ComputedProperties::set_math_depth(int math_depth) { m_data->m_math_depth = math_depth; // Make our children inherit our computed value, not our specified value. set_property(PropertyID::MathDepth, MathDepthStyleValue::create_integer(IntegerStyleValue::create(math_depth))); } -QuotesData StyleProperties::quotes() const +QuotesData ComputedProperties::quotes() const { auto const& value = property(CSS::PropertyID::Quotes); if (value.is_keyword()) { @@ -1454,7 +1454,7 @@ QuotesData StyleProperties::quotes() const return InitialValues::quotes(); } -Vector StyleProperties::counter_data(PropertyID property_id) const +Vector ComputedProperties::counter_data(PropertyID property_id) const { auto const& value = property(property_id); @@ -1490,7 +1490,7 @@ Vector StyleProperties::counter_data(PropertyID property_id) const return {}; } -Optional StyleProperties::scrollbar_width() const +Optional ComputedProperties::scrollbar_width() const { auto const& value = property(CSS::PropertyID::ScrollbarWidth); return keyword_to_scrollbar_width(value.to_keyword()); diff --git a/Libraries/LibWeb/CSS/StyleProperties.h b/Libraries/LibWeb/CSS/ComputedProperties.h similarity index 97% rename from Libraries/LibWeb/CSS/StyleProperties.h rename to Libraries/LibWeb/CSS/ComputedProperties.h index 5b7044fa88a..d01143af750 100644 --- a/Libraries/LibWeb/CSS/StyleProperties.h +++ b/Libraries/LibWeb/CSS/ComputedProperties.h @@ -19,7 +19,7 @@ namespace Web::CSS { -class StyleProperties { +class ComputedProperties { public: static constexpr size_t number_of_properties = to_underlying(CSS::last_property_id) + 1; @@ -46,7 +46,7 @@ private: }; public: - StyleProperties() = default; + ComputedProperties() = default; template inline void for_each_property(Callback callback) const @@ -78,7 +78,7 @@ public: }; CSSStyleValue const& property(CSS::PropertyID, WithAnimationsApplied = WithAnimationsApplied::Yes) const; CSSStyleValue const* maybe_null_property(CSS::PropertyID) const; - void revert_property(CSS::PropertyID, StyleProperties const& style_for_revert); + void revert_property(CSS::PropertyID, ComputedProperties const& style_for_revert); GC::Ptr animation_name_source() const { return m_data->m_animation_name_source; } void set_animation_name_source(GC::Ptr declaration) { m_data->m_animation_name_source = declaration; } @@ -214,7 +214,7 @@ public: [[nodiscard]] CSSPixels line_height() const { return *m_data->m_line_height; } void set_line_height(Badge const&, CSSPixels line_height) { m_data->m_line_height = line_height; } - bool operator==(StyleProperties const&) const; + bool operator==(ComputedProperties const&) const; Optional position() const; Optional z_index() const; @@ -237,7 +237,7 @@ private: Optional overflow(CSS::PropertyID) const; Vector shadow(CSS::PropertyID, Layout::Node const&) const; - AK::CopyOnWrite m_data; + AK::CopyOnWrite m_data; }; } diff --git a/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Libraries/LibWeb/CSS/SelectorEngine.cpp index dbb6f89009c..4137b3831c9 100644 --- a/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -5,10 +5,10 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include -#include #include #include #include diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 0d12418abc8..655304ffb2c 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -1019,7 +1019,7 @@ static void cascade_custom_properties(DOM::Element& element, Optional pseudo_element, GC::Ref effect, StyleProperties& style_properties, AnimationRefresh refresh) const +void StyleComputer::collect_animation_into(DOM::Element& element, Optional pseudo_element, GC::Ref effect, ComputedProperties& computed_properties, AnimationRefresh refresh) const { auto animation = effect->associated_animation(); if (!animation) @@ -1075,11 +1075,11 @@ void StyleComputer::collect_animation_into(DOM::Element& element, Optional RefPtr { if (refresh == AnimationRefresh::Yes) return {}; - return style_properties.property(it.key); + return computed_properties.property(it.key); }, [&](RefPtr value) -> RefPtr { if (value->is_revert() || value->is_revert_layer()) - return style_properties.property(it.key); + return computed_properties.property(it.key); if (value->is_unresolved()) return Parser::Parser::resolve_unresolved_style_value(Parser::ParsingContext { element.document() }, element, pseudo_element, it.key, value->as_unresolved()); return value; @@ -1091,7 +1091,7 @@ void StyleComputer::collect_animation_into(DOM::Element& element, Optionalto_string(CSSStyleValue::SerializationMode::Normal)); } continue; @@ -1108,17 +1108,17 @@ void StyleComputer::collect_animation_into(DOM::Element& element, Optionaltarget(), it.key, *start, *end, progress_in_keyframe)) { dbgln_if(LIBWEB_CSS_ANIMATION_DEBUG, "Interpolated value for property {} at {}: {} -> {} = {}", string_from_property_id(it.key), progress_in_keyframe, start->to_string(CSSStyleValue::SerializationMode::Normal), end->to_string(CSSStyleValue::SerializationMode::Normal), next_value->to_string(CSSStyleValue::SerializationMode::Normal)); - style_properties.set_animated_property(it.key, *next_value); + computed_properties.set_animated_property(it.key, *next_value); } else { // If interpolate_property() fails, the element should not be rendered dbgln_if(LIBWEB_CSS_ANIMATION_DEBUG, "Interpolated value for property {} at {}: {} -> {} is invalid", string_from_property_id(it.key), progress_in_keyframe, start->to_string(CSSStyleValue::SerializationMode::Normal), end->to_string(CSSStyleValue::SerializationMode::Normal)); - style_properties.set_animated_property(PropertyID::Visibility, CSSKeywordValue::create(Keyword::Hidden)); + computed_properties.set_animated_property(PropertyID::Visibility, CSSKeywordValue::create(Keyword::Hidden)); } } } @@ -1207,7 +1207,7 @@ static void apply_dimension_attribute(CascadedProperties& cascaded_properties, D cascaded_properties.set_property_from_presentational_hint(property_id, parsed_value.release_nonnull()); } -static void compute_transitioned_properties(StyleProperties const& style, DOM::Element& element, Optional pseudo_element) +static void compute_transitioned_properties(ComputedProperties const& style, DOM::Element& element, Optional pseudo_element) { // FIXME: Implement transitioning for pseudo-elements (void)pseudo_element; @@ -1291,7 +1291,7 @@ static void compute_transitioned_properties(StyleProperties const& style, DOM::E } // https://drafts.csswg.org/css-transitions/#starting -void StyleComputer::start_needed_transitions(StyleProperties const& previous_style, StyleProperties& new_style, DOM::Element& element, Optional pseudo_element) const +void StyleComputer::start_needed_transitions(ComputedProperties const& previous_style, ComputedProperties& new_style, DOM::Element& element, Optional pseudo_element) const { // FIXME: Implement transitions for pseudo-elements if (pseudo_element.has_value()) @@ -1309,8 +1309,8 @@ void StyleComputer::start_needed_transitions(StyleProperties const& previous_sty for (auto i = to_underlying(CSS::first_longhand_property_id); i <= to_underlying(CSS::last_longhand_property_id); ++i) { auto property_id = static_cast(i); auto matching_transition_properties = element.property_transition_attributes(property_id); - auto const& before_change_value = previous_style.property(property_id, StyleProperties::WithAnimationsApplied::No); - auto const& after_change_value = new_style.property(property_id, StyleProperties::WithAnimationsApplied::No); + auto const& before_change_value = previous_style.property(property_id, ComputedProperties::WithAnimationsApplied::No); + auto const& after_change_value = new_style.property(property_id, ComputedProperties::WithAnimationsApplied::No); auto existing_transition = element.property_transition(property_id); bool has_running_transition = existing_transition && !existing_transition->is_finished(); @@ -1595,7 +1595,7 @@ NonnullRefPtr StyleComputer::get_inherit_value(CSS::Propert return parent_element->computed_css_values()->property(property_id); } -void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM::Element const* element, CSS::PropertyID property_id, Optional pseudo_element) const +void StyleComputer::compute_defaulted_property_value(ComputedProperties& style, DOM::Element const* element, CSS::PropertyID property_id, Optional pseudo_element) const { // FIXME: If we don't know the correct initial value for a property, we fall back to `initial`. @@ -1605,7 +1605,7 @@ void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM style.set_property( property_id, get_inherit_value(property_id, element, pseudo_element), - StyleProperties::Inherited::Yes, + ComputedProperties::Inherited::Yes, Important::No); } else { style.set_property(property_id, property_initial_value(property_id)); @@ -1620,7 +1620,7 @@ void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM if (value_slot->is_inherit()) { value_slot = get_inherit_value(property_id, element, pseudo_element); - style.set_property_inherited(property_id, StyleProperties::Inherited::Yes); + style.set_property_inherited(property_id, ComputedProperties::Inherited::Yes); return; } @@ -1630,7 +1630,7 @@ void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM if (is_inherited_property(property_id)) { // then if it is an inherited property, this is treated as inherit, value_slot = get_inherit_value(property_id, element, pseudo_element); - style.set_property_inherited(property_id, StyleProperties::Inherited::Yes); + style.set_property_inherited(property_id, ComputedProperties::Inherited::Yes); } else { // and if it is not, this is treated as initial. value_slot = property_initial_value(property_id); @@ -1639,7 +1639,7 @@ void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM } // https://www.w3.org/TR/css-cascade/#defaulting -void StyleComputer::compute_defaulted_values(StyleProperties& style, DOM::Element const* element, Optional pseudo_element) const +void StyleComputer::compute_defaulted_values(ComputedProperties& style, DOM::Element const* element, Optional pseudo_element) const { // Walk the list of all known CSS properties and: // - Add them to `style` if they are missing. @@ -1658,7 +1658,7 @@ void StyleComputer::compute_defaulted_values(StyleProperties& style, DOM::Elemen } } -Length::FontMetrics StyleComputer::calculate_root_element_font_metrics(StyleProperties const& style) const +Length::FontMetrics StyleComputer::calculate_root_element_font_metrics(ComputedProperties const& style) const { auto const& root_value = style.property(CSS::PropertyID::FontSize); @@ -2010,13 +2010,13 @@ RefPtr StyleComputer::compute_font_for_style_values( font_list->add(*emoji_font); } - auto found_font = StyleProperties::font_fallback(monospace, bold); + auto found_font = ComputedProperties::font_fallback(monospace, bold); font_list->set_last_resort_font(found_font->with_size(font_size_in_pt)); return font_list; } -void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* element, Optional pseudo_element) const +void StyleComputer::compute_font(ComputedProperties& style, DOM::Element const* element, Optional pseudo_element) const { // To compute the font, first ensure that we've defaulted the relevant CSS font properties. // FIXME: This should be more sophisticated. @@ -2060,10 +2060,10 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele Gfx::Font const& StyleComputer::initial_font() const { // FIXME: This is not correct. - return StyleProperties::font_fallback(false, false); + return ComputedProperties::font_fallback(false, false); } -void StyleComputer::absolutize_values(StyleProperties& style) const +void StyleComputer::absolutize_values(ComputedProperties& style) const { Length::FontMetrics font_metrics { m_root_element_font_metrics.font_size, @@ -2100,7 +2100,7 @@ void StyleComputer::absolutize_values(StyleProperties& style) const style.set_line_height({}, line_height); } -void StyleComputer::resolve_effective_overflow_values(StyleProperties& style) const +void StyleComputer::resolve_effective_overflow_values(ComputedProperties& style) const { // https://www.w3.org/TR/css-overflow-3/#overflow-control // The visible/clip values of overflow compute to auto/hidden (respectively) if one of overflow-x or @@ -2127,7 +2127,7 @@ enum class BoxTypeTransformation { Inlinify, }; -static BoxTypeTransformation required_box_type_transformation(StyleProperties const& style, DOM::Element const& element, Optional const& pseudo_element) +static BoxTypeTransformation required_box_type_transformation(ComputedProperties const& style, DOM::Element const& element, Optional const& pseudo_element) { // NOTE: We never blockify
elements. They are always inline. // There is currently no way to express in CSS how a
element really behaves. @@ -2155,7 +2155,7 @@ static BoxTypeTransformation required_box_type_transformation(StyleProperties co } // https://drafts.csswg.org/css-display/#transformations -void StyleComputer::transform_box_type_if_needed(StyleProperties& style, DOM::Element const& element, Optional pseudo_element) const +void StyleComputer::transform_box_type_if_needed(ComputedProperties& style, DOM::Element const& element, Optional pseudo_element) const { // 2.7. Automatic Box Type Transformations @@ -2244,9 +2244,9 @@ void StyleComputer::transform_box_type_if_needed(StyleProperties& style, DOM::El style.set_property(CSS::PropertyID::Display, DisplayStyleValue::create(new_display)); } -StyleProperties StyleComputer::create_document_style() const +ComputedProperties StyleComputer::create_document_style() const { - StyleProperties style = {}; + ComputedProperties style = {}; compute_math_depth(style, nullptr, {}); compute_font(style, nullptr, {}); compute_defaulted_values(style, nullptr, {}); @@ -2257,17 +2257,17 @@ StyleProperties StyleComputer::create_document_style() const return style; } -StyleProperties StyleComputer::compute_style(DOM::Element& element, Optional pseudo_element) const +ComputedProperties StyleComputer::compute_style(DOM::Element& element, Optional pseudo_element) const { return compute_style_impl(element, move(pseudo_element), ComputeStyleMode::Normal).release_value(); } -Optional StyleComputer::compute_pseudo_element_style_if_needed(DOM::Element& element, Optional pseudo_element) const +Optional StyleComputer::compute_pseudo_element_style_if_needed(DOM::Element& element, Optional pseudo_element) const { return compute_style_impl(element, move(pseudo_element), ComputeStyleMode::CreatePseudoElementStyleIfNeeded); } -Optional StyleComputer::compute_style_impl(DOM::Element& element, Optional pseudo_element, ComputeStyleMode mode) const +Optional StyleComputer::compute_style_impl(DOM::Element& element, Optional pseudo_element, ComputeStyleMode mode) const { build_rule_cache_if_needed(); @@ -2324,9 +2324,9 @@ Optional StyleComputer::compute_style_impl(DOM::Element& elemen return compute_properties(element, pseudo_element, cascaded_properties); } -StyleProperties StyleComputer::compute_properties(DOM::Element& element, Optional pseudo_element, CascadedProperties& cascaded_properties) const +ComputedProperties StyleComputer::compute_properties(DOM::Element& element, Optional pseudo_element, CascadedProperties& cascaded_properties) const { - StyleProperties computed_style; + ComputedProperties computed_style; for (auto i = to_underlying(first_longhand_property_id); i <= to_underlying(last_longhand_property_id); ++i) { auto property_id = static_cast(i); @@ -2900,7 +2900,7 @@ void StyleComputer::unload_fonts_from_sheet(CSSStyleSheet& sheet) } } -void StyleComputer::compute_math_depth(StyleProperties& style, DOM::Element const* element, Optional pseudo_element) const +void StyleComputer::compute_math_depth(ComputedProperties& style, DOM::Element const* element, Optional pseudo_element) const { // https://w3c.github.io/mathml-core/#propdef-math-depth diff --git a/Libraries/LibWeb/CSS/StyleComputer.h b/Libraries/LibWeb/CSS/StyleComputer.h index f0732320671..159e676bcb4 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Libraries/LibWeb/CSS/StyleComputer.h @@ -17,8 +17,8 @@ #include #include #include +#include #include -#include #include #include @@ -141,10 +141,10 @@ public: void push_ancestor(DOM::Element const&); void pop_ancestor(DOM::Element const&); - StyleProperties create_document_style() const; + ComputedProperties create_document_style() const; - StyleProperties compute_style(DOM::Element&, Optional = {}) const; - Optional compute_pseudo_element_style_if_needed(DOM::Element&, Optional) const; + ComputedProperties compute_style(DOM::Element&, Optional = {}) const; + Optional compute_pseudo_element_style_if_needed(DOM::Element&, Optional) const; Vector collect_matching_rules(DOM::Element const&, CascadeOrigin, Optional, FlyString const& qualified_layer_name = {}) const; @@ -167,13 +167,13 @@ public: No, Yes, }; - void collect_animation_into(DOM::Element&, Optional, GC::Ref animation, StyleProperties&, AnimationRefresh = AnimationRefresh::No) const; + void collect_animation_into(DOM::Element&, Optional, GC::Ref animation, ComputedProperties&, AnimationRefresh = AnimationRefresh::No) const; [[nodiscard]] bool has_has_selectors() const { return m_has_has_selectors; } size_t number_of_css_font_faces_with_loading_in_progress() const; - [[nodiscard]] StyleProperties compute_properties(DOM::Element&, Optional, CascadedProperties&) const; + [[nodiscard]] ComputedProperties compute_properties(DOM::Element&, Optional, CascadedProperties&) const; private: enum class ComputeStyleMode { @@ -185,20 +185,20 @@ private: [[nodiscard]] bool should_reject_with_ancestor_filter(Selector const&) const; - Optional compute_style_impl(DOM::Element&, Optional, ComputeStyleMode) const; + Optional compute_style_impl(DOM::Element&, Optional, ComputeStyleMode) const; [[nodiscard]] GC::Ref compute_cascaded_values(DOM::Element&, Optional, bool& did_match_any_pseudo_element_rules, ComputeStyleMode) const; static RefPtr find_matching_font_weight_ascending(Vector const& candidates, int target_weight, float font_size_in_pt, bool inclusive); static RefPtr find_matching_font_weight_descending(Vector const& candidates, int target_weight, float font_size_in_pt, bool inclusive); RefPtr font_matching_algorithm(FlyString const& family_name, int weight, int slope, float font_size_in_pt) const; - void compute_font(StyleProperties&, DOM::Element const*, Optional) const; - void compute_math_depth(StyleProperties&, DOM::Element const*, Optional) const; - void compute_defaulted_values(StyleProperties&, DOM::Element const*, Optional) const; - void start_needed_transitions(StyleProperties const& old_style, StyleProperties& new_style, DOM::Element&, Optional) const; - void absolutize_values(StyleProperties&) const; - void resolve_effective_overflow_values(StyleProperties&) const; - void transform_box_type_if_needed(StyleProperties&, DOM::Element const&, Optional) const; + void compute_font(ComputedProperties&, DOM::Element const*, Optional) const; + void compute_math_depth(ComputedProperties&, DOM::Element const*, Optional) const; + void compute_defaulted_values(ComputedProperties&, DOM::Element const*, Optional) const; + void start_needed_transitions(ComputedProperties const& old_style, ComputedProperties& new_style, DOM::Element&, Optional) const; + void absolutize_values(ComputedProperties&) const; + void resolve_effective_overflow_values(ComputedProperties&) const; + void transform_box_type_if_needed(ComputedProperties&, DOM::Element const&, Optional) const; - void compute_defaulted_property_value(StyleProperties&, DOM::Element const*, CSS::PropertyID, Optional) const; + void compute_defaulted_property_value(ComputedProperties&, DOM::Element const*, CSS::PropertyID, Optional) const; void set_all_properties( CascadedProperties&, @@ -216,7 +216,7 @@ private: [[nodiscard]] CSSPixelRect viewport_rect() const { return m_viewport_rect; } - [[nodiscard]] Length::FontMetrics calculate_root_element_font_metrics(StyleProperties const&) const; + [[nodiscard]] Length::FontMetrics calculate_root_element_font_metrics(ComputedProperties const&) const; Vector m_qualified_layer_names_in_order; void build_qualified_layer_names_cache(); diff --git a/Libraries/LibWeb/CSS/StyleInvalidation.cpp b/Libraries/LibWeb/CSS/StyleInvalidation.cpp index d924edaa951..3e1c80f3024 100644 --- a/Libraries/LibWeb/CSS/StyleInvalidation.cpp +++ b/Libraries/LibWeb/CSS/StyleInvalidation.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::CSS { @@ -45,8 +45,8 @@ RequiredInvalidationAfterStyleChange compute_property_invalidation(CSS::Property // OPTIMIZATION: An element creates a stacking context when its opacity changes from 1 to less than 1 // and stops to create one when opacity returns to 1. So stacking context tree rebuild is // not required for opacity changes within the range below 1. - auto old_value_opacity = CSS::StyleProperties::resolve_opacity_value(*old_value); - auto new_value_opacity = CSS::StyleProperties::resolve_opacity_value(*new_value); + auto old_value_opacity = CSS::ComputedProperties::resolve_opacity_value(*old_value); + auto new_value_opacity = CSS::ComputedProperties::resolve_opacity_value(*new_value); if (old_value_opacity != new_value_opacity && (old_value_opacity == 1 || new_value_opacity == 1)) { invalidation.rebuild_stacking_context_tree = true; } diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index ed28f195948..581f27a97ec 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -1386,7 +1386,7 @@ void Document::update_animated_style_if_needed() for (auto& animation : timeline->associated_animations()) { if (auto effect = animation->effect()) - effect->update_style_properties(); + effect->update_computed_properties(); } } m_needs_animated_style_update = false; diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 3ac11c113e7..a45efb27bfd 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -13,12 +13,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -388,7 +388,7 @@ Vector Element::get_attribute_names() const return names; } -GC::Ptr Element::create_layout_node(CSS::StyleProperties style) +GC::Ptr Element::create_layout_node(CSS::ComputedProperties style) { if (local_name() == "noscript" && document().is_scripting_enabled()) return nullptr; @@ -397,7 +397,7 @@ GC::Ptr Element::create_layout_node(CSS::StyleProperties style) return create_layout_node_for_display_type(document(), display, move(style), this); } -GC::Ptr Element::create_layout_node_for_display_type(DOM::Document& document, CSS::Display const& display, CSS::StyleProperties style, Element* element) +GC::Ptr Element::create_layout_node_for_display_type(DOM::Document& document, CSS::Display const& display, CSS::ComputedProperties style, Element* element) { if (display.is_table_inside() || display.is_table_row_group() || display.is_table_header_group() || display.is_table_footer_group() || display.is_table_row()) return document.heap().allocate(document, element, move(style)); @@ -454,7 +454,7 @@ void Element::run_attribute_change_steps(FlyString const& local_name, Optional type) +CSS::ComputedProperties Element::resolved_css_values(Optional type) { auto element_computed_style = CSS::ResolvedCSSStyleDeclaration::create(*this, type); - CSS::StyleProperties properties = {}; + CSS::ComputedProperties properties = {}; for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) { auto property_id = (CSS::PropertyID)i; @@ -2297,13 +2297,13 @@ void Element::set_cascaded_properties(Optional style) +void Element::set_computed_css_values(Optional style) { m_computed_css_values = move(style); computed_css_values_changed(); } -void Element::set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type pseudo_element, Optional style) +void Element::set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type pseudo_element, Optional style) { if (!m_pseudo_element_data && !style.has_value()) return; @@ -2315,7 +2315,7 @@ void Element::set_pseudo_element_computed_css_values(CSS::Selector::PseudoElemen ensure_pseudo_element(pseudo_element).computed_css_values = move(style); } -Optional Element::pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type type) +Optional Element::pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type type) { auto pseudo_element = get_pseudo_element(type); if (pseudo_element.has_value()) @@ -2917,7 +2917,7 @@ CSS::CountersSet& Element::ensure_counters_set() } // https://drafts.csswg.org/css-lists-3/#auto-numbering -void Element::resolve_counters(CSS::StyleProperties& style) +void Element::resolve_counters(CSS::ComputedProperties& style) { // Resolving counter values on a given element is a multi-step process: diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index eec424962f0..8efe63889b3 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -14,10 +14,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -185,16 +185,16 @@ public: GC::Ptr layout_node(); GC::Ptr layout_node() const; - Optional& computed_css_values() { return m_computed_css_values; } - Optional const& computed_css_values() const { return m_computed_css_values; } - void set_computed_css_values(Optional); - CSS::StyleProperties resolved_css_values(Optional = {}); + Optional& computed_css_values() { return m_computed_css_values; } + Optional const& computed_css_values() const { return m_computed_css_values; } + void set_computed_css_values(Optional); + CSS::ComputedProperties resolved_css_values(Optional = {}); [[nodiscard]] GC::Ptr cascaded_properties(Optional) const; void set_cascaded_properties(Optional, GC::Ptr); - void set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type, Optional); - Optional pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type); + void set_pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type, Optional); + Optional pseudo_element_computed_css_values(CSS::Selector::PseudoElement::Type); void reset_animated_css_properties(); @@ -240,13 +240,13 @@ public: GC::Ref get_bounding_client_rect() const; GC::Ref get_client_rects() const; - virtual GC::Ptr create_layout_node(CSS::StyleProperties); - virtual void adjust_computed_style(CSS::StyleProperties&) { } + virtual GC::Ptr create_layout_node(CSS::ComputedProperties); + virtual void adjust_computed_style(CSS::ComputedProperties&) { } virtual void did_receive_focus() { } virtual void did_lose_focus() { } - static GC::Ptr create_layout_node_for_display_type(DOM::Document&, CSS::Display const&, CSS::StyleProperties, Element*); + static GC::Ptr create_layout_node_for_display_type(DOM::Document&, CSS::Display const&, CSS::ComputedProperties, Element*); void set_pseudo_element_node(Badge, CSS::Selector::PseudoElement::Type, GC::Ptr); GC::Ptr get_pseudo_element_node(CSS::Selector::PseudoElement::Type) const; @@ -369,7 +369,7 @@ public: bool has_non_empty_counters_set() const { return m_counters_set; } Optional counters_set(); CSS::CountersSet& ensure_counters_set(); - void resolve_counters(CSS::StyleProperties&); + void resolve_counters(CSS::ComputedProperties&); void inherit_counters(); protected: @@ -416,13 +416,13 @@ private: GC::Ptr m_cascaded_properties; - Optional m_computed_css_values; + Optional m_computed_css_values; HashMap m_custom_properties; struct PseudoElement { GC::Ptr layout_node; GC::Ptr cascaded_properties; - Optional computed_css_values; + Optional computed_css_values; HashMap custom_properties; }; // TODO: CSS::Selector::PseudoElement::Type includes a lot of pseudo-elements that exist in shadow trees, diff --git a/Libraries/LibWeb/Forward.h b/Libraries/LibWeb/Forward.h index 6ce88b09c95..3d8e3321b5a 100644 --- a/Libraries/LibWeb/Forward.h +++ b/Libraries/LibWeb/Forward.h @@ -216,7 +216,7 @@ class ShorthandStyleValue; class Size; class StringStyleValue; class StyleComputer; -class StyleProperties; +class ComputedProperties; class StyleSheet; class StyleSheetList; class StyleValueList; diff --git a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp index ac944796b66..50f380e1a8e 100644 --- a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp +++ b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp @@ -8,8 +8,8 @@ #include #include +#include #include -#include #include #include #include @@ -949,7 +949,7 @@ WebIDL::ExceptionOr parse_dom_matrix_init_string(JS::Realm& realm, auto transform_style_value = parse_css_value(CSS::Parser::ParsingContext {}, transform_list, CSS::PropertyID::Transform); if (!transform_style_value) return WebIDL::SyntaxError::create(realm, "Failed to parse CSS transform string."_string); - auto parsed_value = CSS::StyleProperties::transformations_for_style_value(*transform_style_value); + auto parsed_value = CSS::ComputedProperties::transformations_for_style_value(*transform_style_value); // 3. If parsedValue is none, set parsedValue to a containing a single identity matrix. // NOTE: parsed_value is empty on none so for loop in 6 won't modify matrix diff --git a/Libraries/LibWeb/HTML/HTMLAudioElement.cpp b/Libraries/LibWeb/HTML/HTMLAudioElement.cpp index ca0cfc050df..4be43f437fc 100644 --- a/Libraries/LibWeb/HTML/HTMLAudioElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLAudioElement.cpp @@ -29,12 +29,12 @@ void HTMLAudioElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLAudioElement); } -GC::Ptr HTMLAudioElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLAudioElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } -void HTMLAudioElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLAudioElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLAudioElement.h b/Libraries/LibWeb/HTML/HTMLAudioElement.h index 81b3bc87ca9..ae8642a65cb 100644 --- a/Libraries/LibWeb/HTML/HTMLAudioElement.h +++ b/Libraries/LibWeb/HTML/HTMLAudioElement.h @@ -25,8 +25,8 @@ private: virtual void initialize(JS::Realm&) override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; virtual void on_playing() override; virtual void on_paused() override; diff --git a/Libraries/LibWeb/HTML/HTMLBRElement.cpp b/Libraries/LibWeb/HTML/HTMLBRElement.cpp index ff52f6fe78e..29b4ddd5d8c 100644 --- a/Libraries/LibWeb/HTML/HTMLBRElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLBRElement.cpp @@ -27,12 +27,12 @@ void HTMLBRElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLBRElement); } -GC::Ptr HTMLBRElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLBRElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } -void HTMLBRElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLBRElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLBRElement.h b/Libraries/LibWeb/HTML/HTMLBRElement.h index 897f32b4af4..a35c68c61c9 100644 --- a/Libraries/LibWeb/HTML/HTMLBRElement.h +++ b/Libraries/LibWeb/HTML/HTMLBRElement.h @@ -17,8 +17,8 @@ class HTMLBRElement final : public HTMLElement { public: virtual ~HTMLBRElement() override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; private: virtual bool is_html_br_element() const override { return true; } diff --git a/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 8c5d936bfb0..e655234c82a 100644 --- a/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index e03f2a6acac..2af037a5808 100644 --- a/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -175,12 +175,12 @@ WebIDL::ExceptionOr HTMLCanvasElement::set_height(WebIDL::UnsignedLong val return {}; } -GC::Ptr HTMLCanvasElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLCanvasElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } -void HTMLCanvasElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLCanvasElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLCanvasElement.h b/Libraries/LibWeb/HTML/HTMLCanvasElement.h index 5a0bd6d7b30..18d5d33b03b 100644 --- a/Libraries/LibWeb/HTML/HTMLCanvasElement.h +++ b/Libraries/LibWeb/HTML/HTMLCanvasElement.h @@ -54,8 +54,8 @@ private: virtual void apply_presentational_hints(GC::Ref) const override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; template JS::ThrowCompletionOr create_webgl_context(JS::Value options); diff --git a/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Libraries/LibWeb/HTML/HTMLDivElement.cpp index 71035e89c8b..bada0519200 100644 --- a/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLElement.cpp b/Libraries/LibWeb/HTML/HTMLElement.cpp index 7a300f9893a..578b1d2fc44 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -940,7 +940,7 @@ WebIDL::ExceptionOr HTMLElement::set_popover(Optional value) return {}; } -void HTMLElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (local_name() == HTML::TagNames::wbr) { diff --git a/Libraries/LibWeb/HTML/HTMLElement.h b/Libraries/LibWeb/HTML/HTMLElement.h index bb85e985ff9..0d102160f44 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Libraries/LibWeb/HTML/HTMLElement.h @@ -145,7 +145,7 @@ protected: private: virtual bool is_html_element() const final { return true; } - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; // ^HTML::GlobalEventHandlers virtual GC::Ptr global_event_handlers_to_event_target(FlyString const&) override { return *this; } diff --git a/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp b/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp index b3f9a349bb3..367d40ee7fb 100644 --- a/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -60,7 +60,7 @@ void HTMLEmbedElement::apply_presentational_hints(GC::Ref) const override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; }; } diff --git a/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp b/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp index df207043eb3..0d869d7c35a 100644 --- a/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp @@ -83,7 +83,7 @@ Layout::FieldSetBox* HTMLFieldSetElement::layout_node() return static_cast(Node::layout_node()); } -GC::Ptr HTMLFieldSetElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLFieldSetElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, style); } diff --git a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h index 5286791c58a..c23bc59a15d 100644 --- a/Libraries/LibWeb/HTML/HTMLFieldSetElement.h +++ b/Libraries/LibWeb/HTML/HTMLFieldSetElement.h @@ -42,7 +42,7 @@ public: virtual Optional default_role() const override { return ARIA::Role::group; } - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; Layout::FieldSetBox* layout_node(); Layout::FieldSetBox const* layout_node() const; diff --git a/Libraries/LibWeb/HTML/HTMLFontElement.cpp b/Libraries/LibWeb/HTML/HTMLFontElement.cpp index cd8078f3a53..ccd091da95f 100644 --- a/Libraries/LibWeb/HTML/HTMLFontElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLFontElement.cpp @@ -7,9 +7,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLFrameElement.cpp b/Libraries/LibWeb/HTML/HTMLFrameElement.cpp index b3fd4b0bbaf..5896b8fc6ac 100644 --- a/Libraries/LibWeb/HTML/HTMLFrameElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLFrameElement.cpp @@ -82,7 +82,7 @@ i32 HTMLFrameElement::default_tab_index_value() const return 0; } -void HTMLFrameElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLFrameElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLFrameElement.h b/Libraries/LibWeb/HTML/HTMLFrameElement.h index ba301aca0b2..a8f8b5d2790 100644 --- a/Libraries/LibWeb/HTML/HTMLFrameElement.h +++ b/Libraries/LibWeb/HTML/HTMLFrameElement.h @@ -28,7 +28,7 @@ private: virtual void removed_from(Node*) override; virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value, Optional const& namespace_) override; virtual i32 default_tab_index_value() const override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; void process_the_frame_attributes(bool initial_insertion = false); }; diff --git a/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp b/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp index d23b182e4f0..b4eca5b8cb7 100644 --- a/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp @@ -21,7 +21,7 @@ HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::Qualified HTMLFrameSetElement::~HTMLFrameSetElement() = default; -void HTMLFrameSetElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLFrameSetElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLFrameSetElement.h b/Libraries/LibWeb/HTML/HTMLFrameSetElement.h index c1f2d90f76b..62a4ef04305 100644 --- a/Libraries/LibWeb/HTML/HTMLFrameSetElement.h +++ b/Libraries/LibWeb/HTML/HTMLFrameSetElement.h @@ -24,7 +24,7 @@ public: private: HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName); - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; virtual void initialize(JS::Realm&) override; virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value, Optional const& namespace_) override; diff --git a/Libraries/LibWeb/HTML/HTMLHRElement.cpp b/Libraries/LibWeb/HTML/HTMLHRElement.cpp index 13c94c3aa92..b516dfaad59 100644 --- a/Libraries/LibWeb/HTML/HTMLHRElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLHRElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp index ccced4427ce..405512e905e 100644 --- a/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 23013d3dbf5..e301b47c6ae 100644 --- a/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -34,12 +34,12 @@ void HTMLIFrameElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLIFrameElement); } -GC::Ptr HTMLIFrameElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLIFrameElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } -void HTMLIFrameElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLIFrameElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Libraries/LibWeb/HTML/HTMLIFrameElement.h index 221da71bc6f..ddf7b9ab939 100644 --- a/Libraries/LibWeb/HTML/HTMLIFrameElement.h +++ b/Libraries/LibWeb/HTML/HTMLIFrameElement.h @@ -23,8 +23,8 @@ class HTMLIFrameElement final public: virtual ~HTMLIFrameElement() override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; void set_current_navigation_was_lazy_loaded(bool value); diff --git a/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Libraries/LibWeb/HTML/HTMLImageElement.cpp index efef4eec7d8..110f11c391b 100644 --- a/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -134,12 +134,12 @@ void HTMLImageElement::form_associated_element_attribute_changed(FlyString const } } -GC::Ptr HTMLImageElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLImageElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style), *this); } -void HTMLImageElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLImageElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLImageElement.h b/Libraries/LibWeb/HTML/HTMLImageElement.h index e9e584ce03d..b10a77dc977 100644 --- a/Libraries/LibWeb/HTML/HTMLImageElement.h +++ b/Libraries/LibWeb/HTML/HTMLImageElement.h @@ -126,8 +126,8 @@ private: // https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:dimension-attributes virtual bool supports_dimension_attributes() const override { return true; } - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; virtual void did_set_viewport_rect(CSSPixelRect const&) override; diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Libraries/LibWeb/HTML/HTMLInputElement.cpp index f6db5ffa821..154c0123d12 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -99,7 +99,7 @@ GC::Ref HTMLInputElement::validity() const return realm.create(realm); } -GC::Ptr HTMLInputElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLInputElement::create_layout_node(CSS::ComputedProperties style) { if (type_state() == TypeAttributeState::Hidden) return nullptr; @@ -130,7 +130,7 @@ GC::Ptr HTMLInputElement::create_layout_node(CSS::StyleProperties return Element::create_layout_node_for_display_type(document(), style.display(), style, this); } -void HTMLInputElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style) { if (type_state() == TypeAttributeState::Hidden || type_state() == TypeAttributeState::SubmitButton || type_state() == TypeAttributeState::Button || type_state() == TypeAttributeState::ResetButton || type_state() == TypeAttributeState::ImageButton || type_state() == TypeAttributeState::Checkbox || type_state() == TypeAttributeState::RadioButton) return; diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.h b/Libraries/LibWeb/HTML/HTMLInputElement.h index 92941b8833c..3af6b799330 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -58,8 +58,8 @@ class HTMLInputElement final public: virtual ~HTMLInputElement() override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; enum class TypeAttributeState { #define __ENUMERATE_HTML_INPUT_TYPE_ATTRIBUTE(_, state) state, diff --git a/Libraries/LibWeb/HTML/HTMLLabelElement.cpp b/Libraries/LibWeb/HTML/HTMLLabelElement.cpp index 6045d5e57cb..6407b83c52b 100644 --- a/Libraries/LibWeb/HTML/HTMLLabelElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLLabelElement.cpp @@ -27,7 +27,7 @@ void HTMLLabelElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLLabelElement); } -GC::Ptr HTMLLabelElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLLabelElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), this, move(style)); } diff --git a/Libraries/LibWeb/HTML/HTMLLabelElement.h b/Libraries/LibWeb/HTML/HTMLLabelElement.h index 76fcc3fc1c9..012c5de57b6 100644 --- a/Libraries/LibWeb/HTML/HTMLLabelElement.h +++ b/Libraries/LibWeb/HTML/HTMLLabelElement.h @@ -17,7 +17,7 @@ class HTMLLabelElement final : public HTMLElement { public: virtual ~HTMLLabelElement() override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; Optional for_() const { return attribute(HTML::AttributeNames::for_); } diff --git a/Libraries/LibWeb/HTML/HTMLLegendElement.cpp b/Libraries/LibWeb/HTML/HTMLLegendElement.cpp index efa2fc53b75..37a534e0876 100644 --- a/Libraries/LibWeb/HTML/HTMLLegendElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLLegendElement.cpp @@ -40,7 +40,7 @@ HTMLFormElement* HTMLLegendElement::form() return nullptr; } -GC::Ptr HTMLLegendElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLLegendElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/HTML/HTMLLegendElement.h b/Libraries/LibWeb/HTML/HTMLLegendElement.h index 6138d3a1865..4548c063e50 100644 --- a/Libraries/LibWeb/HTML/HTMLLegendElement.h +++ b/Libraries/LibWeb/HTML/HTMLLegendElement.h @@ -20,7 +20,7 @@ public: HTMLFormElement* form(); - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; Layout::LegendBox* layout_node(); Layout::LegendBox const* layout_node() const; diff --git a/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp b/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp index acffaefa986..a35b1265c4a 100644 --- a/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLMeterElement.cpp b/Libraries/LibWeb/HTML/HTMLMeterElement.cpp index 39b8648a9a2..f789cd7743b 100644 --- a/Libraries/LibWeb/HTML/HTMLMeterElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLMeterElement.cpp @@ -178,7 +178,7 @@ void HTMLMeterElement::removed_from(DOM::Node*) set_shadow_root(nullptr); } -void HTMLMeterElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLMeterElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLMeterElement.h b/Libraries/LibWeb/HTML/HTMLMeterElement.h index b2539d822af..1967f6085f8 100644 --- a/Libraries/LibWeb/HTML/HTMLMeterElement.h +++ b/Libraries/LibWeb/HTML/HTMLMeterElement.h @@ -37,7 +37,7 @@ public: virtual void inserted() override; virtual void removed_from(DOM::Node*) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; // https://html.spec.whatwg.org/multipage/forms.html#category-label virtual bool is_labelable() const override { return true; } diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 324eb0a84a1..f44dc5cf214 100644 --- a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -158,7 +158,7 @@ String HTMLObjectElement::data() const return document().encoding_parse_url(*data).to_string(); } -GC::Ptr HTMLObjectElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLObjectElement::create_layout_node(CSS::ComputedProperties style) { switch (m_representation) { case Representation::Children: @@ -176,7 +176,7 @@ GC::Ptr HTMLObjectElement::create_layout_node(CSS::StyleProperties return nullptr; } -void HTMLObjectElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLObjectElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Libraries/LibWeb/HTML/HTMLObjectElement.h index ee6179884b6..3294b3f3328 100644 --- a/Libraries/LibWeb/HTML/HTMLObjectElement.h +++ b/Libraries/LibWeb/HTML/HTMLObjectElement.h @@ -56,8 +56,8 @@ private: virtual void apply_presentational_hints(GC::Ref) const override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; bool has_ancestor_media_element_or_object_element_not_showing_fallback_content() const; diff --git a/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp index b78c1b76971..eee22eeaa5f 100644 --- a/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Libraries/LibWeb/HTML/HTMLPreElement.cpp index 4e6a5cdf062..a591243d2d5 100644 --- a/Libraries/LibWeb/HTML/HTMLPreElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLPreElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLProgressElement.cpp b/Libraries/LibWeb/HTML/HTMLProgressElement.cpp index b8a6731c533..4594deb4505 100644 --- a/Libraries/LibWeb/HTML/HTMLProgressElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLProgressElement.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include @@ -99,7 +99,7 @@ void HTMLProgressElement::removed_from(DOM::Node*) set_shadow_root(nullptr); } -void HTMLProgressElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLProgressElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLProgressElement.h b/Libraries/LibWeb/HTML/HTMLProgressElement.h index 1dc8fe77bf7..1988089f0cf 100644 --- a/Libraries/LibWeb/HTML/HTMLProgressElement.h +++ b/Libraries/LibWeb/HTML/HTMLProgressElement.h @@ -31,7 +31,7 @@ public: virtual void inserted() override; virtual void removed_from(DOM::Node*) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; // https://html.spec.whatwg.org/multipage/forms.html#category-label virtual bool is_labelable() const override { return true; } diff --git a/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index a51dd08ca73..df55ff61470 100644 --- a/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -64,7 +64,7 @@ void HTMLSelectElement::visit_edges(Cell::Visitor& visitor) } } -void HTMLSelectElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLSelectElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLSelectElement.h b/Libraries/LibWeb/HTML/HTMLSelectElement.h index 04263f26218..c89d64e94ac 100644 --- a/Libraries/LibWeb/HTML/HTMLSelectElement.h +++ b/Libraries/LibWeb/HTML/HTMLSelectElement.h @@ -27,7 +27,7 @@ class HTMLSelectElement final public: virtual ~HTMLSelectElement() override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; WebIDL::UnsignedLong size() const; WebIDL::ExceptionOr set_size(WebIDL::UnsignedLong); diff --git a/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp index 456ff1fb9ce..8de35a79ef6 100644 --- a/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index 53ffe6d79d3..6df0194feaf 100644 --- a/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -7,8 +7,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLTableColElement.cpp b/Libraries/LibWeb/HTML/HTMLTableColElement.cpp index 0a64ba2132b..c39ee4c0b1f 100644 --- a/Libraries/LibWeb/HTML/HTMLTableColElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableColElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Libraries/LibWeb/HTML/HTMLTableElement.cpp index dbc93d4067e..53361defaec 100644 --- a/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -7,8 +7,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp b/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp index 3193874da17..b717cce45ad 100644 --- a/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp @@ -6,9 +6,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp index 842130800ca..6ae57ec7627 100644 --- a/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index bd9d264af27..1542c82a947 100644 --- a/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::Qualified HTMLTextAreaElement::~HTMLTextAreaElement() = default; -void HTMLTextAreaElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLTextAreaElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLTextAreaElement.h b/Libraries/LibWeb/HTML/HTMLTextAreaElement.h index 92a7291338a..efb67f64004 100644 --- a/Libraries/LibWeb/HTML/HTMLTextAreaElement.h +++ b/Libraries/LibWeb/HTML/HTMLTextAreaElement.h @@ -28,7 +28,7 @@ class HTMLTextAreaElement final public: virtual ~HTMLTextAreaElement() override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; String const& type() const { diff --git a/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index 204497454f6..a224506ec7f 100644 --- a/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -63,12 +63,12 @@ void HTMLVideoElement::attribute_changed(FlyString const& name, Optional } } -GC::Ptr HTMLVideoElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr HTMLVideoElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } -void HTMLVideoElement::adjust_computed_style(CSS::StyleProperties& style) +void HTMLVideoElement::adjust_computed_style(CSS::ComputedProperties& style) { // https://drafts.csswg.org/css-display-3/#unbox if (style.display().is_contents()) diff --git a/Libraries/LibWeb/HTML/HTMLVideoElement.h b/Libraries/LibWeb/HTML/HTMLVideoElement.h index 4882ca30738..6f1ec417b1b 100644 --- a/Libraries/LibWeb/HTML/HTMLVideoElement.h +++ b/Libraries/LibWeb/HTML/HTMLVideoElement.h @@ -60,8 +60,8 @@ private: // https://html.spec.whatwg.org/multipage/media.html#the-video-element:dimension-attributes virtual bool supports_dimension_attributes() const override { return true; } - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; - virtual void adjust_computed_style(CSS::StyleProperties&) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; + virtual void adjust_computed_style(CSS::ComputedProperties&) override; virtual void on_playing() override; virtual void on_paused() override; diff --git a/Libraries/LibWeb/Layout/AudioBox.cpp b/Libraries/LibWeb/Layout/AudioBox.cpp index 5f7270ad892..13e897654c5 100644 --- a/Libraries/LibWeb/Layout/AudioBox.cpp +++ b/Libraries/LibWeb/Layout/AudioBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(AudioBox); -AudioBox::AudioBox(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style) +AudioBox::AudioBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style) : ReplacedBox(document, element, move(style)) { set_natural_width(300); diff --git a/Libraries/LibWeb/Layout/AudioBox.h b/Libraries/LibWeb/Layout/AudioBox.h index 8c8f33819b2..ab9e5d8d634 100644 --- a/Libraries/LibWeb/Layout/AudioBox.h +++ b/Libraries/LibWeb/Layout/AudioBox.h @@ -23,7 +23,7 @@ public: virtual GC::Ptr create_paintable() const override; private: - AudioBox(DOM::Document&, DOM::Element&, CSS::StyleProperties); + AudioBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties); }; } diff --git a/Libraries/LibWeb/Layout/BlockContainer.cpp b/Libraries/LibWeb/Layout/BlockContainer.cpp index 3902d0d87f4..15c052cb8c9 100644 --- a/Libraries/LibWeb/Layout/BlockContainer.cpp +++ b/Libraries/LibWeb/Layout/BlockContainer.cpp @@ -9,7 +9,7 @@ namespace Web::Layout { -BlockContainer::BlockContainer(DOM::Document& document, DOM::Node* node, CSS::StyleProperties style) +BlockContainer::BlockContainer(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style) : Box(document, node, move(style)) { } diff --git a/Libraries/LibWeb/Layout/BlockContainer.h b/Libraries/LibWeb/Layout/BlockContainer.h index 7bcfd0ae96c..cd2f819a321 100644 --- a/Libraries/LibWeb/Layout/BlockContainer.h +++ b/Libraries/LibWeb/Layout/BlockContainer.h @@ -16,7 +16,7 @@ class BlockContainer : public Box { GC_CELL(BlockContainer, Box); public: - BlockContainer(DOM::Document&, DOM::Node*, CSS::StyleProperties); + BlockContainer(DOM::Document&, DOM::Node*, CSS::ComputedProperties); BlockContainer(DOM::Document&, DOM::Node*, NonnullOwnPtr); virtual ~BlockContainer() override; diff --git a/Libraries/LibWeb/Layout/Box.cpp b/Libraries/LibWeb/Layout/Box.cpp index 454509e048c..922ea44873c 100644 --- a/Libraries/LibWeb/Layout/Box.cpp +++ b/Libraries/LibWeb/Layout/Box.cpp @@ -14,7 +14,7 @@ namespace Web::Layout { -Box::Box(DOM::Document& document, DOM::Node* node, CSS::StyleProperties style) +Box::Box(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style) : NodeWithStyleAndBoxModelMetrics(document, node, move(style)) { } diff --git a/Libraries/LibWeb/Layout/Box.h b/Libraries/LibWeb/Layout/Box.h index d7a24044331..7713744c673 100644 --- a/Libraries/LibWeb/Layout/Box.h +++ b/Libraries/LibWeb/Layout/Box.h @@ -55,7 +55,7 @@ public: virtual void visit_edges(Cell::Visitor&) override; protected: - Box(DOM::Document&, DOM::Node*, CSS::StyleProperties); + Box(DOM::Document&, DOM::Node*, CSS::ComputedProperties); Box(DOM::Document&, DOM::Node*, NonnullOwnPtr); private: diff --git a/Libraries/LibWeb/Layout/BreakNode.cpp b/Libraries/LibWeb/Layout/BreakNode.cpp index 421840d3bee..0303f6cc83f 100644 --- a/Libraries/LibWeb/Layout/BreakNode.cpp +++ b/Libraries/LibWeb/Layout/BreakNode.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(BreakNode); -BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, CSS::StyleProperties style) +BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element, CSS::ComputedProperties style) : Layout::NodeWithStyleAndBoxModelMetrics(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/BreakNode.h b/Libraries/LibWeb/Layout/BreakNode.h index 1776e0a1a54..eaf757c8c16 100644 --- a/Libraries/LibWeb/Layout/BreakNode.h +++ b/Libraries/LibWeb/Layout/BreakNode.h @@ -16,7 +16,7 @@ class BreakNode final : public NodeWithStyleAndBoxModelMetrics { GC_DECLARE_ALLOCATOR(BreakNode); public: - BreakNode(DOM::Document&, HTML::HTMLBRElement&, CSS::StyleProperties); + BreakNode(DOM::Document&, HTML::HTMLBRElement&, CSS::ComputedProperties); virtual ~BreakNode() override; const HTML::HTMLBRElement& dom_node() const { return verify_cast(*Node::dom_node()); } diff --git a/Libraries/LibWeb/Layout/CanvasBox.cpp b/Libraries/LibWeb/Layout/CanvasBox.cpp index 5411ebf6a97..eae30c346a8 100644 --- a/Libraries/LibWeb/Layout/CanvasBox.cpp +++ b/Libraries/LibWeb/Layout/CanvasBox.cpp @@ -11,7 +11,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(CanvasBox); -CanvasBox::CanvasBox(DOM::Document& document, HTML::HTMLCanvasElement& element, CSS::StyleProperties style) +CanvasBox::CanvasBox(DOM::Document& document, HTML::HTMLCanvasElement& element, CSS::ComputedProperties style) : ReplacedBox(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/CanvasBox.h b/Libraries/LibWeb/Layout/CanvasBox.h index c9781e0541c..c9ed27ec490 100644 --- a/Libraries/LibWeb/Layout/CanvasBox.h +++ b/Libraries/LibWeb/Layout/CanvasBox.h @@ -16,7 +16,7 @@ class CanvasBox final : public ReplacedBox { GC_DECLARE_ALLOCATOR(CanvasBox); public: - CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, CSS::StyleProperties); + CanvasBox(DOM::Document&, HTML::HTMLCanvasElement&, CSS::ComputedProperties); virtual ~CanvasBox() override; virtual void prepare_for_replaced_layout() override; diff --git a/Libraries/LibWeb/Layout/CheckBox.cpp b/Libraries/LibWeb/Layout/CheckBox.cpp index 8dfc6416dfd..c7d7a289f9e 100644 --- a/Libraries/LibWeb/Layout/CheckBox.cpp +++ b/Libraries/LibWeb/Layout/CheckBox.cpp @@ -13,7 +13,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(CheckBox); -CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, CSS::StyleProperties style) +CheckBox::CheckBox(DOM::Document& document, HTML::HTMLInputElement& element, CSS::ComputedProperties style) : FormAssociatedLabelableNode(document, element, move(style)) { set_natural_width(13); diff --git a/Libraries/LibWeb/Layout/CheckBox.h b/Libraries/LibWeb/Layout/CheckBox.h index 4472577537e..43b84f7b919 100644 --- a/Libraries/LibWeb/Layout/CheckBox.h +++ b/Libraries/LibWeb/Layout/CheckBox.h @@ -16,7 +16,7 @@ class CheckBox final : public FormAssociatedLabelableNode { GC_DECLARE_ALLOCATOR(CheckBox); public: - CheckBox(DOM::Document&, HTML::HTMLInputElement&, CSS::StyleProperties); + CheckBox(DOM::Document&, HTML::HTMLInputElement&, CSS::ComputedProperties); virtual ~CheckBox() override; private: diff --git a/Libraries/LibWeb/Layout/FieldSetBox.cpp b/Libraries/LibWeb/Layout/FieldSetBox.cpp index 458c5939ce9..65f27ab416f 100644 --- a/Libraries/LibWeb/Layout/FieldSetBox.cpp +++ b/Libraries/LibWeb/Layout/FieldSetBox.cpp @@ -14,7 +14,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(FieldSetBox); -FieldSetBox::FieldSetBox(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style) +FieldSetBox::FieldSetBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style) : BlockContainer(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/FieldSetBox.h b/Libraries/LibWeb/Layout/FieldSetBox.h index 6b9841c30ff..3bab35d5c97 100644 --- a/Libraries/LibWeb/Layout/FieldSetBox.h +++ b/Libraries/LibWeb/Layout/FieldSetBox.h @@ -16,7 +16,7 @@ class FieldSetBox final : public BlockContainer { GC_DECLARE_ALLOCATOR(FieldSetBox); public: - FieldSetBox(DOM::Document&, DOM::Element&, CSS::StyleProperties); + FieldSetBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties); virtual ~FieldSetBox() override; DOM::Element& dom_node() { return static_cast(*BlockContainer::dom_node()); } diff --git a/Libraries/LibWeb/Layout/FormAssociatedLabelableNode.h b/Libraries/LibWeb/Layout/FormAssociatedLabelableNode.h index 6398bbcd9d1..4f9ed37dc50 100644 --- a/Libraries/LibWeb/Layout/FormAssociatedLabelableNode.h +++ b/Libraries/LibWeb/Layout/FormAssociatedLabelableNode.h @@ -21,7 +21,7 @@ public: HTML::FormAssociatedElement& dom_node() { return dynamic_cast(LabelableNode::dom_node()); } protected: - FormAssociatedLabelableNode(DOM::Document& document, HTML::FormAssociatedElement& element, CSS::StyleProperties style) + FormAssociatedLabelableNode(DOM::Document& document, HTML::FormAssociatedElement& element, CSS::ComputedProperties style) : LabelableNode(document, element.form_associated_element_to_html_element(), move(style)) { } diff --git a/Libraries/LibWeb/Layout/ImageBox.cpp b/Libraries/LibWeb/Layout/ImageBox.cpp index 2d23ef1cdfe..f4548b7a4ab 100644 --- a/Libraries/LibWeb/Layout/ImageBox.cpp +++ b/Libraries/LibWeb/Layout/ImageBox.cpp @@ -15,7 +15,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(ImageBox); -ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style, ImageProvider const& image_provider) +ImageBox::ImageBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style, ImageProvider const& image_provider) : ReplacedBox(document, element, move(style)) , m_image_provider(image_provider) { diff --git a/Libraries/LibWeb/Layout/ImageBox.h b/Libraries/LibWeb/Layout/ImageBox.h index de6f42f9b00..2854c50a2c9 100644 --- a/Libraries/LibWeb/Layout/ImageBox.h +++ b/Libraries/LibWeb/Layout/ImageBox.h @@ -16,7 +16,7 @@ class ImageBox final : public ReplacedBox { GC_DECLARE_ALLOCATOR(ImageBox); public: - ImageBox(DOM::Document&, DOM::Element&, CSS::StyleProperties, ImageProvider const&); + ImageBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties, ImageProvider const&); virtual ~ImageBox() override; virtual void prepare_for_replaced_layout() override; diff --git a/Libraries/LibWeb/Layout/InlineNode.cpp b/Libraries/LibWeb/Layout/InlineNode.cpp index 7961b096f91..e34c3cd2bc1 100644 --- a/Libraries/LibWeb/Layout/InlineNode.cpp +++ b/Libraries/LibWeb/Layout/InlineNode.cpp @@ -16,7 +16,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(InlineNode); -InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, CSS::StyleProperties style) +InlineNode::InlineNode(DOM::Document& document, DOM::Element* element, CSS::ComputedProperties style) : Layout::NodeWithStyleAndBoxModelMetrics(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/InlineNode.h b/Libraries/LibWeb/Layout/InlineNode.h index b9b1535eff0..fbfe06c9240 100644 --- a/Libraries/LibWeb/Layout/InlineNode.h +++ b/Libraries/LibWeb/Layout/InlineNode.h @@ -15,7 +15,7 @@ class InlineNode final : public NodeWithStyleAndBoxModelMetrics { GC_DECLARE_ALLOCATOR(InlineNode); public: - InlineNode(DOM::Document&, DOM::Element*, CSS::StyleProperties); + InlineNode(DOM::Document&, DOM::Element*, CSS::ComputedProperties); virtual ~InlineNode() override; GC::Ptr create_paintable_for_line_with_index(size_t line_index) const; diff --git a/Libraries/LibWeb/Layout/Label.cpp b/Libraries/LibWeb/Layout/Label.cpp index d650656302e..e992ab4bec9 100644 --- a/Libraries/LibWeb/Layout/Label.cpp +++ b/Libraries/LibWeb/Layout/Label.cpp @@ -17,7 +17,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(Label); -Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, CSS::StyleProperties style) +Label::Label(DOM::Document& document, HTML::HTMLLabelElement* element, CSS::ComputedProperties style) : BlockContainer(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/Label.h b/Libraries/LibWeb/Layout/Label.h index d8a8f227b1b..adbd359b735 100644 --- a/Libraries/LibWeb/Layout/Label.h +++ b/Libraries/LibWeb/Layout/Label.h @@ -16,7 +16,7 @@ class Label final : public BlockContainer { GC_DECLARE_ALLOCATOR(Label); public: - Label(DOM::Document&, HTML::HTMLLabelElement*, CSS::StyleProperties); + Label(DOM::Document&, HTML::HTMLLabelElement*, CSS::ComputedProperties); virtual ~Label() override; static bool is_inside_associated_label(LabelableNode const&, CSSPixelPoint); diff --git a/Libraries/LibWeb/Layout/LabelableNode.h b/Libraries/LibWeb/Layout/LabelableNode.h index 19e3efa20b7..02dea4a9cb7 100644 --- a/Libraries/LibWeb/Layout/LabelableNode.h +++ b/Libraries/LibWeb/Layout/LabelableNode.h @@ -19,7 +19,7 @@ public: Painting::LabelablePaintable const* paintable() const; protected: - LabelableNode(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style) + LabelableNode(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style) : ReplacedBox(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LegendBox.cpp b/Libraries/LibWeb/Layout/LegendBox.cpp index 32a353857ec..7d6e8f9b1d7 100644 --- a/Libraries/LibWeb/Layout/LegendBox.cpp +++ b/Libraries/LibWeb/Layout/LegendBox.cpp @@ -10,7 +10,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(LegendBox); -LegendBox::LegendBox(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style) +LegendBox::LegendBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style) : BlockContainer(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LegendBox.h b/Libraries/LibWeb/Layout/LegendBox.h index b12c866fa64..41627f66619 100644 --- a/Libraries/LibWeb/Layout/LegendBox.h +++ b/Libraries/LibWeb/Layout/LegendBox.h @@ -15,7 +15,7 @@ class LegendBox final : public BlockContainer { GC_DECLARE_ALLOCATOR(LegendBox); public: - LegendBox(DOM::Document&, DOM::Element&, CSS::StyleProperties); + LegendBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties); virtual ~LegendBox() override; DOM::Element& dom_node() { return static_cast(*Box::dom_node()); } diff --git a/Libraries/LibWeb/Layout/ListItemBox.cpp b/Libraries/LibWeb/Layout/ListItemBox.cpp index 3205919cbd4..fc5cea5e896 100644 --- a/Libraries/LibWeb/Layout/ListItemBox.cpp +++ b/Libraries/LibWeb/Layout/ListItemBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(ListItemBox); -ListItemBox::ListItemBox(DOM::Document& document, DOM::Element* element, CSS::StyleProperties style) +ListItemBox::ListItemBox(DOM::Document& document, DOM::Element* element, CSS::ComputedProperties style) : Layout::BlockContainer(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/ListItemBox.h b/Libraries/LibWeb/Layout/ListItemBox.h index c543fef7f11..e7cf790fc38 100644 --- a/Libraries/LibWeb/Layout/ListItemBox.h +++ b/Libraries/LibWeb/Layout/ListItemBox.h @@ -16,7 +16,7 @@ class ListItemBox final : public BlockContainer { GC_DECLARE_ALLOCATOR(ListItemBox); public: - ListItemBox(DOM::Document&, DOM::Element*, CSS::StyleProperties); + ListItemBox(DOM::Document&, DOM::Element*, CSS::ComputedProperties); virtual ~ListItemBox() override; DOM::Element& dom_node() { return static_cast(*BlockContainer::dom_node()); } diff --git a/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp b/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp index c00b095aebc..a7014bad4fe 100644 --- a/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp +++ b/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(ListItemMarkerBox); -ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, CSS::ListStylePosition style_position, size_t index, CSS::StyleProperties style) +ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, CSS::ListStylePosition style_position, size_t index, CSS::ComputedProperties style) : Box(document, nullptr, move(style)) , m_list_style_type(style_type) , m_list_style_position(style_position) diff --git a/Libraries/LibWeb/Layout/ListItemMarkerBox.h b/Libraries/LibWeb/Layout/ListItemMarkerBox.h index 4f98281be10..ffa01c8417b 100644 --- a/Libraries/LibWeb/Layout/ListItemMarkerBox.h +++ b/Libraries/LibWeb/Layout/ListItemMarkerBox.h @@ -16,7 +16,7 @@ class ListItemMarkerBox final : public Box { GC_DECLARE_ALLOCATOR(ListItemMarkerBox); public: - explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, CSS::StyleProperties); + explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, CSS::ComputedProperties); virtual ~ListItemMarkerBox() override; Optional const& text() const { return m_text; } diff --git a/Libraries/LibWeb/Layout/NavigableContainerViewport.cpp b/Libraries/LibWeb/Layout/NavigableContainerViewport.cpp index 7f583ab32e1..d014f4c9239 100644 --- a/Libraries/LibWeb/Layout/NavigableContainerViewport.cpp +++ b/Libraries/LibWeb/Layout/NavigableContainerViewport.cpp @@ -16,7 +16,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(NavigableContainerViewport); -NavigableContainerViewport::NavigableContainerViewport(DOM::Document& document, HTML::NavigableContainer& element, CSS::StyleProperties style) +NavigableContainerViewport::NavigableContainerViewport(DOM::Document& document, HTML::NavigableContainer& element, CSS::ComputedProperties style) : ReplacedBox(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/NavigableContainerViewport.h b/Libraries/LibWeb/Layout/NavigableContainerViewport.h index d23bd9fa5d3..c2c2a6e63c0 100644 --- a/Libraries/LibWeb/Layout/NavigableContainerViewport.h +++ b/Libraries/LibWeb/Layout/NavigableContainerViewport.h @@ -16,7 +16,7 @@ class NavigableContainerViewport final : public ReplacedBox { GC_DECLARE_ALLOCATOR(NavigableContainerViewport); public: - NavigableContainerViewport(DOM::Document&, HTML::NavigableContainer&, CSS::StyleProperties); + NavigableContainerViewport(DOM::Document&, HTML::NavigableContainer&, CSS::ComputedProperties); virtual ~NavigableContainerViewport() override; virtual void prepare_for_replaced_layout() override; diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp index 0bc14946b90..cc5c5b1bde4 100644 --- a/Libraries/LibWeb/Layout/Node.cpp +++ b/Libraries/LibWeb/Layout/Node.cpp @@ -276,7 +276,7 @@ bool Node::is_sticky_position() const return position == CSS::Positioning::Sticky; } -NodeWithStyle::NodeWithStyle(DOM::Document& document, DOM::Node* node, CSS::StyleProperties computed_style) +NodeWithStyle::NodeWithStyle(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties computed_style) : Node(document, node) , m_computed_values(make()) { @@ -324,7 +324,7 @@ static CSSPixels snap_a_length_as_a_border_width(double device_pixels_per_css_pi return length; } -void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style) +void NodeWithStyle::apply_style(const CSS::ComputedProperties& computed_style) { auto& computed_values = mutable_computed_values(); diff --git a/Libraries/LibWeb/Layout/Node.h b/Libraries/LibWeb/Layout/Node.h index 70cd95a87ff..1681ef48181 100644 --- a/Libraries/LibWeb/Layout/Node.h +++ b/Libraries/LibWeb/Layout/Node.h @@ -9,9 +9,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -222,7 +222,7 @@ public: CSS::ImmutableComputedValues const& computed_values() const { return static_cast(*m_computed_values); } CSS::MutableComputedValues& mutable_computed_values() { return static_cast(*m_computed_values); } - void apply_style(const CSS::StyleProperties&); + void apply_style(const CSS::ComputedProperties&); Gfx::Font const& first_available_font() const; Vector const& background_layers() const { return computed_values().background_layers(); } @@ -238,7 +238,7 @@ public: virtual void visit_edges(Cell::Visitor& visitor) override; protected: - NodeWithStyle(DOM::Document&, DOM::Node*, CSS::StyleProperties); + NodeWithStyle(DOM::Document&, DOM::Node*, CSS::ComputedProperties); NodeWithStyle(DOM::Document&, DOM::Node*, NonnullOwnPtr); private: @@ -257,7 +257,7 @@ public: BoxModelMetrics const& box_model() const { return m_box_model; } protected: - NodeWithStyleAndBoxModelMetrics(DOM::Document& document, DOM::Node* node, CSS::StyleProperties style) + NodeWithStyleAndBoxModelMetrics(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style) : NodeWithStyle(document, node, move(style)) { } diff --git a/Libraries/LibWeb/Layout/RadioButton.cpp b/Libraries/LibWeb/Layout/RadioButton.cpp index 406938a4e24..0fda5b1e116 100644 --- a/Libraries/LibWeb/Layout/RadioButton.cpp +++ b/Libraries/LibWeb/Layout/RadioButton.cpp @@ -14,7 +14,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(RadioButton); -RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, CSS::StyleProperties style) +RadioButton::RadioButton(DOM::Document& document, HTML::HTMLInputElement& element, CSS::ComputedProperties style) : FormAssociatedLabelableNode(document, element, move(style)) { set_natural_width(12); diff --git a/Libraries/LibWeb/Layout/RadioButton.h b/Libraries/LibWeb/Layout/RadioButton.h index 3af87c34475..dbce67f0aee 100644 --- a/Libraries/LibWeb/Layout/RadioButton.h +++ b/Libraries/LibWeb/Layout/RadioButton.h @@ -16,7 +16,7 @@ class RadioButton final : public FormAssociatedLabelableNode { GC_DECLARE_ALLOCATOR(RadioButton); public: - RadioButton(DOM::Document&, HTML::HTMLInputElement&, CSS::StyleProperties); + RadioButton(DOM::Document&, HTML::HTMLInputElement&, CSS::ComputedProperties); virtual ~RadioButton() override; private: diff --git a/Libraries/LibWeb/Layout/ReplacedBox.cpp b/Libraries/LibWeb/Layout/ReplacedBox.cpp index b210043a979..7a3f0cee961 100644 --- a/Libraries/LibWeb/Layout/ReplacedBox.cpp +++ b/Libraries/LibWeb/Layout/ReplacedBox.cpp @@ -11,7 +11,7 @@ namespace Web::Layout { -ReplacedBox::ReplacedBox(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style) +ReplacedBox::ReplacedBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style) : Box(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/ReplacedBox.h b/Libraries/LibWeb/Layout/ReplacedBox.h index bff51fcd256..548854d1596 100644 --- a/Libraries/LibWeb/Layout/ReplacedBox.h +++ b/Libraries/LibWeb/Layout/ReplacedBox.h @@ -15,7 +15,7 @@ class ReplacedBox : public Box { GC_CELL(ReplacedBox, Box); public: - ReplacedBox(DOM::Document&, DOM::Element&, CSS::StyleProperties); + ReplacedBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties); virtual ~ReplacedBox() override; DOM::Element const& dom_node() const { return verify_cast(*Node::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGBox.cpp b/Libraries/LibWeb/Layout/SVGBox.cpp index 3df18c1140f..84a72f09772 100644 --- a/Libraries/LibWeb/Layout/SVGBox.cpp +++ b/Libraries/LibWeb/Layout/SVGBox.cpp @@ -8,7 +8,7 @@ namespace Web::Layout { -SVGBox::SVGBox(DOM::Document& document, SVG::SVGElement& element, CSS::StyleProperties style) +SVGBox::SVGBox(DOM::Document& document, SVG::SVGElement& element, CSS::ComputedProperties style) : Box(document, &element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/SVGBox.h b/Libraries/LibWeb/Layout/SVGBox.h index 3a53ebee428..1732a7d3680 100644 --- a/Libraries/LibWeb/Layout/SVGBox.h +++ b/Libraries/LibWeb/Layout/SVGBox.h @@ -16,7 +16,7 @@ class SVGBox : public Box { GC_CELL(SVGBox, Box); public: - SVGBox(DOM::Document&, SVG::SVGElement&, CSS::StyleProperties); + SVGBox(DOM::Document&, SVG::SVGElement&, CSS::ComputedProperties); virtual ~SVGBox() override = default; SVG::SVGElement& dom_node() { return verify_cast(*Box::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGClipBox.cpp b/Libraries/LibWeb/Layout/SVGClipBox.cpp index 5c93d0da161..4e590e92573 100644 --- a/Libraries/LibWeb/Layout/SVGClipBox.cpp +++ b/Libraries/LibWeb/Layout/SVGClipBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGClipBox); -SVGClipBox::SVGClipBox(DOM::Document& document, SVG::SVGClipPathElement& element, CSS::StyleProperties properties) +SVGClipBox::SVGClipBox(DOM::Document& document, SVG::SVGClipPathElement& element, CSS::ComputedProperties properties) : SVGBox(document, element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGClipBox.h b/Libraries/LibWeb/Layout/SVGClipBox.h index bb1a4c52a09..12d1bfad30c 100644 --- a/Libraries/LibWeb/Layout/SVGClipBox.h +++ b/Libraries/LibWeb/Layout/SVGClipBox.h @@ -17,7 +17,7 @@ class SVGClipBox : public SVGBox { GC_DECLARE_ALLOCATOR(SVGClipBox); public: - SVGClipBox(DOM::Document&, SVG::SVGClipPathElement&, CSS::StyleProperties); + SVGClipBox(DOM::Document&, SVG::SVGClipPathElement&, CSS::ComputedProperties); virtual ~SVGClipBox() override = default; SVG::SVGClipPathElement& dom_node() { return verify_cast(SVGBox::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGForeignObjectBox.cpp b/Libraries/LibWeb/Layout/SVGForeignObjectBox.cpp index 616f16a5251..32f72f91011 100644 --- a/Libraries/LibWeb/Layout/SVGForeignObjectBox.cpp +++ b/Libraries/LibWeb/Layout/SVGForeignObjectBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGForeignObjectBox); -SVGForeignObjectBox::SVGForeignObjectBox(DOM::Document& document, SVG::SVGForeignObjectElement& element, CSS::StyleProperties properties) +SVGForeignObjectBox::SVGForeignObjectBox(DOM::Document& document, SVG::SVGForeignObjectElement& element, CSS::ComputedProperties properties) : BlockContainer(document, &element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGForeignObjectBox.h b/Libraries/LibWeb/Layout/SVGForeignObjectBox.h index 6a127d23873..7f8667303ef 100644 --- a/Libraries/LibWeb/Layout/SVGForeignObjectBox.h +++ b/Libraries/LibWeb/Layout/SVGForeignObjectBox.h @@ -18,7 +18,7 @@ class SVGForeignObjectBox final : public BlockContainer { GC_DECLARE_ALLOCATOR(SVGForeignObjectBox); public: - SVGForeignObjectBox(DOM::Document&, SVG::SVGForeignObjectElement&, CSS::StyleProperties); + SVGForeignObjectBox(DOM::Document&, SVG::SVGForeignObjectElement&, CSS::ComputedProperties); virtual ~SVGForeignObjectBox() override = default; SVG::SVGForeignObjectElement& dom_node() { return static_cast(*BlockContainer::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGGeometryBox.cpp b/Libraries/LibWeb/Layout/SVGGeometryBox.cpp index ca36d95a81b..ec5b7e01246 100644 --- a/Libraries/LibWeb/Layout/SVGGeometryBox.cpp +++ b/Libraries/LibWeb/Layout/SVGGeometryBox.cpp @@ -14,7 +14,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGGeometryBox); -SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& element, CSS::StyleProperties properties) +SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& element, CSS::ComputedProperties properties) : SVGGraphicsBox(document, element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGGeometryBox.h b/Libraries/LibWeb/Layout/SVGGeometryBox.h index 28afb19a451..c60d4e09910 100644 --- a/Libraries/LibWeb/Layout/SVGGeometryBox.h +++ b/Libraries/LibWeb/Layout/SVGGeometryBox.h @@ -17,7 +17,7 @@ class SVGGeometryBox final : public SVGGraphicsBox { GC_DECLARE_ALLOCATOR(SVGGeometryBox); public: - SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, CSS::StyleProperties); + SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, CSS::ComputedProperties); virtual ~SVGGeometryBox() override = default; SVG::SVGGeometryElement& dom_node() { return static_cast(SVGGraphicsBox::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGGraphicsBox.cpp b/Libraries/LibWeb/Layout/SVGGraphicsBox.cpp index 03a71761958..f4e51be040b 100644 --- a/Libraries/LibWeb/Layout/SVGGraphicsBox.cpp +++ b/Libraries/LibWeb/Layout/SVGGraphicsBox.cpp @@ -10,7 +10,7 @@ namespace Web::Layout { -SVGGraphicsBox::SVGGraphicsBox(DOM::Document& document, SVG::SVGGraphicsElement& element, CSS::StyleProperties properties) +SVGGraphicsBox::SVGGraphicsBox(DOM::Document& document, SVG::SVGGraphicsElement& element, CSS::ComputedProperties properties) : SVGBox(document, element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGGraphicsBox.h b/Libraries/LibWeb/Layout/SVGGraphicsBox.h index 7b4e98aac57..2db75309dcd 100644 --- a/Libraries/LibWeb/Layout/SVGGraphicsBox.h +++ b/Libraries/LibWeb/Layout/SVGGraphicsBox.h @@ -16,7 +16,7 @@ class SVGGraphicsBox : public SVGBox { GC_CELL(SVGGraphicsBox, SVGBox); public: - SVGGraphicsBox(DOM::Document&, SVG::SVGGraphicsElement&, CSS::StyleProperties); + SVGGraphicsBox(DOM::Document&, SVG::SVGGraphicsElement&, CSS::ComputedProperties); virtual ~SVGGraphicsBox() override = default; SVG::SVGGraphicsElement& dom_node() { return verify_cast(SVGBox::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGImageBox.cpp b/Libraries/LibWeb/Layout/SVGImageBox.cpp index 477aff07a04..cefbac7ba13 100644 --- a/Libraries/LibWeb/Layout/SVGImageBox.cpp +++ b/Libraries/LibWeb/Layout/SVGImageBox.cpp @@ -11,7 +11,7 @@ namespace Web::Layout { -SVGImageBox::SVGImageBox(DOM::Document& document, SVG::SVGGraphicsElement& element, CSS::StyleProperties properties) +SVGImageBox::SVGImageBox(DOM::Document& document, SVG::SVGGraphicsElement& element, CSS::ComputedProperties properties) : SVGGraphicsBox(document, element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGImageBox.h b/Libraries/LibWeb/Layout/SVGImageBox.h index d500082c70f..a43ec4fac25 100644 --- a/Libraries/LibWeb/Layout/SVGImageBox.h +++ b/Libraries/LibWeb/Layout/SVGImageBox.h @@ -16,7 +16,7 @@ class SVGImageBox : public SVGGraphicsBox { GC_CELL(SVGImageBox, SVGGraphicsBox); public: - SVGImageBox(DOM::Document&, SVG::SVGGraphicsElement&, CSS::StyleProperties); + SVGImageBox(DOM::Document&, SVG::SVGGraphicsElement&, CSS::ComputedProperties); virtual ~SVGImageBox() override = default; SVG::SVGImageElement& dom_node() { return static_cast(SVGGraphicsBox::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGMaskBox.cpp b/Libraries/LibWeb/Layout/SVGMaskBox.cpp index 5133e203c61..74758f7200b 100644 --- a/Libraries/LibWeb/Layout/SVGMaskBox.cpp +++ b/Libraries/LibWeb/Layout/SVGMaskBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGMaskBox); -SVGMaskBox::SVGMaskBox(DOM::Document& document, SVG::SVGMaskElement& element, CSS::StyleProperties properties) +SVGMaskBox::SVGMaskBox(DOM::Document& document, SVG::SVGMaskElement& element, CSS::ComputedProperties properties) : SVGGraphicsBox(document, element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGMaskBox.h b/Libraries/LibWeb/Layout/SVGMaskBox.h index 0cfa1879204..bbdbcec895f 100644 --- a/Libraries/LibWeb/Layout/SVGMaskBox.h +++ b/Libraries/LibWeb/Layout/SVGMaskBox.h @@ -17,7 +17,7 @@ class SVGMaskBox : public SVGGraphicsBox { GC_DECLARE_ALLOCATOR(SVGMaskBox); public: - SVGMaskBox(DOM::Document&, SVG::SVGMaskElement&, CSS::StyleProperties); + SVGMaskBox(DOM::Document&, SVG::SVGMaskElement&, CSS::ComputedProperties); virtual ~SVGMaskBox() override = default; virtual bool is_svg_mask_box() const override { return true; } diff --git a/Libraries/LibWeb/Layout/SVGSVGBox.cpp b/Libraries/LibWeb/Layout/SVGSVGBox.cpp index 0f84776df03..f56772592dd 100644 --- a/Libraries/LibWeb/Layout/SVGSVGBox.cpp +++ b/Libraries/LibWeb/Layout/SVGSVGBox.cpp @@ -15,7 +15,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGSVGBox); -SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, CSS::StyleProperties properties) +SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, CSS::ComputedProperties properties) : ReplacedBox(document, element, move(properties)) { } diff --git a/Libraries/LibWeb/Layout/SVGSVGBox.h b/Libraries/LibWeb/Layout/SVGSVGBox.h index 260caf93bb9..448218a6dc1 100644 --- a/Libraries/LibWeb/Layout/SVGSVGBox.h +++ b/Libraries/LibWeb/Layout/SVGSVGBox.h @@ -16,7 +16,7 @@ class SVGSVGBox final : public ReplacedBox { GC_DECLARE_ALLOCATOR(SVGSVGBox); public: - SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, CSS::StyleProperties); + SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, CSS::ComputedProperties); virtual ~SVGSVGBox() override = default; SVG::SVGSVGElement& dom_node() { return verify_cast(ReplacedBox::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGTextBox.cpp b/Libraries/LibWeb/Layout/SVGTextBox.cpp index e3737b04cc8..6aaafb9cc67 100644 --- a/Libraries/LibWeb/Layout/SVGTextBox.cpp +++ b/Libraries/LibWeb/Layout/SVGTextBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGTextBox); -SVGTextBox::SVGTextBox(DOM::Document& document, SVG::SVGTextPositioningElement& element, CSS::StyleProperties properties) +SVGTextBox::SVGTextBox(DOM::Document& document, SVG::SVGTextPositioningElement& element, CSS::ComputedProperties properties) : SVGGraphicsBox(document, element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGTextBox.h b/Libraries/LibWeb/Layout/SVGTextBox.h index ad22976f7bf..472f738344e 100644 --- a/Libraries/LibWeb/Layout/SVGTextBox.h +++ b/Libraries/LibWeb/Layout/SVGTextBox.h @@ -17,7 +17,7 @@ class SVGTextBox final : public SVGGraphicsBox { GC_DECLARE_ALLOCATOR(SVGTextBox); public: - SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, CSS::StyleProperties); + SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, CSS::ComputedProperties); virtual ~SVGTextBox() override = default; SVG::SVGTextPositioningElement& dom_node() { return static_cast(SVGGraphicsBox::dom_node()); } diff --git a/Libraries/LibWeb/Layout/SVGTextPathBox.cpp b/Libraries/LibWeb/Layout/SVGTextPathBox.cpp index 900b8508ca6..c3592ec459a 100644 --- a/Libraries/LibWeb/Layout/SVGTextPathBox.cpp +++ b/Libraries/LibWeb/Layout/SVGTextPathBox.cpp @@ -11,7 +11,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(SVGTextPathBox); -SVGTextPathBox::SVGTextPathBox(DOM::Document& document, SVG::SVGTextPathElement& element, CSS::StyleProperties properties) +SVGTextPathBox::SVGTextPathBox(DOM::Document& document, SVG::SVGTextPathElement& element, CSS::ComputedProperties properties) : SVGGraphicsBox(document, element, properties) { } diff --git a/Libraries/LibWeb/Layout/SVGTextPathBox.h b/Libraries/LibWeb/Layout/SVGTextPathBox.h index 87e88bd647f..a8ad77903be 100644 --- a/Libraries/LibWeb/Layout/SVGTextPathBox.h +++ b/Libraries/LibWeb/Layout/SVGTextPathBox.h @@ -16,7 +16,7 @@ class SVGTextPathBox final : public SVGGraphicsBox { GC_DECLARE_ALLOCATOR(SVGTextPathBox); public: - SVGTextPathBox(DOM::Document&, SVG::SVGTextPathElement&, CSS::StyleProperties); + SVGTextPathBox(DOM::Document&, SVG::SVGTextPathElement&, CSS::ComputedProperties); virtual ~SVGTextPathBox() override = default; SVG::SVGTextPathElement& dom_node() { return static_cast(SVGGraphicsBox::dom_node()); } diff --git a/Libraries/LibWeb/Layout/TableWrapper.cpp b/Libraries/LibWeb/Layout/TableWrapper.cpp index 11940d5b80d..0b8029a783d 100644 --- a/Libraries/LibWeb/Layout/TableWrapper.cpp +++ b/Libraries/LibWeb/Layout/TableWrapper.cpp @@ -10,7 +10,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(TableWrapper); -TableWrapper::TableWrapper(DOM::Document& document, DOM::Node* node, CSS::StyleProperties style) +TableWrapper::TableWrapper(DOM::Document& document, DOM::Node* node, CSS::ComputedProperties style) : BlockContainer(document, node, move(style)) { } diff --git a/Libraries/LibWeb/Layout/TableWrapper.h b/Libraries/LibWeb/Layout/TableWrapper.h index 0ed2a1ec116..49f50cf2fb1 100644 --- a/Libraries/LibWeb/Layout/TableWrapper.h +++ b/Libraries/LibWeb/Layout/TableWrapper.h @@ -15,7 +15,7 @@ class TableWrapper : public BlockContainer { GC_DECLARE_ALLOCATOR(TableWrapper); public: - TableWrapper(DOM::Document&, DOM::Node*, CSS::StyleProperties); + TableWrapper(DOM::Document&, DOM::Node*, CSS::ComputedProperties); TableWrapper(DOM::Document&, DOM::Node*, NonnullOwnPtr); virtual ~TableWrapper() override; diff --git a/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Libraries/LibWeb/Layout/TreeBuilder.cpp index dbceceaf140..e3ed43b5ed3 100644 --- a/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -346,7 +346,7 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context& auto& document = dom_node.document(); auto& style_computer = document.style_computer(); - Optional style; + Optional style; CSS::Display display; if (is(dom_node)) { diff --git a/Libraries/LibWeb/Layout/VideoBox.cpp b/Libraries/LibWeb/Layout/VideoBox.cpp index 33852d24baa..ca5dfabac85 100644 --- a/Libraries/LibWeb/Layout/VideoBox.cpp +++ b/Libraries/LibWeb/Layout/VideoBox.cpp @@ -12,7 +12,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(VideoBox); -VideoBox::VideoBox(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style) +VideoBox::VideoBox(DOM::Document& document, DOM::Element& element, CSS::ComputedProperties style) : ReplacedBox(document, element, move(style)) { document.register_viewport_client(*this); diff --git a/Libraries/LibWeb/Layout/VideoBox.h b/Libraries/LibWeb/Layout/VideoBox.h index 3e7e82dbf85..21a5f60af30 100644 --- a/Libraries/LibWeb/Layout/VideoBox.h +++ b/Libraries/LibWeb/Layout/VideoBox.h @@ -27,7 +27,7 @@ public: virtual GC::Ptr create_paintable() const override; private: - VideoBox(DOM::Document&, DOM::Element&, CSS::StyleProperties); + VideoBox(DOM::Document&, DOM::Element&, CSS::ComputedProperties); // ^Document::ViewportClient virtual void did_set_viewport_rect(CSSPixelRect const&) final; diff --git a/Libraries/LibWeb/Layout/Viewport.cpp b/Libraries/LibWeb/Layout/Viewport.cpp index 0ee2456f3d0..a58e172a9ce 100644 --- a/Libraries/LibWeb/Layout/Viewport.cpp +++ b/Libraries/LibWeb/Layout/Viewport.cpp @@ -16,7 +16,7 @@ namespace Web::Layout { GC_DEFINE_ALLOCATOR(Viewport); -Viewport::Viewport(DOM::Document& document, CSS::StyleProperties style) +Viewport::Viewport(DOM::Document& document, CSS::ComputedProperties style) : BlockContainer(document, &document, move(style)) { } diff --git a/Libraries/LibWeb/Layout/Viewport.h b/Libraries/LibWeb/Layout/Viewport.h index 3f19c9334fc..8cfc172530e 100644 --- a/Libraries/LibWeb/Layout/Viewport.h +++ b/Libraries/LibWeb/Layout/Viewport.h @@ -16,7 +16,7 @@ class Viewport final : public BlockContainer { GC_DECLARE_ALLOCATOR(Viewport); public: - explicit Viewport(DOM::Document&, CSS::StyleProperties); + explicit Viewport(DOM::Document&, CSS::ComputedProperties); virtual ~Viewport() override; struct TextPosition { diff --git a/Libraries/LibWeb/SVG/SVGAElement.cpp b/Libraries/LibWeb/SVG/SVGAElement.cpp index dde6689671c..061fd9b88df 100644 --- a/Libraries/LibWeb/SVG/SVGAElement.cpp +++ b/Libraries/LibWeb/SVG/SVGAElement.cpp @@ -63,7 +63,7 @@ GC::Ref SVGAElement::rel_list() return *m_rel_list; } -GC::Ptr SVGAElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGAElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGAElement.h b/Libraries/LibWeb/SVG/SVGAElement.h index 90f1b35c6ca..d085c7af2c5 100644 --- a/Libraries/LibWeb/SVG/SVGAElement.h +++ b/Libraries/LibWeb/SVG/SVGAElement.h @@ -23,7 +23,7 @@ public: GC::Ref rel_list(); - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; private: SVGAElement(DOM::Document&, DOM::QualifiedName); diff --git a/Libraries/LibWeb/SVG/SVGClipPathElement.cpp b/Libraries/LibWeb/SVG/SVGClipPathElement.cpp index 15c0700cbf8..d580ac87cbd 100644 --- a/Libraries/LibWeb/SVG/SVGClipPathElement.cpp +++ b/Libraries/LibWeb/SVG/SVGClipPathElement.cpp @@ -36,7 +36,7 @@ void SVGClipPathElement::attribute_changed(FlyString const& name, Optional SVGClipPathElement::create_layout_node(CSS::StyleProperties) +GC::Ptr SVGClipPathElement::create_layout_node(CSS::ComputedProperties) { // Clip paths are handled as a special case in the TreeBuilder. return nullptr; diff --git a/Libraries/LibWeb/SVG/SVGClipPathElement.h b/Libraries/LibWeb/SVG/SVGClipPathElement.h index cbf8817fe3b..aa3312eed03 100644 --- a/Libraries/LibWeb/SVG/SVGClipPathElement.h +++ b/Libraries/LibWeb/SVG/SVGClipPathElement.h @@ -40,7 +40,7 @@ public: return m_clip_path_units.value_or(ClipPathUnits::UserSpaceOnUse); } - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; private: SVGClipPathElement(DOM::Document&, DOM::QualifiedName); diff --git a/Libraries/LibWeb/SVG/SVGDefsElement.h b/Libraries/LibWeb/SVG/SVGDefsElement.h index 718f4ad05eb..9ed0ee6e0d9 100644 --- a/Libraries/LibWeb/SVG/SVGDefsElement.h +++ b/Libraries/LibWeb/SVG/SVGDefsElement.h @@ -17,7 +17,7 @@ class SVGDefsElement final : public SVGGraphicsElement { public: virtual ~SVGDefsElement(); - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override { return nullptr; } diff --git a/Libraries/LibWeb/SVG/SVGDescElement.cpp b/Libraries/LibWeb/SVG/SVGDescElement.cpp index ad9fcc64afb..dcbb5739320 100644 --- a/Libraries/LibWeb/SVG/SVGDescElement.cpp +++ b/Libraries/LibWeb/SVG/SVGDescElement.cpp @@ -25,7 +25,7 @@ void SVGDescElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGDescElement); } -GC::Ptr SVGDescElement::create_layout_node(CSS::StyleProperties) +GC::Ptr SVGDescElement::create_layout_node(CSS::ComputedProperties) { return nullptr; } diff --git a/Libraries/LibWeb/SVG/SVGDescElement.h b/Libraries/LibWeb/SVG/SVGDescElement.h index 8f5985ab801..6181fd2f689 100644 --- a/Libraries/LibWeb/SVG/SVGDescElement.h +++ b/Libraries/LibWeb/SVG/SVGDescElement.h @@ -19,7 +19,7 @@ private: virtual void initialize(JS::Realm&) override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; }; } diff --git a/Libraries/LibWeb/SVG/SVGElement.cpp b/Libraries/LibWeb/SVG/SVGElement.cpp index 46b8f32c5c4..98f092d3651 100644 --- a/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Libraries/LibWeb/SVG/SVGElement.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp b/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp index 16d00f95b54..9a4b26109e2 100644 --- a/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp +++ b/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp @@ -47,7 +47,7 @@ void SVGForeignObjectElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_height); } -GC::Ptr SVGForeignObjectElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGForeignObjectElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGForeignObjectElement.h b/Libraries/LibWeb/SVG/SVGForeignObjectElement.h index 3e9744e302d..771149f1ccf 100644 --- a/Libraries/LibWeb/SVG/SVGForeignObjectElement.h +++ b/Libraries/LibWeb/SVG/SVGForeignObjectElement.h @@ -18,7 +18,7 @@ class SVGForeignObjectElement final : public SVGGraphicsElement { public: virtual ~SVGForeignObjectElement() override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; GC::Ref x(); GC::Ref y(); diff --git a/Libraries/LibWeb/SVG/SVGGElement.cpp b/Libraries/LibWeb/SVG/SVGGElement.cpp index 9bcadfd024f..a850f4f567e 100644 --- a/Libraries/LibWeb/SVG/SVGGElement.cpp +++ b/Libraries/LibWeb/SVG/SVGGElement.cpp @@ -26,7 +26,7 @@ void SVGGElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGElement); } -GC::Ptr SVGGElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGGElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGGElement.h b/Libraries/LibWeb/SVG/SVGGElement.h index e969fcf35e4..11744adde96 100644 --- a/Libraries/LibWeb/SVG/SVGGElement.h +++ b/Libraries/LibWeb/SVG/SVGGElement.h @@ -17,7 +17,7 @@ class SVGGElement final : public SVGGraphicsElement { public: virtual ~SVGGElement() override = default; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; private: SVGGElement(DOM::Document&, DOM::QualifiedName); diff --git a/Libraries/LibWeb/SVG/SVGGeometryElement.cpp b/Libraries/LibWeb/SVG/SVGGeometryElement.cpp index 61f27c023e2..60bee2f4d79 100644 --- a/Libraries/LibWeb/SVG/SVGGeometryElement.cpp +++ b/Libraries/LibWeb/SVG/SVGGeometryElement.cpp @@ -22,7 +22,7 @@ void SVGGeometryElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGeometryElement); } -GC::Ptr SVGGeometryElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGGeometryElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGGeometryElement.h b/Libraries/LibWeb/SVG/SVGGeometryElement.h index fd6552604f5..ad9d2cf9463 100644 --- a/Libraries/LibWeb/SVG/SVGGeometryElement.h +++ b/Libraries/LibWeb/SVG/SVGGeometryElement.h @@ -16,7 +16,7 @@ class SVGGeometryElement : public SVGGraphicsElement { WEB_PLATFORM_OBJECT(SVGGeometryElement, SVGGraphicsElement); public: - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; virtual Gfx::Path get_path(CSSPixelSize viewport_size) = 0; diff --git a/Libraries/LibWeb/SVG/SVGImageElement.cpp b/Libraries/LibWeb/SVG/SVGImageElement.cpp index a3f2d6d6743..effd7a5b44b 100644 --- a/Libraries/LibWeb/SVG/SVGImageElement.cpp +++ b/Libraries/LibWeb/SVG/SVGImageElement.cpp @@ -179,7 +179,7 @@ void SVGImageElement::fetch_the_document(URL::URL const& url) } } -GC::Ptr SVGImageElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGImageElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGImageElement.h b/Libraries/LibWeb/SVG/SVGImageElement.h index 52c8eb4c607..aa3b6c0ce5a 100644 --- a/Libraries/LibWeb/SVG/SVGImageElement.h +++ b/Libraries/LibWeb/SVG/SVGImageElement.h @@ -48,7 +48,7 @@ protected: void fetch_the_document(URL::URL const& url); private: - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; void animate(); GC::Ptr m_x; diff --git a/Libraries/LibWeb/SVG/SVGMaskElement.cpp b/Libraries/LibWeb/SVG/SVGMaskElement.cpp index 7674e389419..59e3bba9822 100644 --- a/Libraries/LibWeb/SVG/SVGMaskElement.cpp +++ b/Libraries/LibWeb/SVG/SVGMaskElement.cpp @@ -27,7 +27,7 @@ void SVGMaskElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGMaskElement); } -GC::Ptr SVGMaskElement::create_layout_node(CSS::StyleProperties) +GC::Ptr SVGMaskElement::create_layout_node(CSS::ComputedProperties) { // Masks are handled as a special case in the TreeBuilder. return nullptr; diff --git a/Libraries/LibWeb/SVG/SVGMaskElement.h b/Libraries/LibWeb/SVG/SVGMaskElement.h index 6b4461ac4a5..f8ab653b3b5 100644 --- a/Libraries/LibWeb/SVG/SVGMaskElement.h +++ b/Libraries/LibWeb/SVG/SVGMaskElement.h @@ -38,7 +38,7 @@ public: virtual void attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value, Optional const& namespace_) override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; CSSPixelRect resolve_masking_area(CSSPixelRect const& mask_target) const; diff --git a/Libraries/LibWeb/SVG/SVGMetadataElement.cpp b/Libraries/LibWeb/SVG/SVGMetadataElement.cpp index fc4d1b8d187..22c5519d843 100644 --- a/Libraries/LibWeb/SVG/SVGMetadataElement.cpp +++ b/Libraries/LibWeb/SVG/SVGMetadataElement.cpp @@ -25,7 +25,7 @@ void SVGMetadataElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGMetadataElement); } -GC::Ptr SVGMetadataElement::create_layout_node(CSS::StyleProperties) +GC::Ptr SVGMetadataElement::create_layout_node(CSS::ComputedProperties) { return nullptr; } diff --git a/Libraries/LibWeb/SVG/SVGMetadataElement.h b/Libraries/LibWeb/SVG/SVGMetadataElement.h index 6a08126dcf1..76e8d28a400 100644 --- a/Libraries/LibWeb/SVG/SVGMetadataElement.h +++ b/Libraries/LibWeb/SVG/SVGMetadataElement.h @@ -20,7 +20,7 @@ private: virtual void initialize(JS::Realm&) override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; }; } diff --git a/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 9d94ab04efc..154157e2d61 100644 --- a/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -42,7 +42,7 @@ void SVGSVGElement::visit_edges(Visitor& visitor) visitor.visit(m_view_box_for_bindings); } -GC::Ptr SVGSVGElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGSVGElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGSVGElement.h b/Libraries/LibWeb/SVG/SVGSVGElement.h index 0aa2545a3ac..b07b3cbd53a 100644 --- a/Libraries/LibWeb/SVG/SVGSVGElement.h +++ b/Libraries/LibWeb/SVG/SVGSVGElement.h @@ -29,7 +29,7 @@ class SVGSVGElement final : public SVGGraphicsElement GC_DECLARE_ALLOCATOR(SVGSVGElement); public: - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; virtual void apply_presentational_hints(GC::Ref) const override; diff --git a/Libraries/LibWeb/SVG/SVGStopElement.cpp b/Libraries/LibWeb/SVG/SVGStopElement.cpp index d34d473bfdb..43296f6a3b7 100644 --- a/Libraries/LibWeb/SVG/SVGStopElement.cpp +++ b/Libraries/LibWeb/SVG/SVGStopElement.cpp @@ -6,8 +6,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/Libraries/LibWeb/SVG/SVGSymbolElement.cpp b/Libraries/LibWeb/SVG/SVGSymbolElement.cpp index 8545b129dcf..cfaa1a8c3c9 100644 --- a/Libraries/LibWeb/SVG/SVGSymbolElement.cpp +++ b/Libraries/LibWeb/SVG/SVGSymbolElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -75,7 +75,7 @@ bool SVGSymbolElement::is_direct_child_of_use_shadow_tree() const return is(host); } -GC::Ptr SVGSymbolElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGSymbolElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGSymbolElement.h b/Libraries/LibWeb/SVG/SVGSymbolElement.h index 1dcccb7176b..8405b26f7fb 100644 --- a/Libraries/LibWeb/SVG/SVGSymbolElement.h +++ b/Libraries/LibWeb/SVG/SVGSymbolElement.h @@ -36,7 +36,7 @@ private: virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; bool is_direct_child_of_use_shadow_tree() const; diff --git a/Libraries/LibWeb/SVG/SVGTSpanElement.cpp b/Libraries/LibWeb/SVG/SVGTSpanElement.cpp index 90e42ba2d8a..7d6661d2cf1 100644 --- a/Libraries/LibWeb/SVG/SVGTSpanElement.cpp +++ b/Libraries/LibWeb/SVG/SVGTSpanElement.cpp @@ -24,7 +24,7 @@ void SVGTSpanElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTSpanElement); } -GC::Ptr SVGTSpanElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGTSpanElement::create_layout_node(CSS::ComputedProperties style) { // Text must be within an SVG element. if (shadow_including_first_ancestor_of_type()) diff --git a/Libraries/LibWeb/SVG/SVGTSpanElement.h b/Libraries/LibWeb/SVG/SVGTSpanElement.h index 17eba7f85ea..a198005d6a4 100644 --- a/Libraries/LibWeb/SVG/SVGTSpanElement.h +++ b/Libraries/LibWeb/SVG/SVGTSpanElement.h @@ -17,7 +17,7 @@ class SVGTSpanElement : public SVGTextPositioningElement { GC_DECLARE_ALLOCATOR(SVGTSpanElement); public: - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; protected: SVGTSpanElement(DOM::Document&, DOM::QualifiedName); diff --git a/Libraries/LibWeb/SVG/SVGTextElement.cpp b/Libraries/LibWeb/SVG/SVGTextElement.cpp index 6bb9977e301..436c60e87b7 100644 --- a/Libraries/LibWeb/SVG/SVGTextElement.cpp +++ b/Libraries/LibWeb/SVG/SVGTextElement.cpp @@ -23,7 +23,7 @@ void SVGTextElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextElement); } -GC::Ptr SVGTextElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGTextElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGTextElement.h b/Libraries/LibWeb/SVG/SVGTextElement.h index 308f3ee1450..2f8d530e478 100644 --- a/Libraries/LibWeb/SVG/SVGTextElement.h +++ b/Libraries/LibWeb/SVG/SVGTextElement.h @@ -17,7 +17,7 @@ class SVGTextElement : public SVGTextPositioningElement { GC_DECLARE_ALLOCATOR(SVGTextElement); public: - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; protected: SVGTextElement(DOM::Document&, DOM::QualifiedName); diff --git a/Libraries/LibWeb/SVG/SVGTextPathElement.cpp b/Libraries/LibWeb/SVG/SVGTextPathElement.cpp index 383da7a3210..0ce93311d32 100644 --- a/Libraries/LibWeb/SVG/SVGTextPathElement.cpp +++ b/Libraries/LibWeb/SVG/SVGTextPathElement.cpp @@ -40,7 +40,7 @@ void SVGTextPathElement::visit_edges(Cell::Visitor& visitor) SVGURIReferenceMixin::visit_edges(visitor); } -GC::Ptr SVGTextPathElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGTextPathElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGTextPathElement.h b/Libraries/LibWeb/SVG/SVGTextPathElement.h index aa445fb81c1..d1f4882a122 100644 --- a/Libraries/LibWeb/SVG/SVGTextPathElement.h +++ b/Libraries/LibWeb/SVG/SVGTextPathElement.h @@ -20,7 +20,7 @@ class SVGTextPathElement GC_DECLARE_ALLOCATOR(SVGTextPathElement); public: - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; GC::Ptr path_or_shape() const; diff --git a/Libraries/LibWeb/SVG/SVGTitleElement.cpp b/Libraries/LibWeb/SVG/SVGTitleElement.cpp index 6522193b8b2..39713f5256b 100644 --- a/Libraries/LibWeb/SVG/SVGTitleElement.cpp +++ b/Libraries/LibWeb/SVG/SVGTitleElement.cpp @@ -25,7 +25,7 @@ void SVGTitleElement::initialize(JS::Realm& realm) WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTitleElement); } -GC::Ptr SVGTitleElement::create_layout_node(CSS::StyleProperties) +GC::Ptr SVGTitleElement::create_layout_node(CSS::ComputedProperties) { return nullptr; } diff --git a/Libraries/LibWeb/SVG/SVGTitleElement.h b/Libraries/LibWeb/SVG/SVGTitleElement.h index 619f21e1af5..3f12e9c5f98 100644 --- a/Libraries/LibWeb/SVG/SVGTitleElement.h +++ b/Libraries/LibWeb/SVG/SVGTitleElement.h @@ -19,7 +19,7 @@ private: virtual void initialize(JS::Realm&) override; - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; virtual void children_changed() override; }; diff --git a/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Libraries/LibWeb/SVG/SVGUseElement.cpp index 0528df5e2a4..659b851e2d9 100644 --- a/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -235,7 +235,7 @@ GC::Ptr SVGUseElement::animated_instance_root() const return instance_root(); } -GC::Ptr SVGUseElement::create_layout_node(CSS::StyleProperties style) +GC::Ptr SVGUseElement::create_layout_node(CSS::ComputedProperties style) { return heap().allocate(document(), *this, move(style)); } diff --git a/Libraries/LibWeb/SVG/SVGUseElement.h b/Libraries/LibWeb/SVG/SVGUseElement.h index aba94b12ced..7f2d58ac794 100644 --- a/Libraries/LibWeb/SVG/SVGUseElement.h +++ b/Libraries/LibWeb/SVG/SVGUseElement.h @@ -48,7 +48,7 @@ private: virtual bool is_svg_use_element() const override { return true; } - virtual GC::Ptr create_layout_node(CSS::StyleProperties) override; + virtual GC::Ptr create_layout_node(CSS::ComputedProperties) override; void process_the_url(Optional const& href); diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/CSS/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibWeb/CSS/BUILD.gn index 11d7d1c33da..f7ff7dae282 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/CSS/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/CSS/BUILD.gn @@ -33,6 +33,7 @@ source_set("CSS") { "CSSTransition.cpp", "CalculatedOr.cpp", "Clip.cpp", + "ComputedProperties.cpp", "CountersSet.cpp", "Display.cpp", "EdgeRect.cpp", @@ -66,7 +67,6 @@ source_set("CSS") { "Sizing.cpp", "StyleComputer.cpp", "StyleInvalidation.cpp", - "StyleProperties.cpp", "StyleProperty.cpp", "StyleSheet.cpp", "StyleSheetIdentifier.cpp", diff --git a/Services/WebContent/ConnectionFromClient.cpp b/Services/WebContent/ConnectionFromClient.cpp index 03944c68bc6..a1f8ea7a5b4 100644 --- a/Services/WebContent/ConnectionFromClient.cpp +++ b/Services/WebContent/ConnectionFromClient.cpp @@ -352,7 +352,7 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString const& request, if (element->is_element()) { auto styles = doc->style_computer().compute_style(*static_cast(element)); dbgln("+ Element {}", element->debug_description()); - for (size_t i = 0; i < Web::CSS::StyleProperties::number_of_properties; ++i) { + for (size_t i = 0; i < Web::CSS::ComputedProperties::number_of_properties; ++i) { auto property = styles.maybe_null_property(static_cast(i)); dbgln("| {} = {}", Web::CSS::string_from_property_id(static_cast(i)), property ? property->to_string(Web::CSS::CSSStyleValue::SerializationMode::Normal) : ""_string); } @@ -511,7 +511,7 @@ void ConnectionFromClient::inspect_dom_node(u64 page_id, Web::UniqueNodeID const return; } - auto serialize_json = [](Web::CSS::StyleProperties const& properties) -> ByteString { + auto serialize_json = [](Web::CSS::ComputedProperties const& properties) -> ByteString { StringBuilder builder; auto serializer = MUST(JsonObjectSerializer<>::try_create(builder)); @@ -591,7 +591,7 @@ void ConnectionFromClient::inspect_dom_node(u64 page_id, Web::UniqueNodeID const return builder.to_byte_string(); }; - auto serialize_fonts_json = [](Web::CSS::StyleProperties const& properties) -> ByteString { + auto serialize_fonts_json = [](Web::CSS::ComputedProperties const& properties) -> ByteString { StringBuilder builder; auto serializer = MUST(JsonArraySerializer<>::try_create(builder)); diff --git a/Services/WebContent/WebDriverConnection.cpp b/Services/WebContent/WebDriverConnection.cpp index 23783cfdba5..e549fb5c035 100644 --- a/Services/WebContent/WebDriverConnection.cpp +++ b/Services/WebContent/WebDriverConnection.cpp @@ -16,8 +16,8 @@ #include #include #include +#include #include -#include #include #include #include