From 858450922ba94e8bbf3a7996a099a7cd42bcbaec Mon Sep 17 00:00:00 2001 From: Callum Law Date: Thu, 11 Sep 2025 22:00:19 +1200 Subject: [PATCH] LibWeb: Parse and compute `text-underline-offset` property --- Libraries/LibWeb/CSS/Properties.json | 13 + Libraries/LibWeb/CSS/StyleComputer.cpp | 20 ++ Libraries/LibWeb/CSS/StyleComputer.h | 1 + ...eclaration-has-indexed-property-getter.txt | 1 + ...upported-properties-and-default-values.txt | 2 + .../css/getComputedStyle-print-all.txt | 5 +- .../css/css-cascade/all-prop-revert-layer.txt | 5 +- .../text-underline-offset-interpolation.txt | 326 ++++++++++++++++++ .../text-underline-offset-computed.txt | 21 ++ .../text-underline-offset-initial.txt | 6 + .../text-underline-offset-invalid.txt | 13 + .../text-underline-offset-valid.txt | 17 + .../text-underline-offset-interpolation.html | 240 +++++++++++++ .../text-underline-offset-computed.html | 36 ++ .../text-underline-offset-initial.html | 17 + .../text-underline-offset-invalid.html | 24 ++ .../text-underline-offset-valid.html | 28 ++ 17 files changed, 771 insertions(+), 4 deletions(-) create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-computed.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-initial.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-invalid.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-valid.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-computed.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-initial.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-invalid.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-valid.html diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index 4d3cf1da4a9..8d2952dc524 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -3318,6 +3318,19 @@ "text-transform" ] }, + "text-underline-offset": { + "animation-type": "by-computed-value", + "inherited": true, + "initial": "auto", + "valid-identifiers": [ + "auto" + ], + "valid-types": [ + "length [-∞,∞]", + "percentage [-∞,∞]" + ], + "percentages-resolve-to": "length" + }, "text-wrap": { "inherited": true, "initial": "wrap", diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 33fe4c055b1..bb31a2b4b3f 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -3153,6 +3153,8 @@ NonnullRefPtr StyleComputer::compute_value_of_property(Propert case PropertyID::StopOpacity: case PropertyID::StrokeOpacity: return compute_opacity(specified_value, computation_context); + case PropertyID::TextUnderlineOffset: + return compute_text_underline_offset(specified_value, computation_context); default: // FIXME: We should replace this with a VERIFY_NOT_REACHED() once all properties have their own handling. return specified_value; @@ -3208,6 +3210,24 @@ NonnullRefPtr StyleComputer::compute_opacity(NonnullRefPtr StyleComputer::compute_text_underline_offset(NonnullRefPtr const& specified_value, PropertyValueComputationContext const& computation_context) +{ + // https://drafts.csswg.org/css-text-decor-4/#underline-offset + // as specified, with values computed + + // auto + // + if (specified_value->to_keyword() == Keyword::Auto || specified_value->is_percentage()) + return specified_value; + + // + // NOTE: We also support calc()'d + if (specified_value->is_calculated() || specified_value->is_length()) + return specified_value->absolutized(computation_context.length_resolution_context.viewport_rect, computation_context.length_resolution_context.font_metrics, computation_context.length_resolution_context.root_font_metrics); + + VERIFY_NOT_REACHED(); +} + void StyleComputer::compute_math_depth(ComputedProperties& style, Optional 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 c17db1181ef..68fb64a4812 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Libraries/LibWeb/CSS/StyleComputer.h @@ -205,6 +205,7 @@ public: static NonnullRefPtr compute_value_of_property(PropertyID, NonnullRefPtr const& specified_value, Function(PropertyID)> const& get_property_specified_value, PropertyValueComputationContext const&); static NonnullRefPtr compute_border_or_outline_width(NonnullRefPtr const& specified_value, NonnullRefPtr const& style_specified_value, PropertyValueComputationContext const&); static NonnullRefPtr compute_opacity(NonnullRefPtr const& specified_value, PropertyValueComputationContext const&); + static NonnullRefPtr compute_text_underline_offset(NonnullRefPtr const& specified_value, PropertyValueComputationContext const&); private: virtual void visit_edges(Visitor&) override; diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt index 71c8bfc7528..4b0de3bb40b 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt @@ -62,6 +62,7 @@ All properties associated with getComputedStyle(document.body): "text-rendering", "text-shadow", "text-transform", + "text-underline-offset", "text-wrap-mode", "text-wrap-style", "visibility", diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt index 80d013c26d1..76e79920b16 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt @@ -689,6 +689,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'text-shadow': 'none' 'textTransform': 'none' 'text-transform': 'none' +'textUnderlineOffset': 'auto' +'text-underline-offset': 'auto' 'textWrap': 'wrap' 'text-wrap': 'wrap' 'textWrapMode': 'wrap' diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 55039f01459..b79b6e01120 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -60,6 +60,7 @@ text-justify: auto text-rendering: auto text-shadow: none text-transform: none +text-underline-offset: auto text-wrap-mode: wrap text-wrap-style: auto visibility: visible @@ -92,7 +93,7 @@ background-position-x: 0% background-position-y: 0% background-repeat: repeat background-size: auto -block-size: 1410px +block-size: 1425px border-block-end-color: rgb(0, 0, 0) border-block-end-style: none border-block-end-width: 0px @@ -169,7 +170,7 @@ grid-row-start: auto grid-template-areas: none grid-template-columns: none grid-template-rows: none -height: 2565px +height: 2580px inline-size: 784px inset-block-end: auto inset-block-start: auto diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt index e8b191f7b52..036eefe5e33 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt @@ -1,8 +1,8 @@ Harness status: OK -Found 258 tests +Found 259 tests -251 Pass +252 Pass 7 Fail Pass accent-color Pass border-collapse @@ -64,6 +64,7 @@ Pass text-justify Pass text-rendering Pass text-shadow Pass text-transform +Pass text-underline-offset Pass text-wrap-mode Pass text-wrap-style Pass visibility diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.txt new file mode 100644 index 00000000000..7bf5cdd7f80 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.txt @@ -0,0 +1,326 @@ +Harness status: OK + +Found 320 tests + +300 Pass +20 Fail +Pass CSS Transitions: property from [15px] to [0px] at (0) should be [15px] +Pass CSS Transitions: property from [15px] to [0px] at (0.3) should be [10.5px] +Pass CSS Transitions: property from [15px] to [0px] at (0.6) should be [6px] +Pass CSS Transitions: property from [15px] to [0px] at (1) should be [0px] +Pass CSS Transitions with transition: all: property from [15px] to [0px] at (0) should be [15px] +Pass CSS Transitions with transition: all: property from [15px] to [0px] at (0.3) should be [10.5px] +Pass CSS Transitions with transition: all: property from [15px] to [0px] at (0.6) should be [6px] +Pass CSS Transitions with transition: all: property from [15px] to [0px] at (1) should be [0px] +Pass CSS Animations: property from [15px] to [0px] at (0) should be [15px] +Pass CSS Animations: property from [15px] to [0px] at (0.3) should be [10.5px] +Pass CSS Animations: property from [15px] to [0px] at (0.6) should be [6px] +Pass CSS Animations: property from [15px] to [0px] at (1) should be [0px] +Pass Web Animations: property from [15px] to [0px] at (0) should be [15px] +Pass Web Animations: property from [15px] to [0px] at (0.3) should be [10.5px] +Pass Web Animations: property from [15px] to [0px] at (0.6) should be [6px] +Pass Web Animations: property from [15px] to [0px] at (1) should be [0px] +Pass CSS Transitions: property from [16px] to [0px] at (0) should be [16px] +Pass CSS Transitions: property from [16px] to [0px] at (0.3) should be [11.2px] +Pass CSS Transitions: property from [16px] to [0px] at (0.6) should be [6.4px] +Pass CSS Transitions: property from [16px] to [0px] at (1) should be [0px] +Pass CSS Transitions with transition: all: property from [16px] to [0px] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [16px] to [0px] at (0.3) should be [11.2px] +Pass CSS Transitions with transition: all: property from [16px] to [0px] at (0.6) should be [6.4px] +Pass CSS Transitions with transition: all: property from [16px] to [0px] at (1) should be [0px] +Pass CSS Animations: property from [16px] to [0px] at (0) should be [16px] +Pass CSS Animations: property from [16px] to [0px] at (0.3) should be [11.2px] +Pass CSS Animations: property from [16px] to [0px] at (0.6) should be [6.4px] +Pass CSS Animations: property from [16px] to [0px] at (1) should be [0px] +Pass Web Animations: property from [16px] to [0px] at (0) should be [16px] +Pass Web Animations: property from [16px] to [0px] at (0.3) should be [11.2px] +Pass Web Animations: property from [16px] to [0px] at (0.6) should be [6.4px] +Pass Web Animations: property from [16px] to [0px] at (1) should be [0px] +Pass CSS Transitions: property from [16px] to [32px] at (0) should be [16px] +Pass CSS Transitions: property from [16px] to [32px] at (0.3) should be [20.8px] +Pass CSS Transitions: property from [16px] to [32px] at (0.6) should be [25.6px] +Pass CSS Transitions: property from [16px] to [32px] at (1) should be [32px] +Pass CSS Transitions with transition: all: property from [16px] to [32px] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [16px] to [32px] at (0.3) should be [20.8px] +Pass CSS Transitions with transition: all: property from [16px] to [32px] at (0.6) should be [25.6px] +Pass CSS Transitions with transition: all: property from [16px] to [32px] at (1) should be [32px] +Pass CSS Animations: property from [16px] to [32px] at (0) should be [16px] +Pass CSS Animations: property from [16px] to [32px] at (0.3) should be [20.8px] +Pass CSS Animations: property from [16px] to [32px] at (0.6) should be [25.6px] +Pass CSS Animations: property from [16px] to [32px] at (1) should be [32px] +Pass Web Animations: property from [16px] to [32px] at (0) should be [16px] +Pass Web Animations: property from [16px] to [32px] at (0.3) should be [20.8px] +Pass Web Animations: property from [16px] to [32px] at (0.6) should be [25.6px] +Pass Web Animations: property from [16px] to [32px] at (1) should be [32px] +Pass CSS Transitions: property from [1em] to [0em] at (0) should be [16px] +Pass CSS Transitions: property from [1em] to [0em] at (0.3) should be [11.2px] +Pass CSS Transitions: property from [1em] to [0em] at (0.6) should be [6.4px] +Pass CSS Transitions: property from [1em] to [0em] at (1) should be [0px] +Pass CSS Transitions with transition: all: property from [1em] to [0em] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [1em] to [0em] at (0.3) should be [11.2px] +Pass CSS Transitions with transition: all: property from [1em] to [0em] at (0.6) should be [6.4px] +Pass CSS Transitions with transition: all: property from [1em] to [0em] at (1) should be [0px] +Pass CSS Animations: property from [1em] to [0em] at (0) should be [16px] +Pass CSS Animations: property from [1em] to [0em] at (0.3) should be [11.2px] +Pass CSS Animations: property from [1em] to [0em] at (0.6) should be [6.4px] +Pass CSS Animations: property from [1em] to [0em] at (1) should be [0px] +Pass Web Animations: property from [1em] to [0em] at (0) should be [16px] +Pass Web Animations: property from [1em] to [0em] at (0.3) should be [11.2px] +Pass Web Animations: property from [1em] to [0em] at (0.6) should be [6.4px] +Pass Web Animations: property from [1em] to [0em] at (1) should be [0px] +Pass CSS Transitions: property from [1em] to [2em] at (0) should be [16px] +Pass CSS Transitions: property from [1em] to [2em] at (0.3) should be [20.8px] +Pass CSS Transitions: property from [1em] to [2em] at (0.6) should be [25.6px] +Pass CSS Transitions: property from [1em] to [2em] at (1) should be [32px] +Pass CSS Transitions with transition: all: property from [1em] to [2em] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [1em] to [2em] at (0.3) should be [20.8px] +Pass CSS Transitions with transition: all: property from [1em] to [2em] at (0.6) should be [25.6px] +Pass CSS Transitions with transition: all: property from [1em] to [2em] at (1) should be [32px] +Pass CSS Animations: property from [1em] to [2em] at (0) should be [16px] +Pass CSS Animations: property from [1em] to [2em] at (0.3) should be [20.8px] +Pass CSS Animations: property from [1em] to [2em] at (0.6) should be [25.6px] +Pass CSS Animations: property from [1em] to [2em] at (1) should be [32px] +Pass Web Animations: property from [1em] to [2em] at (0) should be [16px] +Pass Web Animations: property from [1em] to [2em] at (0.3) should be [20.8px] +Pass Web Animations: property from [1em] to [2em] at (0.6) should be [25.6px] +Pass Web Animations: property from [1em] to [2em] at (1) should be [32px] +Pass CSS Transitions: property from [100%] to [0%] at (0) should be [100%] +Pass CSS Transitions: property from [100%] to [0%] at (0.3) should be [70%] +Pass CSS Transitions: property from [100%] to [0%] at (0.6) should be [40%] +Pass CSS Transitions: property from [100%] to [0%] at (1) should be [0%] +Pass CSS Transitions with transition: all: property from [100%] to [0%] at (0) should be [100%] +Pass CSS Transitions with transition: all: property from [100%] to [0%] at (0.3) should be [70%] +Pass CSS Transitions with transition: all: property from [100%] to [0%] at (0.6) should be [40%] +Pass CSS Transitions with transition: all: property from [100%] to [0%] at (1) should be [0%] +Pass CSS Animations: property from [100%] to [0%] at (0) should be [100%] +Pass CSS Animations: property from [100%] to [0%] at (0.3) should be [70%] +Pass CSS Animations: property from [100%] to [0%] at (0.6) should be [40%] +Pass CSS Animations: property from [100%] to [0%] at (1) should be [0%] +Pass Web Animations: property from [100%] to [0%] at (0) should be [100%] +Pass Web Animations: property from [100%] to [0%] at (0.3) should be [70%] +Pass Web Animations: property from [100%] to [0%] at (0.6) should be [40%] +Pass Web Animations: property from [100%] to [0%] at (1) should be [0%] +Pass CSS Transitions: property from [100%] to [200%] at (0) should be [100%] +Pass CSS Transitions: property from [100%] to [200%] at (0.3) should be [130%] +Pass CSS Transitions: property from [100%] to [200%] at (0.6) should be [160%] +Pass CSS Transitions: property from [100%] to [200%] at (1) should be [200%] +Pass CSS Transitions with transition: all: property from [100%] to [200%] at (0) should be [100%] +Pass CSS Transitions with transition: all: property from [100%] to [200%] at (0.3) should be [130%] +Pass CSS Transitions with transition: all: property from [100%] to [200%] at (0.6) should be [160%] +Pass CSS Transitions with transition: all: property from [100%] to [200%] at (1) should be [200%] +Pass CSS Animations: property from [100%] to [200%] at (0) should be [100%] +Pass CSS Animations: property from [100%] to [200%] at (0.3) should be [130%] +Pass CSS Animations: property from [100%] to [200%] at (0.6) should be [160%] +Pass CSS Animations: property from [100%] to [200%] at (1) should be [200%] +Pass Web Animations: property from [100%] to [200%] at (0) should be [100%] +Pass Web Animations: property from [100%] to [200%] at (0.3) should be [130%] +Pass Web Animations: property from [100%] to [200%] at (0.6) should be [160%] +Pass Web Animations: property from [100%] to [200%] at (1) should be [200%] +Pass CSS Transitions: property from [16px] to [0em] at (0) should be [16px] +Pass CSS Transitions: property from [16px] to [0em] at (0.3) should be [11.2px] +Pass CSS Transitions: property from [16px] to [0em] at (0.6) should be [6.4px] +Pass CSS Transitions: property from [16px] to [0em] at (1) should be [0px] +Pass CSS Transitions with transition: all: property from [16px] to [0em] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [16px] to [0em] at (0.3) should be [11.2px] +Pass CSS Transitions with transition: all: property from [16px] to [0em] at (0.6) should be [6.4px] +Pass CSS Transitions with transition: all: property from [16px] to [0em] at (1) should be [0px] +Pass CSS Animations: property from [16px] to [0em] at (0) should be [16px] +Pass CSS Animations: property from [16px] to [0em] at (0.3) should be [11.2px] +Pass CSS Animations: property from [16px] to [0em] at (0.6) should be [6.4px] +Pass CSS Animations: property from [16px] to [0em] at (1) should be [0px] +Pass Web Animations: property from [16px] to [0em] at (0) should be [16px] +Pass Web Animations: property from [16px] to [0em] at (0.3) should be [11.2px] +Pass Web Animations: property from [16px] to [0em] at (0.6) should be [6.4px] +Pass Web Animations: property from [16px] to [0em] at (1) should be [0px] +Pass CSS Transitions: property from [16px] to [2em] at (0) should be [16px] +Pass CSS Transitions: property from [16px] to [2em] at (0.3) should be [20.8px] +Pass CSS Transitions: property from [16px] to [2em] at (0.6) should be [25.6px] +Pass CSS Transitions: property from [16px] to [2em] at (1) should be [32px] +Pass CSS Transitions with transition: all: property from [16px] to [2em] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [16px] to [2em] at (0.3) should be [20.8px] +Pass CSS Transitions with transition: all: property from [16px] to [2em] at (0.6) should be [25.6px] +Pass CSS Transitions with transition: all: property from [16px] to [2em] at (1) should be [32px] +Pass CSS Animations: property from [16px] to [2em] at (0) should be [16px] +Pass CSS Animations: property from [16px] to [2em] at (0.3) should be [20.8px] +Pass CSS Animations: property from [16px] to [2em] at (0.6) should be [25.6px] +Pass CSS Animations: property from [16px] to [2em] at (1) should be [32px] +Pass Web Animations: property from [16px] to [2em] at (0) should be [16px] +Pass Web Animations: property from [16px] to [2em] at (0.3) should be [20.8px] +Pass Web Animations: property from [16px] to [2em] at (0.6) should be [25.6px] +Pass Web Animations: property from [16px] to [2em] at (1) should be [32px] +Pass CSS Transitions: property from [16px] to [0%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions: property from [16px] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass CSS Transitions: property from [16px] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass CSS Transitions: property from [16px] to [0%] at (1) should be [0%] +Pass CSS Transitions with transition: all: property from [16px] to [0%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions with transition: all: property from [16px] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass CSS Transitions with transition: all: property from [16px] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass CSS Transitions with transition: all: property from [16px] to [0%] at (1) should be [0%] +Pass CSS Animations: property from [16px] to [0%] at (0) should be [calc(0% + 16px)] +Pass CSS Animations: property from [16px] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass CSS Animations: property from [16px] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass CSS Animations: property from [16px] to [0%] at (1) should be [0%] +Pass Web Animations: property from [16px] to [0%] at (0) should be [calc(0% + 16px)] +Pass Web Animations: property from [16px] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass Web Animations: property from [16px] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass Web Animations: property from [16px] to [0%] at (1) should be [0%] +Pass CSS Transitions: property from [16px] to [200%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions: property from [16px] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass CSS Transitions: property from [16px] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass CSS Transitions: property from [16px] to [200%] at (1) should be [200%] +Pass CSS Transitions with transition: all: property from [16px] to [200%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions with transition: all: property from [16px] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass CSS Transitions with transition: all: property from [16px] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass CSS Transitions with transition: all: property from [16px] to [200%] at (1) should be [200%] +Pass CSS Animations: property from [16px] to [200%] at (0) should be [calc(0% + 16px)] +Pass CSS Animations: property from [16px] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass CSS Animations: property from [16px] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass CSS Animations: property from [16px] to [200%] at (1) should be [200%] +Pass Web Animations: property from [16px] to [200%] at (0) should be [calc(0% + 16px)] +Pass Web Animations: property from [16px] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass Web Animations: property from [16px] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass Web Animations: property from [16px] to [200%] at (1) should be [200%] +Pass CSS Transitions: property from [1em] to [0px] at (0) should be [16px] +Pass CSS Transitions: property from [1em] to [0px] at (0.3) should be [11.2px] +Pass CSS Transitions: property from [1em] to [0px] at (0.6) should be [6.4px] +Pass CSS Transitions: property from [1em] to [0px] at (1) should be [0px] +Pass CSS Transitions with transition: all: property from [1em] to [0px] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [1em] to [0px] at (0.3) should be [11.2px] +Pass CSS Transitions with transition: all: property from [1em] to [0px] at (0.6) should be [6.4px] +Pass CSS Transitions with transition: all: property from [1em] to [0px] at (1) should be [0px] +Pass CSS Animations: property from [1em] to [0px] at (0) should be [16px] +Pass CSS Animations: property from [1em] to [0px] at (0.3) should be [11.2px] +Pass CSS Animations: property from [1em] to [0px] at (0.6) should be [6.4px] +Pass CSS Animations: property from [1em] to [0px] at (1) should be [0px] +Pass Web Animations: property from [1em] to [0px] at (0) should be [16px] +Pass Web Animations: property from [1em] to [0px] at (0.3) should be [11.2px] +Pass Web Animations: property from [1em] to [0px] at (0.6) should be [6.4px] +Pass Web Animations: property from [1em] to [0px] at (1) should be [0px] +Pass CSS Transitions: property from [1em] to [32px] at (0) should be [16px] +Pass CSS Transitions: property from [1em] to [32px] at (0.3) should be [20.8px] +Pass CSS Transitions: property from [1em] to [32px] at (0.6) should be [25.6px] +Pass CSS Transitions: property from [1em] to [32px] at (1) should be [32px] +Pass CSS Transitions with transition: all: property from [1em] to [32px] at (0) should be [16px] +Pass CSS Transitions with transition: all: property from [1em] to [32px] at (0.3) should be [20.8px] +Pass CSS Transitions with transition: all: property from [1em] to [32px] at (0.6) should be [25.6px] +Pass CSS Transitions with transition: all: property from [1em] to [32px] at (1) should be [32px] +Pass CSS Animations: property from [1em] to [32px] at (0) should be [16px] +Pass CSS Animations: property from [1em] to [32px] at (0.3) should be [20.8px] +Pass CSS Animations: property from [1em] to [32px] at (0.6) should be [25.6px] +Pass CSS Animations: property from [1em] to [32px] at (1) should be [32px] +Pass Web Animations: property from [1em] to [32px] at (0) should be [16px] +Pass Web Animations: property from [1em] to [32px] at (0.3) should be [20.8px] +Pass Web Animations: property from [1em] to [32px] at (0.6) should be [25.6px] +Pass Web Animations: property from [1em] to [32px] at (1) should be [32px] +Pass CSS Transitions: property from [1em] to [0%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions: property from [1em] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass CSS Transitions: property from [1em] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass CSS Transitions: property from [1em] to [0%] at (1) should be [0%] +Pass CSS Transitions with transition: all: property from [1em] to [0%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions with transition: all: property from [1em] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass CSS Transitions with transition: all: property from [1em] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass CSS Transitions with transition: all: property from [1em] to [0%] at (1) should be [0%] +Pass CSS Animations: property from [1em] to [0%] at (0) should be [calc(0% + 16px)] +Pass CSS Animations: property from [1em] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass CSS Animations: property from [1em] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass CSS Animations: property from [1em] to [0%] at (1) should be [0%] +Pass Web Animations: property from [1em] to [0%] at (0) should be [calc(0% + 16px)] +Pass Web Animations: property from [1em] to [0%] at (0.3) should be [calc(0% + 11.2px)] +Pass Web Animations: property from [1em] to [0%] at (0.6) should be [calc(0% + 6.4px)] +Pass Web Animations: property from [1em] to [0%] at (1) should be [0%] +Pass CSS Transitions: property from [1em] to [200%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions: property from [1em] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass CSS Transitions: property from [1em] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass CSS Transitions: property from [1em] to [200%] at (1) should be [200%] +Pass CSS Transitions with transition: all: property from [1em] to [200%] at (0) should be [calc(0% + 16px)] +Pass CSS Transitions with transition: all: property from [1em] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass CSS Transitions with transition: all: property from [1em] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass CSS Transitions with transition: all: property from [1em] to [200%] at (1) should be [200%] +Pass CSS Animations: property from [1em] to [200%] at (0) should be [calc(0% + 16px)] +Pass CSS Animations: property from [1em] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass CSS Animations: property from [1em] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass CSS Animations: property from [1em] to [200%] at (1) should be [200%] +Pass Web Animations: property from [1em] to [200%] at (0) should be [calc(0% + 16px)] +Pass Web Animations: property from [1em] to [200%] at (0.3) should be [calc(60% + 11.2px)] +Pass Web Animations: property from [1em] to [200%] at (0.6) should be [calc(120% + 6.4px)] +Pass Web Animations: property from [1em] to [200%] at (1) should be [200%] +Pass CSS Transitions: property from [100%] to [0px] at (0) should be [100%] +Pass CSS Transitions: property from [100%] to [0px] at (0.3) should be [70%] +Pass CSS Transitions: property from [100%] to [0px] at (0.6) should be [40%] +Pass CSS Transitions: property from [100%] to [0px] at (1) should be [0%] +Pass CSS Transitions with transition: all: property from [100%] to [0px] at (0) should be [100%] +Pass CSS Transitions with transition: all: property from [100%] to [0px] at (0.3) should be [70%] +Pass CSS Transitions with transition: all: property from [100%] to [0px] at (0.6) should be [40%] +Pass CSS Transitions with transition: all: property from [100%] to [0px] at (1) should be [0%] +Pass CSS Animations: property from [100%] to [0px] at (0) should be [100%] +Pass CSS Animations: property from [100%] to [0px] at (0.3) should be [70%] +Pass CSS Animations: property from [100%] to [0px] at (0.6) should be [40%] +Pass CSS Animations: property from [100%] to [0px] at (1) should be [0%] +Pass Web Animations: property from [100%] to [0px] at (0) should be [100%] +Pass Web Animations: property from [100%] to [0px] at (0.3) should be [70%] +Pass Web Animations: property from [100%] to [0px] at (0.6) should be [40%] +Pass Web Animations: property from [100%] to [0px] at (1) should be [0%] +Fail CSS Transitions: property from [100%] to [32px] at (0) should be [calc(100% + 0px)] +Pass CSS Transitions: property from [100%] to [32px] at (0.3) should be [calc(70% + 9.6px)] +Pass CSS Transitions: property from [100%] to [32px] at (0.6) should be [calc(40% + 19.2px)] +Pass CSS Transitions: property from [100%] to [32px] at (1) should be [calc(0% + 32px)] +Fail CSS Transitions with transition: all: property from [100%] to [32px] at (0) should be [calc(100% + 0px)] +Pass CSS Transitions with transition: all: property from [100%] to [32px] at (0.3) should be [calc(70% + 9.6px)] +Pass CSS Transitions with transition: all: property from [100%] to [32px] at (0.6) should be [calc(40% + 19.2px)] +Pass CSS Transitions with transition: all: property from [100%] to [32px] at (1) should be [calc(0% + 32px)] +Fail CSS Animations: property from [100%] to [32px] at (0) should be [calc(100% + 0px)] +Pass CSS Animations: property from [100%] to [32px] at (0.3) should be [calc(70% + 9.6px)] +Pass CSS Animations: property from [100%] to [32px] at (0.6) should be [calc(40% + 19.2px)] +Pass CSS Animations: property from [100%] to [32px] at (1) should be [calc(0% + 32px)] +Fail Web Animations: property from [100%] to [32px] at (0) should be [calc(100% + 0px)] +Pass Web Animations: property from [100%] to [32px] at (0.3) should be [calc(70% + 9.6px)] +Pass Web Animations: property from [100%] to [32px] at (0.6) should be [calc(40% + 19.2px)] +Pass Web Animations: property from [100%] to [32px] at (1) should be [calc(0% + 32px)] +Fail CSS Transitions: property from [100%] to [0em] at (0) should be [calc(100% + 0em)] +Fail CSS Transitions: property from [100%] to [0em] at (0.3) should be [calc(70% + 0em)] +Fail CSS Transitions: property from [100%] to [0em] at (0.6) should be [calc(40% + 0em)] +Fail CSS Transitions: property from [100%] to [0em] at (1) should be [calc(0% + 0em)] +Fail CSS Transitions with transition: all: property from [100%] to [0em] at (0) should be [calc(100% + 0em)] +Fail CSS Transitions with transition: all: property from [100%] to [0em] at (0.3) should be [calc(70% + 0em)] +Fail CSS Transitions with transition: all: property from [100%] to [0em] at (0.6) should be [calc(40% + 0em)] +Fail CSS Transitions with transition: all: property from [100%] to [0em] at (1) should be [calc(0% + 0em)] +Fail CSS Animations: property from [100%] to [0em] at (0) should be [calc(100% + 0em)] +Fail CSS Animations: property from [100%] to [0em] at (0.3) should be [calc(70% + 0em)] +Fail CSS Animations: property from [100%] to [0em] at (0.6) should be [calc(40% + 0em)] +Fail CSS Animations: property from [100%] to [0em] at (1) should be [calc(0% + 0em)] +Fail Web Animations: property from [100%] to [0em] at (0) should be [calc(100% + 0em)] +Fail Web Animations: property from [100%] to [0em] at (0.3) should be [calc(70% + 0em)] +Fail Web Animations: property from [100%] to [0em] at (0.6) should be [calc(40% + 0em)] +Fail Web Animations: property from [100%] to [0em] at (1) should be [calc(0% + 0em)] +Pass CSS Transitions: property from [100%] to [2em] at (0) should be [100%] +Pass CSS Transitions: property from [100%] to [2em] at (0.3) should be [calc(70% + 9.6px)] +Pass CSS Transitions: property from [100%] to [2em] at (0.6) should be [calc(40% + 19.2px)] +Pass CSS Transitions: property from [100%] to [2em] at (1) should be [calc(0% + 32px)] +Pass CSS Transitions with transition: all: property from [100%] to [2em] at (0) should be [100%] +Pass CSS Transitions with transition: all: property from [100%] to [2em] at (0.3) should be [calc(70% + 9.6px)] +Pass CSS Transitions with transition: all: property from [100%] to [2em] at (0.6) should be [calc(40% + 19.2px)] +Pass CSS Transitions with transition: all: property from [100%] to [2em] at (1) should be [calc(0% + 32px)] +Pass CSS Animations: property from [100%] to [2em] at (0) should be [100%] +Pass CSS Animations: property from [100%] to [2em] at (0.3) should be [calc(70% + 9.6px)] +Pass CSS Animations: property from [100%] to [2em] at (0.6) should be [calc(40% + 19.2px)] +Pass CSS Animations: property from [100%] to [2em] at (1) should be [calc(0% + 32px)] +Pass Web Animations: property from [100%] to [2em] at (0) should be [100%] +Pass Web Animations: property from [100%] to [2em] at (0.3) should be [calc(70% + 9.6px)] +Pass Web Animations: property from [100%] to [2em] at (0.6) should be [calc(40% + 19.2px)] +Pass Web Animations: property from [100%] to [2em] at (1) should be [calc(0% + 32px)] +Pass CSS Transitions: property from [0%] to [100%] at (0) should be [0%] +Pass CSS Transitions: property from [0%] to [100%] at (0.3) should be [30%] +Pass CSS Transitions: property from [0%] to [100%] at (0.6) should be [60%] +Pass CSS Transitions: property from [0%] to [100%] at (1) should be [100%] +Pass CSS Transitions with transition: all: property from [0%] to [100%] at (0) should be [0%] +Pass CSS Transitions with transition: all: property from [0%] to [100%] at (0.3) should be [30%] +Pass CSS Transitions with transition: all: property from [0%] to [100%] at (0.6) should be [60%] +Pass CSS Transitions with transition: all: property from [0%] to [100%] at (1) should be [100%] +Pass CSS Animations: property from [0%] to [100%] at (0) should be [0%] +Pass CSS Animations: property from [0%] to [100%] at (0.3) should be [30%] +Pass CSS Animations: property from [0%] to [100%] at (0.6) should be [60%] +Pass CSS Animations: property from [0%] to [100%] at (1) should be [100%] +Pass Web Animations: property from [0%] to [100%] at (0) should be [0%] +Pass Web Animations: property from [0%] to [100%] at (0.3) should be [30%] +Pass Web Animations: property from [0%] to [100%] at (0.6) should be [60%] +Pass Web Animations: property from [0%] to [100%] at (1) should be [100%] \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-computed.txt new file mode 100644 index 00000000000..0bec500b364 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-computed.txt @@ -0,0 +1,21 @@ +Harness status: OK + +Found 15 tests + +13 Pass +2 Fail +Pass Property text-underline-offset value 'auto' +Pass Property text-underline-offset value 'calc(10px - 8px)' +Pass Property text-underline-offset value '32px' +Pass Property text-underline-offset value '2em' +Pass Property text-underline-offset value '200%' +Pass Property text-underline-offset value 'calc(2em - 0px)' +Fail Property text-underline-offset value 'calc(200% - 0px)' +Pass Property text-underline-offset value 'calc(0.5em - 0px)' +Fail Property text-underline-offset value 'calc(50% - 0px)' +Pass Property text-underline-offset value 'calc(2em - 8px)' +Pass Property text-underline-offset value 'calc(2em - 0.5em)' +Pass Property text-underline-offset value 'calc(2em - 50%)' +Pass Property text-underline-offset value 'calc(200% - 8px)' +Pass Property text-underline-offset value 'calc(200% - 0.5em)' +Pass Property text-underline-offset value 'calc(200% - 50%)' \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-initial.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-initial.txt new file mode 100644 index 00000000000..6b4056eb895 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-initial.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Pass +Pass Initial value of text-underline-offset \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-invalid.txt new file mode 100644 index 00000000000..7e4cab6c5e2 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-invalid.txt @@ -0,0 +1,13 @@ +Harness status: OK + +Found 8 tests + +8 Pass +Pass e.style['text-underline-offset'] = "from-font" should not set the property value +Pass e.style['text-underline-offset'] = "otto" should not set the property value +Pass e.style['text-underline-offset'] = "asdlflj" should not set the property value +Pass e.style['text-underline-offset'] = "-10" should not set the property value +Pass e.style['text-underline-offset'] = "60002020" should not set the property value +Pass e.style['text-underline-offset'] = "!@#$%^&" should not set the property value +Pass e.style['text-underline-offset'] = "10e2" should not set the property value +Pass e.style['text-underline-offset'] = "from font" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-valid.txt new file mode 100644 index 00000000000..a04429477df --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/text-underline-offset-valid.txt @@ -0,0 +1,17 @@ +Harness status: OK + +Found 12 tests + +12 Pass +Pass e.style['text-underline-offset'] = "auto" should set the property value +Pass e.style['text-underline-offset'] = "-10px" should set the property value +Pass e.style['text-underline-offset'] = "2001em" should set the property value +Pass e.style['text-underline-offset'] = "-49em" should set the property value +Pass e.style['text-underline-offset'] = "53px" should set the property value +Pass e.style['text-underline-offset'] = "5%" should set the property value +Pass e.style['text-underline-offset'] = "89%" should set the property value +Pass e.style['text-underline-offset'] = "-30%" should set the property value +Pass e.style['text-underline-offset'] = "187%" should set the property value +Pass e.style['text-underline-offset'] = "calc(45% - 0.3em)" should set the property value +Pass e.style['text-underline-offset'] = "calc(40em - 10px)" should set the property value +Pass e.style['text-underline-offset'] = "calc(-13em + 50px)" should set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.html new file mode 100644 index 00000000000..eed5eab31ec --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/animations/text-underline-offset-interpolation.html @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-computed.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-computed.html new file mode 100644 index 00000000000..0e47c15f41e --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-computed.html @@ -0,0 +1,36 @@ + + + + +CSS Text Decoration Test: parsing text-underline-offset computed values + + + + + + + +
+ + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-initial.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-initial.html new file mode 100644 index 00000000000..f8b90ccd37e --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-initial.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-invalid.html new file mode 100644 index 00000000000..801ac8ec551 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-invalid.html @@ -0,0 +1,24 @@ + + + + +CSS Text Decoration Test: parsing text-underline-offset with invalid values + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-valid.html new file mode 100644 index 00000000000..65d533c6e5f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text-decor/text-underline-offset-valid.html @@ -0,0 +1,28 @@ + + + + +CSS Text Decoration Test: parsing text-underline-offset with valid values + + + + + + + + + +