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/+/1691747Reviewed-by:Emil A Eklund <eae@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#675815}
Showing
Please register or sign in to comment