LibWeb/CSS: Remove an ad-hoc simplification step in calc() parsing

This commit is contained in:
Lucas CHOLLET 2025-02-27 15:25:21 -07:00 committed by Sam Atkins
parent 715bf0de2c
commit 4bf197872b
Notes: github-actions[bot] 2025-03-05 12:06:57 +00:00
10 changed files with 84 additions and 92 deletions

View file

@ -3248,12 +3248,6 @@ RefPtr<CSSStyleValue> Parser::parse_calculated_value(ComponentValue const& compo
if (!function_node)
return nullptr;
// If the calculation got simplified down to a single value, return that instead.
if (function_node->type() == CalculationNode::Type::Numeric) {
if (auto number_value = as<NumericCalculationNode>(*function_node).to_style_value(context))
return number_value.release_nonnull();
}
auto function_type = function_node->numeric_type();
if (!function_type.has_value())
return nullptr;

View file

@ -4,19 +4,19 @@ animation-duration: 'calc(2s)' -> '2s'
animation-duration: 'calc(2s * var(--n))' -> '4s'
animation-iteration-count: 'calc(2)' -> '2'
animation-iteration-count: 'calc(2 * var(--n))' -> '4'
backdrop-filter: 'grayscale(calc(2%))' -> 'grayscale(2%)'
backdrop-filter: 'grayscale(calc(2% * var(--n)))' -> 'grayscale(4%)'
backdrop-filter: 'grayscale(calc(0.02))' -> 'grayscale(0.02)'
backdrop-filter: 'grayscale(calc(0.02 * var(--n)))' -> 'grayscale(0.04)'
background-position-x: 'calc(2px)' -> '2px'
background-position-x: 'calc(2px * var(--n))' -> '4px'
background-position-y: 'calc(2%)' -> '2%'
backdrop-filter: 'grayscale(calc(2%))' -> 'grayscale(calc(2%))'
backdrop-filter: 'grayscale(calc(2% * var(--n)))' -> 'grayscale(calc(4%))'
backdrop-filter: 'grayscale(calc(0.02))' -> 'grayscale(calc(0.02))'
backdrop-filter: 'grayscale(calc(0.02 * var(--n)))' -> 'grayscale(calc(0.04))'
background-position-x: 'calc(2px)' -> 'calc(2px)'
background-position-x: 'calc(2px * var(--n))' -> 'calc(4px)'
background-position-y: 'calc(2%)' -> 'calc(2%)'
background-position-y: 'calc(2% * var(--n))' -> 'calc(2 * 2%)'
background-size: 'calc(2px * var(--n)) calc(2%)' -> '4px 2%'
background-size: 'calc(2px * var(--n)) calc(2% * var(--n))' -> '4px calc(2 * 2%)'
border-bottom-left-radius: 'calc(2px)' -> '2px'
border-bottom-left-radius: 'calc(2px * var(--n))' -> '4px'
border-bottom-right-radius: 'calc(2%)' -> '2%'
background-size: 'calc(2px * var(--n)) calc(2%)' -> 'calc(4px) calc(2%)'
background-size: 'calc(2px * var(--n)) calc(2% * var(--n))' -> 'calc(4px) calc(2 * 2%)'
border-bottom-left-radius: 'calc(2px)' -> 'calc(2px)'
border-bottom-left-radius: 'calc(2px * var(--n))' -> 'calc(4px)'
border-bottom-right-radius: 'calc(2%)' -> 'calc(2%)'
border-bottom-right-radius: 'calc(2% * var(--n))' -> 'calc(2 * 2%)'
border-bottom-width: 'calc(2px)' -> '2px'
border-bottom-width: 'calc(2px * var(--n))' -> '4px'
@ -26,18 +26,18 @@ border-right-width: 'calc(2px)' -> '2px'
border-right-width: 'calc(2px * var(--n))' -> '4px'
border-spacing: 'calc(2px)' -> '2px'
border-spacing: 'calc(2px * var(--n))' -> '4px'
border-top-left-radius: 'calc(2px)' -> '2px'
border-top-left-radius: 'calc(2px * var(--n))' -> '4px'
border-top-right-radius: 'calc(2%)' -> '2%'
border-top-left-radius: 'calc(2px)' -> 'calc(2px)'
border-top-left-radius: 'calc(2px * var(--n))' -> 'calc(4px)'
border-top-right-radius: 'calc(2%)' -> 'calc(2%)'
border-top-right-radius: 'calc(2% * var(--n))' -> 'calc(2 * 2%)'
border-top-width: 'calc(2px)' -> '2px'
border-top-width: 'calc(2px * var(--n))' -> '4px'
bottom: 'calc(2px)' -> '2px'
bottom: 'calc(2px * var(--n))' -> '4px'
clip-path: 'polygon(calc(0px) calc(2px), calc(2px) calc(0px), calc(2px) calc(2px))' -> 'polygon(nonzero, 0px 2px, 2px 0px, 2px 2px)'
clip-path: 'polygon(calc(0px * var(--n)) calc(2px * var(--n)), calc(2px * var(--n)) calc(0px * var(--n)), calc(2px * var(--n)) calc(2px * var(--n)))' -> 'polygon(nonzero, 0px 4px, 4px 0px, 4px 4px)'
clip-path: 'polygon(calc(0%) calc(2%), calc(2%) calc(0%), calc(2%) calc(2%))' -> 'polygon(nonzero, 0% 2%, 2% 0%, 2% 2%)'
clip-path: 'polygon(calc(0% * var(--n)) calc(2% * var(--n)), calc(2% * var(--n)) calc(0% * var(--n)), calc(2% * var(--n)) calc(2% * var(--n)))' -> 'polygon(nonzero, 0% 4%, 4% 0%, 4% 4%)'
clip-path: 'polygon(calc(0px) calc(2px), calc(2px) calc(0px), calc(2px) calc(2px))' -> 'polygon(nonzero, calc(0px) calc(2px), calc(2px) calc(0px), calc(2px) calc(2px))'
clip-path: 'polygon(calc(0px * var(--n)) calc(2px * var(--n)), calc(2px * var(--n)) calc(0px * var(--n)), calc(2px * var(--n)) calc(2px * var(--n)))' -> 'polygon(nonzero, calc(0px) calc(4px), calc(4px) calc(0px), calc(4px) calc(4px))'
clip-path: 'polygon(calc(0%) calc(2%), calc(2%) calc(0%), calc(2%) calc(2%))' -> 'polygon(nonzero, calc(0%) calc(2%), calc(2%) calc(0%), calc(2%) calc(2%))'
clip-path: 'polygon(calc(0% * var(--n)) calc(2% * var(--n)), calc(2% * var(--n)) calc(0% * var(--n)), calc(2% * var(--n)) calc(2% * var(--n)))' -> 'polygon(nonzero, calc(0%) calc(4%), calc(4%) calc(0%), calc(4%) calc(4%))'
column-count: 'calc(2)' -> '2'
column-count: 'calc(2 * var(--n))' -> '4'
column-gap: 'calc(2px)' -> '2px'
@ -56,10 +56,10 @@ cy: 'calc(2%)' -> '2%'
cy: 'calc(2% * var(--n))' -> 'calc(2 * 2%)'
fill-opacity: 'calc(2)' -> '2'
fill-opacity: 'calc(2 * var(--n))' -> '4'
filter: 'grayscale(calc(2%))' -> 'grayscale(2%)'
filter: 'grayscale(calc(2% * var(--n)))' -> 'grayscale(4%)'
filter: 'grayscale(calc(0.02))' -> 'grayscale(0.02)'
filter: 'grayscale(calc(0.02 * var(--n)))' -> 'grayscale(0.04)'
filter: 'grayscale(calc(2%))' -> 'grayscale(calc(2%))'
filter: 'grayscale(calc(2% * var(--n)))' -> 'grayscale(calc(4%))'
filter: 'grayscale(calc(0.02))' -> 'grayscale(calc(0.02))'
filter: 'grayscale(calc(0.02 * var(--n)))' -> 'grayscale(calc(0.04))'
flex-basis: 'calc(2px)' -> '2px'
flex-basis: 'calc(2px * var(--n))' -> '4px'
flex-grow: 'calc(2)' -> '2'
@ -94,11 +94,11 @@ line-height: 'calc(2)' -> '32px'
line-height: 'calc(2 * var(--n))' -> '64px'
margin-bottom: 'calc(2px)' -> '2px'
margin-bottom: 'calc(2px * var(--n))' -> '4px'
margin-left: 'calc(2%)' -> '15.67188px'
margin-left: 'calc(2%)' -> '15.6875px'
margin-left: 'calc(2% * var(--n))' -> '31.375px'
margin-right: 'calc(2px)' -> '2px'
margin-right: 'calc(2px * var(--n))' -> '4px'
margin-top: 'calc(2%)' -> '15.67188px'
margin-top: 'calc(2%)' -> '15.6875px'
margin-top: 'calc(2% * var(--n))' -> '31.375px'
math-depth: 'calc(2)' -> '2'
math-depth: 'calc(2 * var(--n))' -> '4'
@ -120,11 +120,11 @@ outline-width: 'calc(2px)' -> '2px'
outline-width: 'calc(2px * var(--n))' -> '4px'
padding-bottom: 'calc(2px)' -> '2px'
padding-bottom: 'calc(2px * var(--n))' -> '4px'
padding-left: 'calc(2%)' -> '15.67188px'
padding-left: 'calc(2%)' -> '15.6875px'
padding-left: 'calc(2% * var(--n))' -> '31.375px'
padding-right: 'calc(2px)' -> '2px'
padding-right: 'calc(2px * var(--n))' -> '4px'
padding-top: 'calc(2%)' -> '15.67188px'
padding-top: 'calc(2%)' -> '15.6875px'
padding-top: 'calc(2% * var(--n))' -> '31.375px'
r: 'calc(2px)' -> '2px'
r: 'calc(2px * var(--n))' -> '4px'
@ -158,7 +158,7 @@ transition-duration: 'calc(2s)' -> '2s'
transition-duration: 'calc(2s * var(--n))' -> '4s'
vertical-align: 'calc(2px)' -> '2px'
vertical-align: 'calc(2px * var(--n))' -> '4px'
width: 'calc(2%)' -> '15.67188px'
width: 'calc(2%)' -> '15.6875px'
width: 'calc(2% * var(--n))' -> '31.375px'
word-spacing: 'calc(2px)' -> '2px'
word-spacing: 'calc(2px * var(--n))' -> '4px'

View file

@ -2,8 +2,7 @@ Harness status: OK
Found 306 tests
279 Pass
27 Fail
306 Pass
Pass e.style['color'] = "color(srgb 0% 0% 0%)" should set the property value
Pass e.style['color'] = "color(srgb 10% 10% 10%)" should set the property value
Pass e.style['color'] = "color(srgb .2 .2 25%)" should set the property value
@ -24,9 +23,9 @@ Pass e.style['color'] = "color(srgb -200 -200 -200 / -200)" should set the prope
Pass e.style['color'] = "color(srgb 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(srgb 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(srgb -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(srgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(srgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(srgb calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(srgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(srgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(srgb calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(srgb none none none / none)" should set the property value
Pass e.style['color'] = "color(srgb none none none)" should set the property value
Pass e.style['color'] = "color(srgb 10% none none / none)" should set the property value
@ -58,9 +57,9 @@ Pass e.style['color'] = "color(srgb-linear -200 -200 -200 / -200)" should set th
Pass e.style['color'] = "color(srgb-linear 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(srgb-linear 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(srgb-linear -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(srgb-linear calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(srgb-linear calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(srgb-linear calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(srgb-linear calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(srgb-linear calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(srgb-linear calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(srgb-linear none none none / none)" should set the property value
Pass e.style['color'] = "color(srgb-linear none none none)" should set the property value
Pass e.style['color'] = "color(srgb-linear 10% none none / none)" should set the property value
@ -92,9 +91,9 @@ Pass e.style['color'] = "color(a98-rgb -200 -200 -200 / -200)" should set the pr
Pass e.style['color'] = "color(a98-rgb 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(a98-rgb 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(a98-rgb -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(a98-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(a98-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(a98-rgb calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(a98-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(a98-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(a98-rgb calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(a98-rgb none none none / none)" should set the property value
Pass e.style['color'] = "color(a98-rgb none none none)" should set the property value
Pass e.style['color'] = "color(a98-rgb 10% none none / none)" should set the property value
@ -126,9 +125,9 @@ Pass e.style['color'] = "color(rec2020 -200 -200 -200 / -200)" should set the pr
Pass e.style['color'] = "color(rec2020 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(rec2020 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(rec2020 -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(rec2020 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(rec2020 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(rec2020 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(rec2020 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(rec2020 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(rec2020 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(rec2020 none none none / none)" should set the property value
Pass e.style['color'] = "color(rec2020 none none none)" should set the property value
Pass e.style['color'] = "color(rec2020 10% none none / none)" should set the property value
@ -160,9 +159,9 @@ Pass e.style['color'] = "color(prophoto-rgb -200 -200 -200 / -200)" should set t
Pass e.style['color'] = "color(prophoto-rgb 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(prophoto-rgb 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(prophoto-rgb -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(prophoto-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(prophoto-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(prophoto-rgb calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(prophoto-rgb calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(prophoto-rgb calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(prophoto-rgb calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(prophoto-rgb none none none / none)" should set the property value
Pass e.style['color'] = "color(prophoto-rgb none none none)" should set the property value
Pass e.style['color'] = "color(prophoto-rgb 10% none none / none)" should set the property value
@ -194,9 +193,9 @@ Pass e.style['color'] = "color(display-p3 -200 -200 -200 / -200)" should set the
Pass e.style['color'] = "color(display-p3 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(display-p3 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(display-p3 -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(display-p3 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(display-p3 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(display-p3 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(display-p3 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(display-p3 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(display-p3 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(display-p3 none none none / none)" should set the property value
Pass e.style['color'] = "color(display-p3 none none none)" should set the property value
Pass e.style['color'] = "color(display-p3 10% none none / none)" should set the property value
@ -228,9 +227,9 @@ Pass e.style['color'] = "color(xyz -200 -200 -200 / -200)" should set the proper
Pass e.style['color'] = "color(xyz 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(xyz 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(xyz -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(xyz calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(xyz calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(xyz calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(xyz calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(xyz calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(xyz calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(xyz none none none / none)" should set the property value
Pass e.style['color'] = "color(xyz none none none)" should set the property value
Pass e.style['color'] = "color(xyz 10% none none / none)" should set the property value
@ -262,9 +261,9 @@ Pass e.style['color'] = "color(xyz-d50 -200 -200 -200 / -200)" should set the pr
Pass e.style['color'] = "color(xyz-d50 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(xyz-d50 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(xyz-d50 -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(xyz-d50 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(xyz-d50 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(xyz-d50 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(xyz-d50 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(xyz-d50 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(xyz-d50 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(xyz-d50 none none none / none)" should set the property value
Pass e.style['color'] = "color(xyz-d50 none none none)" should set the property value
Pass e.style['color'] = "color(xyz-d50 10% none none / none)" should set the property value
@ -296,9 +295,9 @@ Pass e.style['color'] = "color(xyz-d65 -200 -200 -200 / -200)" should set the pr
Pass e.style['color'] = "color(xyz-d65 200% 200% 200%)" should set the property value
Pass e.style['color'] = "color(xyz-d65 200% 200% 200% / 200%)" should set the property value
Pass e.style['color'] = "color(xyz-d65 -200% -200% -200% / -200%)" should set the property value
Fail e.style['color'] = "color(xyz-d65 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Fail e.style['color'] = "color(xyz-d65 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Fail e.style['color'] = "color(xyz-d65 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(xyz-d65 calc(0.5 + 1) calc(0.5 - 1) calc(0.5) / calc(-0.5 + 1))" should set the property value
Pass e.style['color'] = "color(xyz-d65 calc(50% * 3) calc(-150% / 3) calc(50%) / calc(-50% * 3))" should set the property value
Pass e.style['color'] = "color(xyz-d65 calc(50%) 50% 0.5)" should set the property value
Pass e.style['color'] = "color(xyz-d65 none none none / none)" should set the property value
Pass e.style['color'] = "color(xyz-d65 none none none)" should set the property value
Pass e.style['color'] = "color(xyz-d65 10% none none / none)" should set the property value

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 15 tests
10 Pass
5 Fail
14 Pass
1 Fail
Pass e.style['font-stretch'] = "normal" should set the property value
Pass e.style['font-stretch'] = "ultra-condensed" should set the property value
Pass e.style['font-stretch'] = "extra-condensed" should set the property value
@ -14,8 +14,8 @@ Pass e.style['font-stretch'] = "expanded" should set the property value
Pass e.style['font-stretch'] = "extra-expanded" should set the property value
Pass e.style['font-stretch'] = "ultra-expanded" should set the property value
Pass e.style['font-stretch'] = "234.5%" should set the property value
Fail e.style['font-stretch'] = "calc(100%)" should set the property value
Fail e.style['font-stretch'] = "calc(0%)" should set the property value
Fail e.style['font-stretch'] = "calc(-100%)" should set the property value
Fail e.style['font-stretch'] = "calc(100% + 100%)" should set the property value
Pass e.style['font-stretch'] = "calc(100%)" should set the property value
Pass e.style['font-stretch'] = "calc(0%)" should set the property value
Pass e.style['font-stretch'] = "calc(-100%)" should set the property value
Pass e.style['font-stretch'] = "calc(100% + 100%)" should set the property value
Fail e.style['font-stretch'] = "calc(100% + (sign(20cqw - 10px) * 5%))" should set the property value

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 22 tests
17 Pass
5 Fail
21 Pass
1 Fail
Pass e.style['font-weight'] = "normal" should set the property value
Pass e.style['font-weight'] = "bold" should set the property value
Pass e.style['font-weight'] = "bolder" should set the property value
@ -21,8 +21,8 @@ Pass e.style['font-weight'] = "900" should set the property value
Pass e.style['font-weight'] = "1000" should set the property value
Pass e.style['font-weight'] = "101" should set the property value
Pass e.style['font-weight'] = "150.25" should set the property value
Fail e.style['font-weight'] = "calc(100)" should set the property value
Fail e.style['font-weight'] = "calc(0)" should set the property value
Fail e.style['font-weight'] = "calc(-100)" should set the property value
Fail e.style['font-weight'] = "calc(100 + 100)" should set the property value
Pass e.style['font-weight'] = "calc(100)" should set the property value
Pass e.style['font-weight'] = "calc(0)" should set the property value
Pass e.style['font-weight'] = "calc(-100)" should set the property value
Pass e.style['font-weight'] = "calc(100 + 100)" should set the property value
Fail e.style['font-weight'] = "calc(100 + (sign(20cqw - 10px) * 5))" should set the property value

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 40 tests
23 Pass
17 Fail
24 Pass
16 Fail
Pass Test getting grid-template-columns and grid-template-rows set through CSS for element 'gridWithFixedElement' : grid-template-columns = '7px 11px', grid-template-rows = '17px 2px'
Pass Test getting grid-template-columns and grid-template-rows set through CSS for element 'gridWithPercentElement' : grid-template-columns = '400px 800px', grid-template-rows = '150px 450px'
Fail Test getting grid-template-columns and grid-template-rows set through CSS for element 'gridWithPercentWithoutSize' : grid-template-columns = '3.5px 7px', grid-template-rows = '4px 12px'
@ -28,7 +28,7 @@ Pass Test getting and setting grid-template-rows and grid-template-columns throu
Pass Test getting and setting grid-template-rows and grid-template-columns through JS: grid-template-columns = '0px 160px 22px', element.style.gridTemplateColumns = 'auto 16em 22px', grid-template-rows = '336px 100px 0px', element.style.gridTemplateRows = '56% 10em auto'
Pass Test getting and setting grid-template-rows and grid-template-columns through JS: grid-template-columns = '160px 20px', element.style.gridTemplateColumns = '16em minmax(16px, 20px)', grid-template-rows = '90px 0px', element.style.gridTemplateRows = 'minmax(10%, 15%) auto'
Pass Test getting and setting grid-template-rows and grid-template-columns through JS: grid-template-columns = '160px 640px', element.style.gridTemplateColumns = '16em 2fr', grid-template-rows = '600px 0px', element.style.gridTemplateRows = '14fr auto'
Fail Test getting and setting grid-template-rows and grid-template-columns through JS: grid-template-columns = '25px 20px', element.style.gridTemplateColumns = 'calc(25px) calc(2em)', grid-template-rows = '0px 60px', element.style.gridTemplateRows = 'auto calc(10%)'
Pass Test getting and setting grid-template-rows and grid-template-columns through JS: grid-template-columns = '25px 20px', element.style.gridTemplateColumns = 'calc(25px) calc(2em)', grid-template-rows = '0px 60px', element.style.gridTemplateRows = 'auto calc(10%)'
Pass Test getting and setting grid-template-rows and grid-template-columns through JS: grid-template-columns = '345px 92px', element.style.gridTemplateColumns = 'calc(25px + 40%) minmax(min-content, calc(10% + 12px))', grid-template-rows = '100px 0px', element.style.gridTemplateRows = 'minmax(calc(75% - 350px), max-content) auto'
Fail Test setting wrong/invalid values through CSS
Fail Test setting bad JS values: grid-template-columns = 'none auto', grid-template-rows = 'none auto'

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 40 tests
4 Pass
36 Fail
5 Pass
35 Fail
Fail e.style['grid-template'] = "none" should set the property value
Fail e.style['grid-template'] = "none / none" should set the property value
Pass e.style['grid-template'] = "auto / auto" should set the property value
@ -32,7 +32,7 @@ Fail e.style['grid-template'] = "\"a\" [a] [b] \"b\"" should set the property va
Fail e.style['grid-template'] = "\"a\" [a] \"b\"" should set the property value
Fail e.style['grid-template'] = "\"a\" / 0" should set the property value
Pass e.style['grid-template'] = "\"a\" 10px / 10px" should set the property value
Fail e.style['grid-template'] = "\"a\" calc(100% - 10px) / calc(10px)" should set the property value
Pass e.style['grid-template'] = "\"a\" calc(100% - 10px) / calc(10px)" should set the property value
Fail e.style['grid-template'] = "\"a\" [a] \"b\" 10px" should set the property value
Fail e.style['grid-template'] = "\"a\" [a] \"b\" 10px [a]" should set the property value
Fail e.style['grid-template'] = "\"a\" [a] [a] \"b\" 10px" should set the property value

View file

@ -2,8 +2,7 @@ Harness status: OK
Found 24 tests
21 Pass
3 Fail
24 Pass
Pass testing calc(1vh + 2px + 3%)
Pass testing calc(4px + 1vh)
Pass testing calc(5px + 6em + 1vh)
@ -19,12 +18,12 @@ Pass testing calc(4vmin + 0pt)
Pass testing calc(100% - 100% + 1em)
Pass testing calc(100% + 1em - 100%)
Pass testing calc(1vh - 7px)
Fail testing calc(5ex - 9ex)
Fail testing calc(-80px + 25.4mm)
Pass testing calc(5ex - 9ex)
Pass testing calc(-80px + 25.4mm)
Pass testing calc(2 * (10px + 1rem))
Pass testing calc(2 * (10px - 1rem))
Pass testing calc((10px + 1rem) / 2)
Pass testing calc(2 * (min(10px, 20%) + max(1rem, 2%)))
Pass testing calc((min(10px, 20%) + max(1rem, 2%)) * 2)
Pass testing calc(1vmin - 14%)
Fail testing calc(4 * 3px + 4pc / 8)
Pass testing calc(4 * 3px + 4pc / 8)

View file

@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
1 Fail
Fail calc() serialization
1 Pass
Pass calc() serialization

View file

@ -2,8 +2,8 @@ Harness status: OK
Found 126 tests
124 Pass
2 Fail
122 Pass
4 Fail
Pass new DOMMatrix()
Pass new DOMMatrix(undefined)
Pass new DOMMatrix(new DOMMatrix())
@ -23,7 +23,7 @@ Pass new DOMMatrix(sequence) 6 elements
Pass new DOMMatrix("scale(2) translateX(5px) translateY(5px)")
Pass new DOMMatrix("scale(2, 2) translateX(5px) translateY(5px)")
Pass new DOMMatrix("scale(2)translateX(5px)translateY(5px)")
Pass new DOMMatrix("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
Fail new DOMMatrix("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
Pass new DOMMatrix("scale(2) translateX(5px) translateY(5px) rotate(5deg) rotate(-5deg)")
Pass new DOMMatrix("translateX (5px)")
Pass new DOMMatrix("scale(2 2) translateX(5) translateY(5)")
@ -86,7 +86,7 @@ Pass new DOMMatrixReadOnly(sequence) 6 elements
Pass new DOMMatrixReadOnly("scale(2) translateX(5px) translateY(5px)")
Pass new DOMMatrixReadOnly("scale(2, 2) translateX(5px) translateY(5px)")
Pass new DOMMatrixReadOnly("scale(2)translateX(5px)translateY(5px)")
Pass new DOMMatrixReadOnly("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
Fail new DOMMatrixReadOnly("scale(2) translateX(calc(2 * 2.5px)) translateY(5px)")
Pass new DOMMatrixReadOnly("scale(2) translateX(5px) translateY(5px) rotate(5deg) rotate(-5deg)")
Pass new DOMMatrixReadOnly("translateX (5px)")
Pass new DOMMatrixReadOnly("scale(2 2) translateX(5) translateY(5)")