fune/testing/web-platform/tests/css/css-values/calc-invalid-parsing.html
Fredrik Söderquist c633cd7596 Bug 1839875 [wpt PR 40697] - Rework the parsing of the rounding strategy for round(), a=testonly
Automatic update from web-platform-tests
Rework the parsing of the rounding strategy for round()

Handling/parsing the rounding strategy in ParseValue() means that it
could appear anywhere a value could, although it is only allowed at
position 0 in the round() operation. This could lead to crashes if it
is specified outside of round().

Parse the rounding strategy value explicitly instead to reduce the scope
in which it can appear.

Bug: 1407473
Change-Id: If1bf9b43a3854c89174c3c009f7d833cf8dfa4ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4633258
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniil Sakhapov <sakhapov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1161194}

--

wpt-commits: b2c76adeaf48bcae75cd587641ee7aa7342a1998
wpt-pr: 40697
2023-07-06 08:20:43 +00:00

12 lines
544 B
HTML

<!doctype html>
<title>Invalid calc() expressions</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../support/parsing-testcommon.js"></script>
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-syntax">
<script>
test_invalid_value('transform', 'rotate(calc((0.25turn error)))');
test_invalid_value('width', 'calc(7px * up)');
test_invalid_value('width', 'round(nearest, 1px, 1px, 1px)');
test_invalid_value('width', 'round(nearest, 1px)');
</script>