fune/testing/web-platform/tests/css/css-values/negative-calc-to-non-negative-integer-ref.html
Joonghun Park 8cd0dd2aaf Bug 1754153 [wpt PR 32742] - Make css_parsing_utils::ConsumeInteger() clamp negative calc() to 0., a=testonly
Automatic update from web-platform-tests
Make css_parsing_utils::ConsumeInteger() clamp negative calc() to 0.

When parsing a non-negative integer, if the given value is calc() that evaluates to a negative number,
the value should be valid at parse-time and clamped to 0 at computed/used time.

In this CL, we add kNonNegativeIntegers enum entry to CSSPrimitiveValue::ValueRange
and use it in CSSMathFunctionValue::ClampToPermittedRange.

Bug: 1295078
Change-Id: Ic12de0e234a798cc22221856b402fd83332137b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3446701
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: 박중헌 <pjh0718@gmail.com>
Cr-Commit-Position: refs/heads/main@{#968639}

--

wpt-commits: e6bb9e18b2c8bb5ef8eba5a9f8b8efae553ad522
wpt-pr: 32742
2022-03-07 14:48:42 +00:00

15 lines
330 B
HTML

<!doctype html>
<title>CSS Test reference</title>
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<style>
@counter-style foo {
system: additive;
additive-symbols: 1 'I', 0 'X';
range: infinite infinite;
}
</style>
<ol style="list-style-type: foo" start=-1>
<li></li>
<li></li>
<li></li>
</ol>