diff --git a/Libraries/LibWeb/CSS/Angle.cpp b/Libraries/LibWeb/CSS/Angle.cpp index d13dff340f9..24701a5a522 100644 --- a/Libraries/LibWeb/CSS/Angle.cpp +++ b/Libraries/LibWeb/CSS/Angle.cpp @@ -100,12 +100,11 @@ Optional Angle::unit_from_name(StringView name) Angle Angle::resolve_calculated(NonnullRefPtr const& calculated, Layout::Node const& layout_node, Angle const& reference_value) { - return calculated->resolve_angle_deprecated( - { - .percentage_basis = reference_value, - .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node), - }) - .value(); + CalculationResolutionContext context { + .percentage_basis = reference_value, + .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node), + }; + return calculated->resolve_angle(context).value(); } } diff --git a/Libraries/LibWeb/CSS/Frequency.cpp b/Libraries/LibWeb/CSS/Frequency.cpp index fc02baa1207..c58bb71ec1b 100644 --- a/Libraries/LibWeb/CSS/Frequency.cpp +++ b/Libraries/LibWeb/CSS/Frequency.cpp @@ -79,12 +79,11 @@ Optional Frequency::unit_from_name(StringView name) Frequency Frequency::resolve_calculated(NonnullRefPtr const& calculated, Layout::Node const& layout_node, Frequency const& reference_value) { - return calculated->resolve_frequency_deprecated( - { - .percentage_basis = reference_value, - .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node), - }) - .value(); + CalculationResolutionContext context { + .percentage_basis = reference_value, + .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node), + }; + return calculated->resolve_frequency(context).value(); } } diff --git a/Libraries/LibWeb/CSS/Length.cpp b/Libraries/LibWeb/CSS/Length.cpp index 9dd8e0a0622..56133937b6d 100644 --- a/Libraries/LibWeb/CSS/Length.cpp +++ b/Libraries/LibWeb/CSS/Length.cpp @@ -431,22 +431,16 @@ Length Length::absolutized(CSSPixelRect const& viewport_rect, FontMetrics const& Length Length::resolve_calculated(NonnullRefPtr const& calculated, Layout::Node const& layout_node, Length const& reference_value) { - return calculated->resolve_length_deprecated( - { - .percentage_basis = reference_value, - .length_resolution_context = ResolutionContext::for_layout_node(layout_node), - }) - .value(); + CalculationResolutionContext context { + .percentage_basis = reference_value, + .length_resolution_context = ResolutionContext::for_layout_node(layout_node), + }; + return calculated->resolve_length(context).value(); } Length Length::resolve_calculated(NonnullRefPtr const& calculated, Layout::Node const& layout_node, CSSPixels reference_value) { - return calculated->resolve_length_deprecated( - { - .percentage_basis = make_px(reference_value), - .length_resolution_context = ResolutionContext::for_layout_node(layout_node), - }) - .value(); + return resolve_calculated(calculated, layout_node, make_px(reference_value)); } } diff --git a/Libraries/LibWeb/CSS/Time.cpp b/Libraries/LibWeb/CSS/Time.cpp index 6eb360555ff..57d0d4fbe5f 100644 --- a/Libraries/LibWeb/CSS/Time.cpp +++ b/Libraries/LibWeb/CSS/Time.cpp @@ -90,12 +90,11 @@ Optional Time::unit_from_name(StringView name) Time Time::resolve_calculated(NonnullRefPtr const& calculated, Layout::Node const& layout_node, Time const& reference_value) { - return calculated->resolve_time_deprecated( - { - .percentage_basis = reference_value, - .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node), - }) - .value(); + CalculationResolutionContext context { + .percentage_basis = reference_value, + .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node), + }; + return calculated->resolve_time(context).value(); } } diff --git a/Tests/LibWeb/Text/expected/clamp-negative-padding-in-calc.txt b/Tests/LibWeb/Text/expected/clamp-negative-padding-in-calc.txt new file mode 100644 index 00000000000..1c7e52db76a --- /dev/null +++ b/Tests/LibWeb/Text/expected/clamp-negative-padding-in-calc.txt @@ -0,0 +1,3 @@ +PASS Negative padding on element #one is clamped to zero. +PASS Negative padding on element #two is clamped to zero. +PASS Negative padding on element #three is clamped to zero. diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/round-mod-rem-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/round-mod-rem-computed.txt index 22714520331..18e5f9f1059 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-values/round-mod-rem-computed.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-values/round-mod-rem-computed.txt @@ -2,8 +2,8 @@ Harness status: OK Found 229 tests -215 Pass -14 Fail +217 Pass +12 Fail Pass round(10,10) should be used-value-equivalent to 10 Pass mod(1,1) should be used-value-equivalent to 0 Pass rem(1,1) should be used-value-equivalent to 0 @@ -121,8 +121,8 @@ Pass rem(10deg,6deg) should be used-value-equivalent to 4deg Pass rem(10grad,6grad) should be used-value-equivalent to 4grad Pass rem(10rad,6rad) should be used-value-equivalent to 4rad Pass rem(10turn,6turn) should be used-value-equivalent to 4turn -Fail round(10%,1px) should be used-value-equivalent to 8px -Fail round(10%,5px) should be used-value-equivalent to 10px +Pass round(10%,1px) should be used-value-equivalent to 8px +Pass round(10%,5px) should be used-value-equivalent to 10px Pass round(2rem,5px) should be used-value-equivalent to 30px Pass round(100px,1rem) should be used-value-equivalent to 96px Pass round(10s,6000ms) should be used-value-equivalent to 12s diff --git a/Tests/LibWeb/Text/input/clamp-negative-padding-in-calc.html b/Tests/LibWeb/Text/input/clamp-negative-padding-in-calc.html new file mode 100644 index 00000000000..dea44e651b4 --- /dev/null +++ b/Tests/LibWeb/Text/input/clamp-negative-padding-in-calc.html @@ -0,0 +1,27 @@ + + + +
This should not have padding.
+
Neither should this.
+
Or this.
+