Closed Bug 1565145 Opened 6 years ago Closed 6 years ago

[wpt-sync] Sync PR 17741 - Handle non-negativeness of blur radius properly

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

Handle non-negativeness of blur radius properly

Spec on blur radius says [1]:

"... Specifies the blur radius. Negative values are not allowed."

Current implementation performs parse time range check, which is
incorrect as calc() doesn't always have a double value. And spec
requires clamping instead of parse time check for calc() [2]:

"Parse-time range-checking of values is not performed within math
functions, and therefore out-of-range values do not cause the
declaration to become invalid. However, the value resulting from
an expression must be clamped to the range allowed in the target
context."

This patch changes it to pass |kValueRangeNonNegative| to
|ConsumeLength| as it handles non-negative calc() more properly.

This is also preparation for adding DCHECK into GetDoubleValue() to
avoid calling it on calc() without a double value.

[1] https://drafts.csswg.org/css-backgrounds-3/#shadow-blur-radius
[2] https://drafts.csswg.org/css-values-4/#calc-range

Bug: 979895
Change-Id: Ia8c36641f4ec4111ecf5a94a6ffc6eaacf22049c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1691747
Reviewed-by: Emil A Eklund \<eae@chromium.org>
Commit-Queue: Xiaocheng Hu \<xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675815}

Component: web-platform-tests → Layout
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Type: -- → task
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/mozilla-inbound/rev/d7a4de67a475 [wpt PR 17741] - Handle non-negativeness of blur radius properly, a=testonly
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.