Closed Bug 1754153 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 32742 - Make css_parsing_utils::ConsumeInteger() clamp negative calc() to 0.

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 32742 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/32742
Details from upstream follow.

Joonghun Park <pjh0718@gmail.com> wrote:

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/3446701
WPT-Export-Revision: ca2a95e92c53d5effaf721d1310a5a66b32f7e1f

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08bce753ff02 [wpt PR 32742] - Make css_parsing_utils::ConsumeInteger() clamp negative calc() to 0., a=testonly https://hg.mozilla.org/integration/autoland/rev/69f072c2295b [wpt PR 32742] - Update wpt metadata, a=testonly
Test result changes from PR not available.
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1bc546154028 [wpt PR 32742] - Make css_parsing_utils::ConsumeInteger() clamp negative calc() to 0., a=testonly https://hg.mozilla.org/integration/autoland/rev/985f027450c3 [wpt PR 32742] - Update wpt metadata, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
You need to log in before you can comment on or make changes to this bug.