From 4e92ab52e33f8b26624e708058d63bc1bd62dea5 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 8 Aug 2025 10:28:41 +0100 Subject: [PATCH] LibWeb/CSS: Rename CSSKeywordValue -> KeywordStyleValue The typed-om CSSKeywordValue will need to be a separate class. --- Documentation/CSSGeneratedFiles.md | 2 +- Libraries/LibWeb/Animations/Animatable.cpp | 2 +- .../LibWeb/Animations/KeyframeEffect.cpp | 2 +- Libraries/LibWeb/CMakeLists.txt | 2 +- Libraries/LibWeb/CSS/CSSStyleProperties.cpp | 22 +++++----- Libraries/LibWeb/CSS/ComputedProperties.cpp | 2 +- Libraries/LibWeb/CSS/FontFaceSet.cpp | 2 +- Libraries/LibWeb/CSS/Interpolation.cpp | 6 +-- Libraries/LibWeb/CSS/ParsedFontFace.cpp | 2 +- .../LibWeb/CSS/Parser/DescriptorParsing.cpp | 2 +- .../LibWeb/CSS/Parser/PropertyParsing.cpp | 44 +++++++++---------- Libraries/LibWeb/CSS/Parser/RuleParsing.cpp | 2 +- Libraries/LibWeb/CSS/Parser/SyntaxParsing.cpp | 4 +- Libraries/LibWeb/CSS/Parser/ValueParsing.cpp | 20 ++++----- Libraries/LibWeb/CSS/StyleComputer.cpp | 36 +++++++-------- Libraries/LibWeb/CSS/StyleInvalidation.cpp | 2 +- .../LibWeb/CSS/StyleValues/CSSColorValue.cpp | 2 +- .../LibWeb/CSS/StyleValues/CSSLCHLike.cpp | 2 +- Libraries/LibWeb/CSS/StyleValues/CSSRGB.cpp | 2 +- ...KeywordValue.cpp => KeywordStyleValue.cpp} | 12 ++--- ...{CSSKeywordValue.h => KeywordStyleValue.h} | 26 +++++------ .../CSS/StyleValues/ShadowStyleValue.cpp | 4 +- .../CSS/StyleValues/ShorthandStyleValue.cpp | 2 +- .../LibWeb/CSS/StyleValues/StyleValue.cpp | 2 +- Libraries/LibWeb/CSS/StyleValues/StyleValue.h | 2 +- Libraries/LibWeb/DOM/Element.cpp | 4 +- Libraries/LibWeb/Editing/Commands.cpp | 2 +- .../LibWeb/Editing/Internal/Algorithms.cpp | 2 +- Libraries/LibWeb/Forward.h | 2 +- .../LibWeb/Geometry/DOMMatrixReadOnly.cpp | 2 +- Libraries/LibWeb/HTML/HTMLCanvasElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLDivElement.cpp | 10 ++--- Libraries/LibWeb/HTML/HTMLEmbedElement.cpp | 6 +-- Libraries/LibWeb/HTML/HTMLHRElement.cpp | 18 ++++---- Libraries/LibWeb/HTML/HTMLHeadingElement.cpp | 10 ++--- Libraries/LibWeb/HTML/HTMLImageElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLInputElement.cpp | 10 ++--- Libraries/LibWeb/HTML/HTMLLIElement.cpp | 20 ++++----- Libraries/LibWeb/HTML/HTMLOListElement.cpp | 12 ++--- Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 8 ++-- .../LibWeb/HTML/HTMLParagraphElement.cpp | 10 ++--- Libraries/LibWeb/HTML/HTMLPreElement.cpp | 4 +- Libraries/LibWeb/HTML/HTMLProgressElement.cpp | 2 +- .../LibWeb/HTML/HTMLTableCaptionElement.cpp | 4 +- .../LibWeb/HTML/HTMLTableCellElement.cpp | 12 ++--- Libraries/LibWeb/HTML/HTMLTableElement.cpp | 8 ++-- Libraries/LibWeb/HTML/HTMLTableRowElement.cpp | 2 +- Libraries/LibWeb/HTML/HTMLUListElement.cpp | 10 ++--- Libraries/LibWeb/Layout/Node.cpp | 2 +- Libraries/LibWeb/Painting/BorderPainting.cpp | 4 +- Libraries/LibWeb/SVG/SVGSymbolElement.cpp | 2 +- 51 files changed, 189 insertions(+), 191 deletions(-) rename Libraries/LibWeb/CSS/StyleValues/{CSSKeywordValue.cpp => KeywordStyleValue.cpp} (97%) rename Libraries/LibWeb/CSS/StyleValues/{CSSKeywordValue.h => KeywordStyleValue.h} (50%) diff --git a/Documentation/CSSGeneratedFiles.md b/Documentation/CSSGeneratedFiles.md index d9af3ab9c7c..5ba03fc726d 100644 --- a/Documentation/CSSGeneratedFiles.md +++ b/Documentation/CSSGeneratedFiles.md @@ -159,7 +159,7 @@ This generates `Keyword.h` and `Keyword.cpp`. All keyword values used by any property or media-feature need to be defined here. The generated code provides: -- A `Keyword` enum as used by `CSSKeywordValue` +- A `Keyword` enum as used by `KeywordStyleValue` - `Optional keyword_from_string(StringView)` to attempt to convert a string into a Keyword - `StringView string_from_keyword(Keyword)` to convert a Keyword back into a string - `bool is_css_wide_keyword(StringView)` which returns whether the string is one of the special "CSS-wide keywords" diff --git a/Libraries/LibWeb/Animations/Animatable.cpp b/Libraries/LibWeb/Animations/Animatable.cpp index c0371dd1b76..31630b6b272 100644 --- a/Libraries/LibWeb/Animations/Animatable.cpp +++ b/Libraries/LibWeb/Animations/Animatable.cpp @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Libraries/LibWeb/Animations/KeyframeEffect.cpp index 111b69f1f27..26c550836d6 100644 --- a/Libraries/LibWeb/Animations/KeyframeEffect.cpp +++ b/Libraries/LibWeb/Animations/KeyframeEffect.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index f2b40de20c4..22a352a8f23 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -203,7 +203,6 @@ set(SOURCES CSS/StyleValues/CSSColorValue.cpp CSS/StyleValues/CSSHSL.cpp CSS/StyleValues/CSSHWB.cpp - CSS/StyleValues/CSSKeywordValue.cpp CSS/StyleValues/CSSLabLike.cpp CSS/StyleValues/CSSLCHLike.cpp CSS/StyleValues/CSSLightDark.cpp @@ -221,6 +220,7 @@ set(SOURCES CSS/StyleValues/GridTrackSizeListStyleValue.cpp CSS/StyleValues/ImageStyleValue.cpp CSS/StyleValues/IntegerStyleValue.cpp + CSS/StyleValues/KeywordStyleValue.cpp CSS/StyleValues/LengthStyleValue.cpp CSS/StyleValues/LinearGradientStyleValue.cpp CSS/StyleValues/MathDepthStyleValue.cpp diff --git a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp index 74af148849d..bbeae4127f4 100644 --- a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp +++ b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp @@ -12,9 +12,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -328,7 +328,7 @@ WebIDL::ExceptionOr CSSStyleProperties::set_property(PropertyID property_i static NonnullRefPtr style_value_for_length_percentage(LengthPercentage const& length_percentage) { if (length_percentage.is_auto()) - return CSSKeywordValue::create(Keyword::Auto); + return KeywordStyleValue::create(Keyword::Auto); if (length_percentage.is_percentage()) return PercentageStyleValue::create(length_percentage.percentage()); if (length_percentage.is_length()) @@ -339,19 +339,19 @@ static NonnullRefPtr style_value_for_length_percentage(LengthP static NonnullRefPtr style_value_for_size(Size const& size) { if (size.is_none()) - return CSSKeywordValue::create(Keyword::None); + return KeywordStyleValue::create(Keyword::None); if (size.is_percentage()) return PercentageStyleValue::create(size.percentage()); if (size.is_length()) return LengthStyleValue::create(size.length()); if (size.is_auto()) - return CSSKeywordValue::create(Keyword::Auto); + return KeywordStyleValue::create(Keyword::Auto); if (size.is_calculated()) return size.calculated(); if (size.is_min_content()) - return CSSKeywordValue::create(Keyword::MinContent); + return KeywordStyleValue::create(Keyword::MinContent); if (size.is_max_content()) - return CSSKeywordValue::create(Keyword::MaxContent); + return KeywordStyleValue::create(Keyword::MaxContent); if (size.is_fit_content()) return FitContentStyleValue::create(size.fit_content_available_space()); TODO(); @@ -360,7 +360,7 @@ static NonnullRefPtr style_value_for_size(Size const& size) static RefPtr style_value_for_shadow(Vector const& shadow_data) { if (shadow_data.is_empty()) - return CSSKeywordValue::create(Keyword::None); + return KeywordStyleValue::create(Keyword::None); auto make_shadow_style_value = [](ShadowData const& shadow) { return ShadowStyleValue::create( @@ -698,7 +698,7 @@ RefPtr CSSStyleProperties::style_value_for_computed_property(L case PropertyID::Transform: { auto transformations = layout_node.computed_values().transformations(); if (transformations.is_empty()) - return CSSKeywordValue::create(Keyword::None); + return KeywordStyleValue::create(Keyword::None); // https://drafts.csswg.org/css-transforms-2/#serialization-of-the-computed-value // The transform property is a resolved value special case property. [CSSOM] @@ -800,9 +800,9 @@ RefPtr CSSStyleProperties::style_value_for_computed_property(L auto const& contain = layout_node.computed_values().contain(); if (contain.layout_containment && contain.style_containment && contain.paint_containment) { if (contain.size_containment) - return CSSKeywordValue::create(Keyword::Strict); + return KeywordStyleValue::create(Keyword::Strict); if (!contain.inline_size_containment) - return CSSKeywordValue::create(Keyword::Content); + return KeywordStyleValue::create(Keyword::Content); } return get_computed_value(property_id); @@ -834,7 +834,7 @@ RefPtr CSSStyleProperties::style_value_for_computed_property(L case PropertyID::WebkitTextFillColor: return resolve_color_style_value(get_computed_value(property_id), layout_node.computed_values().webkit_text_fill_color()); case PropertyID::Invalid: - return CSSKeywordValue::create(Keyword::Invalid); + return KeywordStyleValue::create(Keyword::Invalid); case PropertyID::Custom: dbgln_if(LIBWEB_CSS_DEBUG, "Computed style for custom properties was requested (?)"); return nullptr; diff --git a/Libraries/LibWeb/CSS/ComputedProperties.cpp b/Libraries/LibWeb/CSS/ComputedProperties.cpp index 9399b7a1fe5..b2b4b94b009 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.cpp +++ b/Libraries/LibWeb/CSS/ComputedProperties.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/Libraries/LibWeb/CSS/FontFaceSet.cpp b/Libraries/LibWeb/CSS/FontFaceSet.cpp index 6b27c2fe2ff..573c0026a62 100644 --- a/Libraries/LibWeb/CSS/FontFaceSet.cpp +++ b/Libraries/LibWeb/CSS/FontFaceSet.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/CSS/Interpolation.cpp b/Libraries/LibWeb/CSS/Interpolation.cpp index b46e2a4f4f9..62b0eba89e5 100644 --- a/Libraries/LibWeb/CSS/Interpolation.cpp +++ b/Libraries/LibWeb/CSS/Interpolation.cpp @@ -15,11 +15,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -503,7 +503,7 @@ ValueComparingRefPtr interpolate_property(DOM::Element& elemen return from; if (delta >= 1) return to; - return CSSKeywordValue::create(Keyword::Visible); + return KeywordStyleValue::create(Keyword::Visible); } return interpolate_discrete(from, to, delta, allow_discrete); @@ -1135,7 +1135,7 @@ static RefPtr interpolate_value_impl(DOM::Element& element, Ca case StyleValue::Type::FontStyle: { auto const& from_font_style = from.as_font_style(); auto const& to_font_style = to.as_font_style(); - auto interpolated_font_style = interpolate_value(element, calculation_context, CSSKeywordValue::create(to_keyword(from_font_style.font_style())), CSSKeywordValue::create(to_keyword(to_font_style.font_style())), delta, allow_discrete); + auto interpolated_font_style = interpolate_value(element, calculation_context, KeywordStyleValue::create(to_keyword(from_font_style.font_style())), KeywordStyleValue::create(to_keyword(to_font_style.font_style())), delta, allow_discrete); if (!interpolated_font_style) return {}; if (from_font_style.angle() && to_font_style.angle()) { diff --git a/Libraries/LibWeb/CSS/ParsedFontFace.cpp b/Libraries/LibWeb/CSS/ParsedFontFace.cpp index 0b64a3d879e..2170c806205 100644 --- a/Libraries/LibWeb/CSS/ParsedFontFace.cpp +++ b/Libraries/LibWeb/CSS/ParsedFontFace.cpp @@ -8,11 +8,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/Libraries/LibWeb/CSS/Parser/DescriptorParsing.cpp b/Libraries/LibWeb/CSS/Parser/DescriptorParsing.cpp index fcbd00b1624..f3e650fb7d0 100644 --- a/Libraries/LibWeb/CSS/Parser/DescriptorParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/DescriptorParsing.cpp @@ -6,8 +6,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index 3d390ad8d35..ee70c161468 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -42,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -142,8 +142,8 @@ Optional Parser::parse_css_value_for_properties(Readon if (auto property = any_property_accepts_keyword(property_ids, keyword.value()); property.has_value()) { tokens.discard_a_token(); if (auto resolved_keyword = resolve_legacy_value_alias(property.value(), keyword.value()); resolved_keyword.has_value()) - return PropertyAndValue { *property, CSSKeywordValue::create(resolved_keyword.value()) }; - return PropertyAndValue { *property, CSSKeywordValue::create(keyword.value()) }; + return PropertyAndValue { *property, KeywordStyleValue::create(resolved_keyword.value()) }; + return PropertyAndValue { *property, KeywordStyleValue::create(keyword.value()) }; } } @@ -1948,15 +1948,15 @@ RefPtr Parser::parse_columns_value(TokenStream return nullptr; if (found_autos == 2) { - column_count = CSSKeywordValue::create(Keyword::Auto); - column_width = CSSKeywordValue::create(Keyword::Auto); + column_count = KeywordStyleValue::create(Keyword::Auto); + column_width = KeywordStyleValue::create(Keyword::Auto); } if (found_autos == 1) { if (!column_count) - column_count = CSSKeywordValue::create(Keyword::Auto); + column_count = KeywordStyleValue::create(Keyword::Auto); if (!column_width) - column_width = CSSKeywordValue::create(Keyword::Auto); + column_width = KeywordStyleValue::create(Keyword::Auto); } if (!column_count) @@ -2441,7 +2441,7 @@ RefPtr Parser::parse_flex_shorthand_value(TokenStreamis_keyword() && value->to_keyword() == Keyword::None) { auto zero = NumberStyleValue::create(0); - return make_flex_shorthand(zero, zero, CSSKeywordValue::create(Keyword::Auto)); + return make_flex_shorthand(zero, zero, KeywordStyleValue::create(Keyword::Auto)); } break; } @@ -2585,7 +2585,7 @@ RefPtr Parser::parse_font_value(TokenStream& t PropertyID::FontVariantPosition }, { property_initial_value(PropertyID::FontVariantAlternates), - CSSKeywordValue::create(Keyword::SmallCaps), + KeywordStyleValue::create(Keyword::SmallCaps), property_initial_value(PropertyID::FontVariantEastAsian), property_initial_value(PropertyID::FontVariantEmoji), property_initial_value(PropertyID::FontVariantLigatures), @@ -2675,7 +2675,7 @@ RefPtr Parser::parse_font_value(TokenStream& t line_height = property_initial_value(PropertyID::LineHeight); transaction.commit(); - auto initial_value = CSSKeywordValue::create(Keyword::Initial); + auto initial_value = KeywordStyleValue::create(Keyword::Initial); return ShorthandStyleValue::create(PropertyID::Font, { // Set explicitly https://drafts.csswg.org/css-fonts/#set-explicitly @@ -2730,7 +2730,7 @@ RefPtr Parser::parse_font_family_value(TokenStream Parser::parse_font_variant(TokenStream& } } - auto normal_value = CSSKeywordValue::create(Keyword::Normal); + auto normal_value = KeywordStyleValue::create(Keyword::Normal); auto resolve_list = [&normal_value](StyleValueVector values) -> NonnullRefPtr { if (values.is_empty()) return normal_value; @@ -3506,14 +3506,14 @@ RefPtr Parser::parse_list_style_value(TokenStream Parser::parse_transform_value(TokenStream Parser::parse_transform_origin_value(TokenStreamaxis) { case Axis::None: case Axis::X: - return make_list(single_value->offset, CSSKeywordValue::create(Keyword::Center), zero_value); + return make_list(single_value->offset, KeywordStyleValue::create(Keyword::Center), zero_value); case Axis::Y: - return make_list(CSSKeywordValue::create(Keyword::Center), single_value->offset, zero_value); + return make_list(KeywordStyleValue::create(Keyword::Center), single_value->offset, zero_value); } VERIFY_NOT_REACHED(); } @@ -4529,7 +4529,7 @@ RefPtr Parser::parse_transition_value(TokenStream Parser::parse_white_space_shorthand(TokenStream || <'text-wrap-mode'> || <'white-space-trim'> RefPtr white_space_collapse; diff --git a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp index d7ee190f8b7..3c893d9040f 100644 --- a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp @@ -33,9 +33,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/Libraries/LibWeb/CSS/Parser/SyntaxParsing.cpp b/Libraries/LibWeb/CSS/Parser/SyntaxParsing.cpp index 255e56f9aeb..9539284fc8e 100644 --- a/Libraries/LibWeb/CSS/Parser/SyntaxParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/SyntaxParsing.cpp @@ -11,9 +11,9 @@ #include #include #include -#include #include #include +#include #include #include @@ -236,7 +236,7 @@ RefPtr Parser::parse_according_to_syntax_node(TokenStream #include #include -#include #include #include #include @@ -52,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -824,7 +824,7 @@ RefPtr Parser::parse_number_percentage_none_value(TokenStream< if (tokens.next_token().is_ident("none"sv)) { tokens.discard_a_token(); // keyword none - return CSSKeywordValue::create(Keyword::None); + return KeywordStyleValue::create(Keyword::None); } return nullptr; @@ -1334,7 +1334,7 @@ RefPtr Parser::parse_keyword_value(TokenStream auto keyword = keyword_from_string(peek_token.token().ident()); if (keyword.has_value()) { tokens.discard_a_token(); // ident - return CSSKeywordValue::create(keyword.value()); + return KeywordStyleValue::create(keyword.value()); } } @@ -1436,7 +1436,7 @@ RefPtr Parser::parse_hue_none_value(TokenStream Parser::parse_paint_value(TokenStream& switch (*maybe_keyword) { case Keyword::None: tokens.discard_a_token(); - return CSSKeywordValue::create(*maybe_keyword); + return KeywordStyleValue::create(*maybe_keyword); default: return nullptr; } @@ -3485,23 +3485,23 @@ RefPtr Parser::parse_builtin_value(TokenStream auto ident = component_value.token().ident(); if (ident.equals_ignoring_ascii_case("inherit"sv)) { transaction.commit(); - return CSSKeywordValue::create(Keyword::Inherit); + return KeywordStyleValue::create(Keyword::Inherit); } if (ident.equals_ignoring_ascii_case("initial"sv)) { transaction.commit(); - return CSSKeywordValue::create(Keyword::Initial); + return KeywordStyleValue::create(Keyword::Initial); } if (ident.equals_ignoring_ascii_case("unset"sv)) { transaction.commit(); - return CSSKeywordValue::create(Keyword::Unset); + return KeywordStyleValue::create(Keyword::Unset); } if (ident.equals_ignoring_ascii_case("revert"sv)) { transaction.commit(); - return CSSKeywordValue::create(Keyword::Revert); + return KeywordStyleValue::create(Keyword::Revert); } if (ident.equals_ignoring_ascii_case("revert-layer"sv)) { transaction.commit(); - return CSSKeywordValue::create(Keyword::RevertLayer); + return KeywordStyleValue::create(Keyword::RevertLayer); } } diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 73716b68682..6cd1b1f2dca 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -58,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -835,11 +835,11 @@ void StyleComputer::for_each_property_expanding_shorthands(PropertyID property_i if (property_id == CSS::PropertyID::Transition) { if (value.to_keyword() == Keyword::None) { // Handle `none` as a shorthand for `all 0s ease 0s`. - set_longhand_property(CSS::PropertyID::TransitionProperty, CSSKeywordValue::create(Keyword::All)); + set_longhand_property(CSS::PropertyID::TransitionProperty, KeywordStyleValue::create(Keyword::All)); set_longhand_property(CSS::PropertyID::TransitionDuration, TimeStyleValue::create(CSS::Time::make_seconds(0))); set_longhand_property(CSS::PropertyID::TransitionDelay, TimeStyleValue::create(CSS::Time::make_seconds(0))); set_longhand_property(CSS::PropertyID::TransitionTimingFunction, EasingStyleValue::create(EasingStyleValue::CubicBezier::ease())); - set_longhand_property(CSS::PropertyID::TransitionBehavior, CSSKeywordValue::create(Keyword::Normal)); + set_longhand_property(CSS::PropertyID::TransitionBehavior, KeywordStyleValue::create(Keyword::Normal)); } else if (value.is_transition()) { auto const& transitions = value.as_transition().transitions(); Array>, 5> transition_values; @@ -849,7 +849,7 @@ void StyleComputer::for_each_property_expanding_shorthands(PropertyID property_i transition_values[2].append(transition.delay.as_style_value()); if (transition.easing) transition_values[3].append(*transition.easing); - transition_values[4].append(CSSKeywordValue::create(to_keyword(transition.transition_behavior))); + transition_values[4].append(KeywordStyleValue::create(to_keyword(transition.transition_behavior))); } set_longhand_property(CSS::PropertyID::TransitionProperty, StyleValueList::create(move(transition_values[0]), StyleValueList::Separator::Comma)); @@ -932,7 +932,7 @@ void StyleComputer::cascade_declarations( else { // Either the property’s inherited value or its initial value depending on whether the property is // inherited or not, respectively, as if the property’s value had been specified as the unset keyword. - property_value = CSSKeywordValue::create(Keyword::Unset); + property_value = KeywordStyleValue::create(Keyword::Unset); } } @@ -1188,7 +1188,7 @@ void StyleComputer::collect_animation_into(DOM::Element& element, Optional {} is invalid", string_from_property_id(it.key), progress_in_keyframe, start->to_string(SerializationMode::Normal), end->to_string(SerializationMode::Normal)); - computed_properties.set_animated_property(PropertyID::Visibility, CSSKeywordValue::create(Keyword::Hidden)); + computed_properties.set_animated_property(PropertyID::Visibility, KeywordStyleValue::create(Keyword::Hidden)); } } } @@ -1383,7 +1383,7 @@ static void compute_transitioned_properties(ComputedProperties const& style, DOM [] { return EasingStyleValue::create(EasingStyleValue::CubicBezier::ease()); }); auto transition_behaviors = normalize_transition_length_list( PropertyID::TransitionBehavior, - [] { return CSSKeywordValue::create(Keyword::None); }); + [] { return KeywordStyleValue::create(Keyword::None); }); element.add_transitioned_properties(pseudo_element, move(properties), move(delays), move(durations), move(timing_functions), move(transition_behaviors)); } @@ -2280,13 +2280,13 @@ void StyleComputer::resolve_effective_overflow_values(ComputedProperties& style) auto overflow_y_is_visible_or_clip = overflow_y == Overflow::Visible || overflow_y == Overflow::Clip; if (!overflow_x_is_visible_or_clip || !overflow_y_is_visible_or_clip) { if (overflow_x == CSS::Overflow::Visible) - style.set_property(CSS::PropertyID::OverflowX, CSSKeywordValue::create(Keyword::Auto)); + style.set_property(CSS::PropertyID::OverflowX, KeywordStyleValue::create(Keyword::Auto)); if (overflow_x == CSS::Overflow::Clip) - style.set_property(CSS::PropertyID::OverflowX, CSSKeywordValue::create(Keyword::Hidden)); + style.set_property(CSS::PropertyID::OverflowX, KeywordStyleValue::create(Keyword::Hidden)); if (overflow_y == CSS::Overflow::Visible) - style.set_property(CSS::PropertyID::OverflowY, CSSKeywordValue::create(Keyword::Auto)); + style.set_property(CSS::PropertyID::OverflowY, KeywordStyleValue::create(Keyword::Auto)); if (overflow_y == CSS::Overflow::Clip) - style.set_property(CSS::PropertyID::OverflowY, CSSKeywordValue::create(Keyword::Hidden)); + style.set_property(CSS::PropertyID::OverflowY, KeywordStyleValue::create(Keyword::Hidden)); } } @@ -2311,17 +2311,17 @@ static void compute_text_align(ComputedProperties& style, DOM::Element const& el switch (parent_text_align.to_keyword()) { case Keyword::Start: if (parent_direction == Direction::Ltr) { - style.set_property(PropertyID::TextAlign, CSSKeywordValue::create(Keyword::Left)); + style.set_property(PropertyID::TextAlign, KeywordStyleValue::create(Keyword::Left)); } else { - style.set_property(PropertyID::TextAlign, CSSKeywordValue::create(Keyword::Right)); + style.set_property(PropertyID::TextAlign, KeywordStyleValue::create(Keyword::Right)); } break; case Keyword::End: if (parent_direction == Direction::Ltr) { - style.set_property(PropertyID::TextAlign, CSSKeywordValue::create(Keyword::Right)); + style.set_property(PropertyID::TextAlign, KeywordStyleValue::create(Keyword::Right)); } else { - style.set_property(PropertyID::TextAlign, CSSKeywordValue::create(Keyword::Left)); + style.set_property(PropertyID::TextAlign, KeywordStyleValue::create(Keyword::Left)); } break; @@ -2329,7 +2329,7 @@ static void compute_text_align(ComputedProperties& style, DOM::Element const& el style.set_property(PropertyID::TextAlign, parent_text_align); } } else { - style.set_property(PropertyID::TextAlign, CSSKeywordValue::create(Keyword::Start)); + style.set_property(PropertyID::TextAlign, KeywordStyleValue::create(Keyword::Start)); } } } @@ -2677,9 +2677,9 @@ GC::Ref StyleComputer::compute_properties(DOM::Element& elem if (value->is_unset()) { if (is_inherited_property(property_id)) - value = CSSKeywordValue::create(Keyword::Inherit); + value = KeywordStyleValue::create(Keyword::Inherit); else - value = CSSKeywordValue::create(Keyword::Initial); + value = KeywordStyleValue::create(Keyword::Initial); } computed_style->set_property(property_id, value.release_nonnull(), inherited); diff --git a/Libraries/LibWeb/CSS/StyleInvalidation.cpp b/Libraries/LibWeb/CSS/StyleInvalidation.cpp index e8a007a1f8a..3fc9defa209 100644 --- a/Libraries/LibWeb/CSS/StyleInvalidation.cpp +++ b/Libraries/LibWeb/CSS/StyleInvalidation.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include namespace Web::CSS { diff --git a/Libraries/LibWeb/CSS/StyleValues/CSSColorValue.cpp b/Libraries/LibWeb/CSS/StyleValues/CSSColorValue.cpp index b6a63b076d0..e13fe465678 100644 --- a/Libraries/LibWeb/CSS/StyleValues/CSSColorValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/CSSColorValue.cpp @@ -11,9 +11,9 @@ #include #include #include -#include #include #include +#include #include #include diff --git a/Libraries/LibWeb/CSS/StyleValues/CSSLCHLike.cpp b/Libraries/LibWeb/CSS/StyleValues/CSSLCHLike.cpp index 26273ca3f3f..217157ef9de 100644 --- a/Libraries/LibWeb/CSS/StyleValues/CSSLCHLike.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/CSSLCHLike.cpp @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/Libraries/LibWeb/CSS/StyleValues/CSSRGB.cpp b/Libraries/LibWeb/CSS/StyleValues/CSSRGB.cpp index 8006a00e2fc..147667d362d 100644 --- a/Libraries/LibWeb/CSS/StyleValues/CSSRGB.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/CSSRGB.cpp @@ -7,8 +7,8 @@ #include "CSSRGB.h" #include #include -#include #include +#include #include #include diff --git a/Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.cpp b/Libraries/LibWeb/CSS/StyleValues/KeywordStyleValue.cpp similarity index 97% rename from Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.cpp rename to Libraries/LibWeb/CSS/StyleValues/KeywordStyleValue.cpp index 950dae29bb3..3fa226a47e3 100644 --- a/Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/KeywordStyleValue.cpp @@ -7,7 +7,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include "CSSKeywordValue.h" +#include "KeywordStyleValue.h" #include #include #include @@ -16,12 +16,12 @@ namespace Web::CSS { -String CSSKeywordValue::to_string(SerializationMode) const +String KeywordStyleValue::to_string(SerializationMode) const { return MUST(String::from_utf8(string_from_keyword(keyword()))); } -bool CSSKeywordValue::is_color(Keyword keyword) +bool KeywordStyleValue::is_color(Keyword keyword) { switch (keyword) { case Keyword::Accentcolor: @@ -130,12 +130,12 @@ bool CSSKeywordValue::is_color(Keyword keyword) } } -bool CSSKeywordValue::has_color() const +bool KeywordStyleValue::has_color() const { return is_color(keyword()); } -Optional CSSKeywordValue::to_color(ColorResolutionContext color_resolution_context) const +Optional KeywordStyleValue::to_color(ColorResolutionContext color_resolution_context) const { if (keyword() == Keyword::Currentcolor) { return color_resolution_context.current_color.value_or(Color::Black); @@ -342,7 +342,7 @@ Optional CSSKeywordValue::to_color(ColorResolutionContext color_resolutio } } -Vector CSSKeywordValue::tokenize() const +Vector KeywordStyleValue::tokenize() const { return { Parser::Token::create_ident(FlyString::from_utf8_without_validation(string_from_keyword(m_keyword).bytes())) }; } diff --git a/Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.h b/Libraries/LibWeb/CSS/StyleValues/KeywordStyleValue.h similarity index 50% rename from Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.h rename to Libraries/LibWeb/CSS/StyleValues/KeywordStyleValue.h index 42f5194acff..f6b457428d5 100644 --- a/Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.h +++ b/Libraries/LibWeb/CSS/StyleValues/KeywordStyleValue.h @@ -14,38 +14,36 @@ namespace Web::CSS { -// https://drafts.css-houdini.org/css-typed-om-1/#csskeywordvalue -class CSSKeywordValue : public StyleValueWithDefaultOperators { +class KeywordStyleValue : public StyleValueWithDefaultOperators { public: - static ValueComparingNonnullRefPtr create(Keyword keyword) + static ValueComparingNonnullRefPtr create(Keyword keyword) { - // NOTE: We'll have to be much more careful with caching once we expose CSSKeywordValue to JS, as it's mutable. switch (keyword) { case Keyword::Inherit: { - static ValueComparingNonnullRefPtr const inherit_instance = adopt_ref(*new (nothrow) CSSKeywordValue(Keyword::Inherit)); + static ValueComparingNonnullRefPtr const inherit_instance = adopt_ref(*new (nothrow) KeywordStyleValue(Keyword::Inherit)); return inherit_instance; } case Keyword::Initial: { - static ValueComparingNonnullRefPtr const initial_instance = adopt_ref(*new (nothrow) CSSKeywordValue(Keyword::Initial)); + static ValueComparingNonnullRefPtr const initial_instance = adopt_ref(*new (nothrow) KeywordStyleValue(Keyword::Initial)); return initial_instance; } case Keyword::Revert: { - static ValueComparingNonnullRefPtr const revert_instance = adopt_ref(*new (nothrow) CSSKeywordValue(Keyword::Revert)); + static ValueComparingNonnullRefPtr const revert_instance = adopt_ref(*new (nothrow) KeywordStyleValue(Keyword::Revert)); return revert_instance; } case Keyword::RevertLayer: { - static ValueComparingNonnullRefPtr const revert_layer_instance = adopt_ref(*new (nothrow) CSSKeywordValue(Keyword::RevertLayer)); + static ValueComparingNonnullRefPtr const revert_layer_instance = adopt_ref(*new (nothrow) KeywordStyleValue(Keyword::RevertLayer)); return revert_layer_instance; } case Keyword::Unset: { - static ValueComparingNonnullRefPtr const unset_instance = adopt_ref(*new (nothrow) CSSKeywordValue(Keyword::Unset)); + static ValueComparingNonnullRefPtr const unset_instance = adopt_ref(*new (nothrow) KeywordStyleValue(Keyword::Unset)); return unset_instance; } default: - return adopt_ref(*new (nothrow) CSSKeywordValue(keyword)); + return adopt_ref(*new (nothrow) KeywordStyleValue(keyword)); } } - virtual ~CSSKeywordValue() override = default; + virtual ~KeywordStyleValue() override = default; Keyword keyword() const { return m_keyword; } @@ -55,10 +53,10 @@ public: virtual String to_string(SerializationMode) const override; virtual Vector tokenize() const override; - bool properties_equal(CSSKeywordValue const& other) const { return m_keyword == other.m_keyword; } + bool properties_equal(KeywordStyleValue const& other) const { return m_keyword == other.m_keyword; } private: - explicit CSSKeywordValue(Keyword keyword) + explicit KeywordStyleValue(Keyword keyword) : StyleValueWithDefaultOperators(Type::Keyword) , m_keyword(keyword) { @@ -70,7 +68,7 @@ private: inline Keyword StyleValue::to_keyword() const { if (is_keyword()) - return static_cast(*this).keyword(); + return static_cast(*this).keyword(); return Keyword::Invalid; } diff --git a/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp index 639360c36c8..4008bb4b38c 100644 --- a/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/ShadowStyleValue.cpp @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include @@ -42,7 +42,7 @@ String ShadowStyleValue::to_string(SerializationMode mode) const ValueComparingNonnullRefPtr ShadowStyleValue::color() const { if (!m_properties.color) - return CSSKeywordValue::create(Keyword::Currentcolor); + return KeywordStyleValue::create(Keyword::Currentcolor); return *m_properties.color; } diff --git a/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp index 0b858e9aacb..61db7a93184 100644 --- a/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/ShorthandStyleValue.cpp @@ -10,10 +10,10 @@ #include #include #include -#include #include #include #include +#include #include namespace Web::CSS { diff --git a/Libraries/LibWeb/CSS/StyleValues/StyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/StyleValue.cpp index 9aaed237095..32a39685406 100644 --- a/Libraries/LibWeb/CSS/StyleValues/StyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/StyleValue.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -45,6 +44,7 @@ #include #include #include +#include #include #include #include diff --git a/Libraries/LibWeb/CSS/StyleValues/StyleValue.h b/Libraries/LibWeb/CSS/StyleValues/StyleValue.h index 30c55ec67d7..53975d7fc9b 100644 --- a/Libraries/LibWeb/CSS/StyleValues/StyleValue.h +++ b/Libraries/LibWeb/CSS/StyleValues/StyleValue.h @@ -62,7 +62,7 @@ namespace Web::CSS { __ENUMERATE_CSS_STYLE_VALUE_TYPE(GuaranteedInvalid, guaranteed_invalid, GuaranteedInvalidStyleValue) \ __ENUMERATE_CSS_STYLE_VALUE_TYPE(Image, image, ImageStyleValue) \ __ENUMERATE_CSS_STYLE_VALUE_TYPE(Integer, integer, IntegerStyleValue) \ - __ENUMERATE_CSS_STYLE_VALUE_TYPE(Keyword, keyword, CSSKeywordValue) \ + __ENUMERATE_CSS_STYLE_VALUE_TYPE(Keyword, keyword, KeywordStyleValue) \ __ENUMERATE_CSS_STYLE_VALUE_TYPE(Length, length, LengthStyleValue) \ __ENUMERATE_CSS_STYLE_VALUE_TYPE(LinearGradient, linear_gradient, LinearGradientStyleValue) \ __ENUMERATE_CSS_STYLE_VALUE_TYPE(MathDepth, math_depth, MathDepthStyleValue) \ diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 2f1919e3449..a7dba0e8ece 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -706,7 +706,7 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_style(bool& did_cha if (is(*this)) { auto text_align = new_computed_properties->text_align(); if (text_align == CSS::TextAlign::LibwebLeft || text_align == CSS::TextAlign::LibwebCenter || text_align == CSS::TextAlign::LibwebRight) - new_computed_properties->set_property(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Start)); + new_computed_properties->set_property(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Start)); } bool had_list_marker = false; diff --git a/Libraries/LibWeb/Editing/Commands.cpp b/Libraries/LibWeb/Editing/Commands.cpp index cc2eebd1c51..1e7476b7c4f 100644 --- a/Libraries/LibWeb/Editing/Commands.cpp +++ b/Libraries/LibWeb/Editing/Commands.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include diff --git a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp index a9eb744dc00..e893c34a6c1 100644 --- a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp +++ b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp @@ -8,8 +8,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/Libraries/LibWeb/Forward.h b/Libraries/LibWeb/Forward.h index f9d7d6e0b70..c1cdc97e269 100644 --- a/Libraries/LibWeb/Forward.h +++ b/Libraries/LibWeb/Forward.h @@ -231,7 +231,6 @@ class CSSHWB; class CSSImportRule; class CSSKeyframeRule; class CSSKeyframesRule; -class CSSKeywordValue; class CSSLayerBlockRule; class CSSLayerStatementRule; class CSSMarginRule; @@ -286,6 +285,7 @@ class ImageStyleValue; class IntegerOrCalculated; class IntegerStyleValue; class InvalidationSet; +class KeywordStyleValue; class Length; class LengthBox; class LengthOrCalculated; diff --git a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp index 23ddc285c15..6105d9f7581 100644 --- a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp +++ b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index 0460d29387d..5c2ede4f833 100644 --- a/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -90,7 +90,7 @@ void HTMLCanvasElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::AspectRatio, CSS::StyleValueList::create(CSS::StyleValueVector { - CSS::CSSKeywordValue::create(CSS::Keyword::Auto), + CSS::KeywordStyleValue::create(CSS::Keyword::Auto), CSS::RatioStyleValue::create(CSS::Ratio { static_cast(w.value()), static_cast(h.value()) }) }, CSS::StyleValueList::Separator::Space)); diff --git a/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Libraries/LibWeb/HTML/HTMLDivElement.cpp index 3021da47925..66232d589dc 100644 --- a/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace Web::HTML { @@ -35,13 +35,13 @@ void HTMLDivElement::apply_presentational_hints(GC::Ref for_each_attribute([&](auto& name, auto& value) { if (name == HTML::AttributeNames::align) { if (value.equals_ignoring_ascii_case("left"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::LibwebLeft)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::LibwebLeft)); else if (value.equals_ignoring_ascii_case("right"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::LibwebRight)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::LibwebRight)); else if (value.equals_ignoring_ascii_case("center"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::LibwebCenter)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::LibwebCenter)); else if (value.equals_ignoring_ascii_case("justify"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Justify)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Justify)); } }); } diff --git a/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp b/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp index a7cc343a601..02ac24f25e9 100644 --- a/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp @@ -7,8 +7,8 @@ #include #include #include -#include #include +#include #include #include @@ -47,9 +47,9 @@ void HTMLEmbedElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Center)); else if (value.equals_ignoring_ascii_case("middle"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Middle)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Middle)); } else if (name == HTML::AttributeNames::height) { if (auto parsed_value = parse_dimension_value(value)) cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Height, *parsed_value); diff --git a/Libraries/LibWeb/HTML/HTMLHRElement.cpp b/Libraries/LibWeb/HTML/HTMLHRElement.cpp index dcfd9b05f40..e2fa20e6a07 100644 --- a/Libraries/LibWeb/HTML/HTMLHRElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLHRElement.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -44,22 +44,22 @@ void HTMLHRElement::apply_presentational_hints(GC::Ref for_each_attribute([&](auto& name, auto& value) { // https://html.spec.whatwg.org/multipage/rendering.html#the-hr-element-2 if (name == HTML::AttributeNames::color || name == HTML::AttributeNames::noshade) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderTopStyle, CSS::CSSKeywordValue::create(CSS::Keyword::Solid)); - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderRightStyle, CSS::CSSKeywordValue::create(CSS::Keyword::Solid)); - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderBottomStyle, CSS::CSSKeywordValue::create(CSS::Keyword::Solid)); - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderLeftStyle, CSS::CSSKeywordValue::create(CSS::Keyword::Solid)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderTopStyle, CSS::KeywordStyleValue::create(CSS::Keyword::Solid)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderRightStyle, CSS::KeywordStyleValue::create(CSS::Keyword::Solid)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderBottomStyle, CSS::KeywordStyleValue::create(CSS::Keyword::Solid)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderLeftStyle, CSS::KeywordStyleValue::create(CSS::Keyword::Solid)); } if (name == HTML::AttributeNames::align) { if (value.equals_ignoring_ascii_case("left"sv)) { cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginLeft, CSS::LengthStyleValue::create(CSS::Length::make_px(0))); - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginRight, CSS::CSSKeywordValue::create(CSS::Keyword::Auto)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginRight, CSS::KeywordStyleValue::create(CSS::Keyword::Auto)); } else if (value.equals_ignoring_ascii_case("right"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginLeft, CSS::CSSKeywordValue::create(CSS::Keyword::Auto)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginLeft, CSS::KeywordStyleValue::create(CSS::Keyword::Auto)); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginRight, CSS::LengthStyleValue::create(CSS::Length::make_px(0))); } else if (value.equals_ignoring_ascii_case("center"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginLeft, CSS::CSSKeywordValue::create(CSS::Keyword::Auto)); - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginRight, CSS::CSSKeywordValue::create(CSS::Keyword::Auto)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginLeft, CSS::KeywordStyleValue::create(CSS::Keyword::Auto)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginRight, CSS::KeywordStyleValue::create(CSS::Keyword::Auto)); } } diff --git a/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp index 3307ae7eff6..7d6442527e9 100644 --- a/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace Web::HTML { @@ -42,13 +42,13 @@ void HTMLHeadingElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Left)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Left)); else if (value == "right"sv) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Right)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Right)); else if (value == "center"sv) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Center)); else if (value == "justify"sv) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Justify)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Justify)); } }); } diff --git a/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Libraries/LibWeb/HTML/HTMLImageElement.cpp index 0760918749c..e4124141a0f 100644 --- a/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -125,7 +125,7 @@ void HTMLImageElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::BorderBottomWidth, width_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderLeftWidth, width_value); - auto solid_value = CSS::CSSKeywordValue::create(CSS::Keyword::Solid); + auto solid_value = CSS::KeywordStyleValue::create(CSS::Keyword::Solid); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderTopStyle, solid_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderRightStyle, solid_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderBottomStyle, solid_value); diff --git a/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 2127d3e7d56..faeba38080d 100644 --- a/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -19,8 +19,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -152,7 +152,7 @@ void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style) // FIXME: Instead of overriding line-height, we should set height here instead. if (current_line_height < minimum_line_height) - style.set_property(CSS::PropertyID::LineHeight, CSS::CSSKeywordValue::create(CSS::Keyword::Normal)); + style.set_property(CSS::PropertyID::LineHeight, CSS::KeywordStyleValue::create(CSS::Keyword::Normal)); } } @@ -1866,9 +1866,9 @@ void HTMLInputElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Center)); else if (value.equals_ignoring_ascii_case("middle"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Middle)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Middle)); } else if (name == HTML::AttributeNames::border) { if (auto parsed_value = parse_non_negative_integer(value); parsed_value.has_value()) { auto width_style_value = CSS::LengthStyleValue::create(CSS::Length::make_px(*parsed_value)); @@ -1877,7 +1877,7 @@ void HTMLInputElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::BorderBottomWidth, width_style_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderLeftWidth, width_style_value); - auto border_style_value = CSS::CSSKeywordValue::create(CSS::Keyword::Solid); + auto border_style_value = CSS::KeywordStyleValue::create(CSS::Keyword::Solid); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderTopStyle, border_style_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderRightStyle, border_style_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderBottomStyle, border_style_value); diff --git a/Libraries/LibWeb/HTML/HTMLLIElement.cpp b/Libraries/LibWeb/HTML/HTMLLIElement.cpp index 266e4794633..ea28d0b9ee6 100644 --- a/Libraries/LibWeb/HTML/HTMLLIElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLLIElement.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include @@ -65,23 +65,23 @@ void HTMLLIElement::apply_presentational_hints(GC::Ref for_each_attribute([&](auto& name, auto& value) { if (name == HTML::AttributeNames::type) { if (value == "1"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Decimal)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Decimal)); } else if (value == "a"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::LowerAlpha)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::LowerAlpha)); } else if (value == "A"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::UpperAlpha)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::UpperAlpha)); } else if (value == "i"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::LowerRoman)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::LowerRoman)); } else if (value == "I"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::UpperRoman)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::UpperRoman)); } else if (value.equals_ignoring_ascii_case("none"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::None)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::None)); } else if (value.equals_ignoring_ascii_case("disc"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Disc)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Disc)); } else if (value.equals_ignoring_ascii_case("circle"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Circle)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Circle)); } else if (value.equals_ignoring_ascii_case("square"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Square)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Square)); } } }); diff --git a/Libraries/LibWeb/HTML/HTMLOListElement.cpp b/Libraries/LibWeb/HTML/HTMLOListElement.cpp index d447c4a1908..a8c3f298829 100644 --- a/Libraries/LibWeb/HTML/HTMLOListElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLOListElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -89,15 +89,15 @@ void HTMLOListElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Decimal)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Decimal)); } else if (value == "a"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::LowerAlpha)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::LowerAlpha)); } else if (value == "A"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::UpperAlpha)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::UpperAlpha)); } else if (value == "i"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::LowerRoman)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::LowerRoman)); } else if (value == "I"sv) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::UpperRoman)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::UpperRoman)); } } }); diff --git a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 2c5a6b9e5c7..521fc9f8d0e 100644 --- a/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -8,8 +8,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -133,9 +133,9 @@ void HTMLObjectElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Center)); else if (value.equals_ignoring_ascii_case("middle"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Middle)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Middle)); } else if (name == HTML::AttributeNames::border) { if (auto parsed_value = parse_non_negative_integer(value); parsed_value.has_value()) { auto width_style_value = CSS::LengthStyleValue::create(CSS::Length::make_px(*parsed_value)); @@ -144,7 +144,7 @@ void HTMLObjectElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::BorderBottomWidth, width_style_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderLeftWidth, width_style_value); - auto border_style_value = CSS::CSSKeywordValue::create(CSS::Keyword::Solid); + auto border_style_value = CSS::KeywordStyleValue::create(CSS::Keyword::Solid); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderTopStyle, border_style_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderRightStyle, border_style_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BorderBottomStyle, border_style_value); diff --git a/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp index c9b04b3efb5..5fb80aa50b1 100644 --- a/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace Web::HTML { @@ -42,13 +42,13 @@ void HTMLParagraphElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Left)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Left)); else if (value.equals_ignoring_ascii_case("right"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Right)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Right)); else if (value.equals_ignoring_ascii_case("center"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Center)); else if (value.equals_ignoring_ascii_case("justify"sv)) - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Justify)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::Justify)); } }); } diff --git a/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Libraries/LibWeb/HTML/HTMLPreElement.cpp index f224d4e3e40..e8ce83f6179 100644 --- a/Libraries/LibWeb/HTML/HTMLPreElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLPreElement.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include @@ -42,7 +42,7 @@ void HTMLPreElement::apply_presentational_hints(GC::Ref for_each_attribute([&](auto const& name, auto const&) { if (name == HTML::AttributeNames::wrap) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextWrapMode, CSS::CSSKeywordValue::create(CSS::Keyword::Wrap)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextWrapMode, CSS::KeywordStyleValue::create(CSS::Keyword::Wrap)); } }); } diff --git a/Libraries/LibWeb/HTML/HTMLProgressElement.cpp b/Libraries/LibWeb/HTML/HTMLProgressElement.cpp index 310649dc518..9f1019065ee 100644 --- a/Libraries/LibWeb/HTML/HTMLProgressElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLProgressElement.cpp @@ -8,8 +8,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp index 050fce2e769..5a9d6e05c08 100644 --- a/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace Web::HTML { @@ -42,7 +42,7 @@ void HTMLTableCaptionElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::CaptionSide, CSS::CSSKeywordValue::create(CSS::Keyword::Bottom)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::CaptionSide, CSS::KeywordStyleValue::create(CSS::Keyword::Bottom)); } }); } diff --git a/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index c4786a65043..2e875ad186b 100644 --- a/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -69,11 +69,11 @@ void HTMLTableCellElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::LibwebCenter)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::LibwebCenter)); } else if (value.equals_ignoring_ascii_case("left"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::LibwebLeft)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::LibwebLeft)); } else if (value.equals_ignoring_ascii_case("right"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::LibwebRight)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::KeywordStyleValue::create(CSS::Keyword::LibwebRight)); } else { if (auto parsed_value = parse_css_value(CSS::Parser::ParsingParams { document() }, value, CSS::PropertyID::TextAlign)) cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, parsed_value.release_nonnull()); @@ -94,7 +94,7 @@ void HTMLTableCellElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::BackgroundImage, CSS::ImageStyleValue::create(*parsed_value)); return; } else if (name == HTML::AttributeNames::nowrap) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextWrapMode, CSS::CSSKeywordValue::create(CSS::Keyword::Nowrap)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextWrapMode, CSS::KeywordStyleValue::create(CSS::Keyword::Nowrap)); return; } }); @@ -115,7 +115,7 @@ void HTMLTableCellElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(style_property, CSS::CSSKeywordValue::create(CSS::Keyword::Inset)); + cascaded_properties->set_property_from_presentational_hint(style_property, CSS::KeywordStyleValue::create(CSS::Keyword::Inset)); cascaded_properties->set_property_from_presentational_hint(width_property, CSS::LengthStyleValue::create(CSS::Length::make_px(1))); cascaded_properties->set_property_from_presentational_hint(color_property, table_element->computed_properties()->property(color_property)); }; diff --git a/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Libraries/LibWeb/HTML/HTMLTableElement.cpp index 2ed80f604b7..efc8f1e9221 100644 --- a/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -85,8 +85,8 @@ void HTMLTableElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::MarginLeft, CSS::CSSKeywordValue::create(CSS::Keyword::Auto)); - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginRight, CSS::CSSKeywordValue::create(CSS::Keyword::Auto)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginLeft, CSS::KeywordStyleValue::create(CSS::Keyword::Auto)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MarginRight, CSS::KeywordStyleValue::create(CSS::Keyword::Auto)); } else if (auto parsed_value = parse_css_value(CSS::Parser::ParsingParams { document() }, value, CSS::PropertyID::Float)) { cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Float, parsed_value.release_nonnull()); } @@ -115,7 +115,7 @@ void HTMLTableElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(style_property, legacy_line_style); cascaded_properties->set_property_from_presentational_hint(width_property, CSS::LengthStyleValue::create(CSS::Length::make_px(border))); cascaded_properties->set_property_from_presentational_hint(color_property, CSS::CSSColorValue::create_from_color(Color(128, 128, 128), CSS::ColorSyntax::Legacy)); diff --git a/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp b/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp index a6b0554a087..4c4ff2c1828 100644 --- a/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/Libraries/LibWeb/HTML/HTMLUListElement.cpp b/Libraries/LibWeb/HTML/HTMLUListElement.cpp index 6bb2ed3007c..769118f114e 100644 --- a/Libraries/LibWeb/HTML/HTMLUListElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLUListElement.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include namespace Web::HTML { @@ -40,13 +40,13 @@ void HTMLUListElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::None)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::None)); } else if (value.equals_ignoring_ascii_case("disc"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Disc)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Disc)); } else if (value.equals_ignoring_ascii_case("circle"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Circle)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Circle)); } else if (value.equals_ignoring_ascii_case("square"sv)) { - cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::CSSKeywordValue::create(CSS::Keyword::Square)); + cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::ListStyleType, CSS::KeywordStyleValue::create(CSS::Keyword::Square)); } } }); diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp index 75a70558b40..5c042d48e16 100644 --- a/Libraries/LibWeb/Layout/Node.cpp +++ b/Libraries/LibWeb/Layout/Node.cpp @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/Libraries/LibWeb/Painting/BorderPainting.cpp b/Libraries/LibWeb/Painting/BorderPainting.cpp index 2378d14a769..3edafcd055d 100644 --- a/Libraries/LibWeb/Painting/BorderPainting.cpp +++ b/Libraries/LibWeb/Painting/BorderPainting.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include @@ -584,7 +584,7 @@ Optional borders_data_for_outline(Layout::Node const& layout_node, if (outline_style == CSS::OutlineStyle::Auto) { // `auto` lets us do whatever we want for the outline. 2px of the accent colour seems reasonable. line_style = CSS::LineStyle::Solid; - outline_color = CSS::CSSKeywordValue::create(CSS::Keyword::Accentcolor)->to_color(CSS::ColorResolutionContext::for_layout_node_with_style(*static_cast(&layout_node))).value(); + outline_color = CSS::KeywordStyleValue::create(CSS::Keyword::Accentcolor)->to_color(CSS::ColorResolutionContext::for_layout_node_with_style(*static_cast(&layout_node))).value(); outline_width = 2; } else { line_style = CSS::keyword_to_line_style(CSS::to_keyword(outline_style)).value_or(CSS::LineStyle::None); diff --git a/Libraries/LibWeb/SVG/SVGSymbolElement.cpp b/Libraries/LibWeb/SVG/SVGSymbolElement.cpp index b25c5ae612b..b66c98b5fb9 100644 --- a/Libraries/LibWeb/SVG/SVGSymbolElement.cpp +++ b/Libraries/LibWeb/SVG/SVGSymbolElement.cpp @@ -7,8 +7,8 @@ #include #include #include -#include #include +#include #include #include #include