Skip to content

Commit

Permalink
Bug 1869602 [wpt PR 43631] - Support number producing css math functi…
Browse files Browse the repository at this point in the history
…ons in ConvertScale, a=testonly

Automatic update from web-platform-tests
Support number producing css math functions in ConvertScale

Currently, StyleBuilderConverter::ConvertScale directly calls
GetDoubleValue() which is incorrect for math functions, rewrite it
to use ComputeNumber with CssToLengthConversionData instead.

Note: the crash is due to the parse time percent resolution in
ConsumeNumberOrPercent, which doesn't work with math functions yet.
It will be fixed in the following CL, meanwhile the added test case
covers the changed functionality.

Bug: 1505817
Change-Id: Icf553423d09b9ff71ebc3b625c06e10fec637352
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5116383
Commit-Queue: Daniil Sakhapov <[email protected]>
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1237458}

--

wpt-commits: 26441c2d67e8807e676ed55270e1e9ec4002e306
wpt-pr: 43631
  • Loading branch information
danielsakhapov authored and moz-wptsync-bot committed Dec 15, 2023
1 parent 876e87e commit c8c154a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@
test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 30)', '60', {prop:'flex-grow', type:'number'});
test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) / 4)', '0.5', {prop:'flex-grow', type:'number'});
test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 4)', '8', {prop:'column-count', type:'number'});
test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 2)', '4', {prop:'scale'});
</script>

0 comments on commit c8c154a

Please sign in to comment.