Blink (and WebKit) currently accepts negative background-size. https://jsfiddle.net/ericwilligers/2wzwt55t/ Spec: Negative values are not allowed. https://drafts.csswg.org/css-backgrounds/#background-size Negative values should be rejected during parsing, and they should be clamped during animation. Also raised WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=183990
I will take this issue.
CL to add use counters: https://chromium-review.googlesource.com/c/chromium/src/+/984913
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/55816db5c7307cb87943dc09dfc2a79b91582422 commit 55816db5c7307cb87943dc09dfc2a79b91582422 Author: Eric Willigers <ericwilligers@chromium.org> Date: Thu Apr 05 18:10:56 2018 CSS: Use count negative background-size Add use counters for negative values in background-size and mask-size. Spec forbids negative background-size. https://drafts.csswg.org/css-backgrounds/#background-size Bug: 825549 Change-Id: I5415bd9123b86907665c552801fbeca4b587b1ea Reviewed-on: https://chromium-review.googlesource.com/984913 Commit-Queue: Eric Willigers <ericwilligers@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#548486} [add] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/LayoutTests/fast/css/usecounter-negative-background-size-longhand.html [add] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/LayoutTests/fast/css/usecounter-negative-background-size-shorthand.html [add] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/LayoutTests/fast/css/usecounter-negative-mask-size-longhand.html [add] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/LayoutTests/fast/css/usecounter-negative-mask-size-shorthand.html [modify] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/Source/core/css/properties/CSSParsingUtils.cpp [modify] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/Source/core/css/properties/CSSParsingUtils.h [modify] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/Source/core/css/properties/longhands/BackgroundSizeCustom.cpp [modify] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSizeCustom.cpp [modify] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/third_party/WebKit/public/platform/web_feature.mojom [modify] https://crrev.com/55816db5c7307cb87943dc09dfc2a79b91582422/tools/metrics/histograms/enums.xml
Use counters originally landed in M67, so setting a next action date of about two weeks following stable release of M67.
The NextAction date has arrived: 2018-06-15
The use counts are low and we can proceed to remove or deprecate/remove: negative background-size 0.005% https://www.chromestatus.com/metrics/feature/timeline/popularity/2402 negative mask-size 0% https://www.chromestatus.com/metrics/feature/timeline/popularity/2403
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/11c9826ad684a7e2d72f3cd2e6b1028ad837ec02 commit 11c9826ad684a7e2d72f3cd2e6b1028ad837ec02 Author: Zhuoyu Qian <zhuoyu.qian@samsung.com> Date: Tue Jul 03 08:47:40 2018 Background-size should not accept negative values. Follow the spec[1], negative values are not allowed. We should reject the negative values of background-size during parsing. [1]: https://drafts.csswg.org/css-backgrounds/#background-size Bug: 825549 Signed-off-by: Zhuoyu Qian <zhuoyu.qian@samsung.com> Change-Id: Ib260bafa421249aed471ff801c8b49a4b97aba1e Reviewed-on: https://chromium-review.googlesource.com/989529 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#572149} [add] https://crrev.com/11c9826ad684a7e2d72f3cd2e6b1028ad837ec02/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/background-size-with-negative-value.html [delete] https://crrev.com/d8269be5cd75e1c187125e25b091b9acd9de7f42/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/parsing/background-size-invalid-expected.txt [modify] https://crrev.com/11c9826ad684a7e2d72f3cd2e6b1028ad837ec02/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
Comment 1 by e...@chromium.org
, Mar 30 2018Status: Available (was: Untriaged)