Skip to content

Commit

Permalink
Bug 1838625 [wpt PR 40567] - Fix wpt tests for css math functions to …
Browse files Browse the repository at this point in the history
…handle NaN and infinity, a=testonly

Automatic update from web-platform-tests
Fix wpt tests for css math functions to handle NaN and infinity (#40567)

Change tests results to see that NaN goes to 0 on top-level as per:
https://drafts.csswg.org/css-values-4/#top-level-calculation

And correctly handle the infinity expectations. Remove -infinity for
matrix as it can't round-trip.

Reviewed: web-platform-tests/wpt#40567
Discussed: web-platform-tests/interop#337

Change-Id: I4a0a7273c9e82a7f6e21b3bf8ed877b62076e3d3

Co-authored-by: Daniil Sakhapov <sakhapovchromium.org>
--

wpt-commits: 4e1fc86b7e59919575c9832142e8d81217b3ff02
wpt-pr: 40567

UltraBlame original commit: be20ef0ed97bfd3bebfe2cf91cb8965e9cc88ec4
  • Loading branch information
marco-c committed Jul 16, 2023
1 parent 69faa46 commit 078eed3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions testing/web-platform/tests/css/css-values/exp-log-serialize.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
'calc(log(1) + 0.5)',
'calc(0.5)',
'0.5');
test_serialization(
'calc(log(0))',
'calc(-infinity)',
'-infinity');

const t = 'calc(log(0))';
const s = 'calc(-infinity)';
const c = '0';
test_specified_serialization('opacity', t, s);
test_specified_serialization('transform', `scale(${t})`, `scale(${s})`);
test_computed_serialization('opacity', t, c);
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script>
function test_serialization(t,s,c) {
test_specified_serialization('opacity', t, s);
test_specified_serialization('transform', `scale(${t})`, `scale(calc(${c}))`);
test_specified_serialization('transform', `scale(${t})`, `scale(${s})`);
test_computed_serialization('opacity', t, c);
test_computed_serialization('transform', `scale(${t})`, `matrix(${c}, 0, 0, ${c}, 0, 0)`);
}
Expand All @@ -32,13 +32,13 @@
test_serialization(
'calc(round(1,0))',
'calc(NaN)',
'NaN');
'0');
test_serialization(
'calc(mod(1,0))',
'calc(NaN)',
'NaN');
'0');
test_serialization(
'calc(rem(1,0))',
'calc(NaN)',
'NaN');
'0');
</script>

0 comments on commit 078eed3

Please sign in to comment.