New issue
Advanced search Search tips

Issue 727195 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

CSS: Reject unitless 0 angles in modern features

Project Member Reported by ericwilligers@chromium.org, May 29 2017

Issue description

A recent spec change means that 0 is no longer supported as a valid value for angles.
https://github.com/w3c/csswg-drafts/issues/1162#issuecomment-293637767

Linear gradients, like CSS transform, are an exception and are explicitly specified
to support unitless 0, to avoid breaking existing pages:
https://drafts.csswg.org/css-images-3/#linear-gradients
https://drafts.csswg.org/css-transforms/#valdef-transform-rotate

Conic gradients, being a new feature that has not yet shipped in browsers, should
only support angles with explicit units.
https://drafts.csswg.org/css-images-4/#conic-gradients

We should also deprecate and remove support for unitless zero angles in
- offset-rotate
- filter hue-rotate()
- animation of angle values in custom properties

This avoids an ambiguity when parsing the offset property:
offset: path('...') 0;
Is offset-distance or offset-rotate being set to 0? offset-distance.



 
Project Member

Comment 1 by bugdroid1@chromium.org, May 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3410f5c72de0fecf8772dbeeee95514e57c4cb0

commit a3410f5c72de0fecf8772dbeeee95514e57c4cb0
Author: ericwilligers <ericwilligers@chromium.org>
Date: Tue May 30 16:50:22 2017

CSS Conic Gradients: do not support unitless 0 angles

A recent spec change means that 0 is no longer supported as a valid value for angles.
https://github.com/w3c/csswg-drafts/issues/1162#issuecomment-293637767

Linear gradients, like CSS transform, are an exception and are explicitly specified
to support unitless 0, to avoid breaking existing pages:
https://drafts.csswg.org/css-images-3/#linear-gradients
https://drafts.csswg.org/css-transforms/#valdef-transform-rotate

Conic gradients, being a new feature that has not yet shipped in browsers, should
only support angles with explicit units.
https://drafts.csswg.org/css-images-4/#conic-gradients

We update the parsing of conic gradients to reject unitless 0 angles.

BUG= 727195 

Review-Url: https://codereview.chromium.org/2908053002
Cr-Commit-Position: refs/heads/master@{#475562}

[modify] https://crrev.com/a3410f5c72de0fecf8772dbeeee95514e57c4cb0/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-gradient.html
[modify] https://crrev.com/a3410f5c72de0fecf8772dbeeee95514e57c4cb0/third_party/WebKit/LayoutTests/fast/gradients/conic-gradient-parsing.html
[modify] https://crrev.com/a3410f5c72de0fecf8772dbeeee95514e57c4cb0/third_party/WebKit/LayoutTests/fast/gradients/conic-gradient-positioning.html
[modify] https://crrev.com/a3410f5c72de0fecf8772dbeeee95514e57c4cb0/third_party/WebKit/LayoutTests/fast/gradients/conic-gradient.html
[modify] https://crrev.com/a3410f5c72de0fecf8772dbeeee95514e57c4cb0/third_party/WebKit/LayoutTests/fast/gradients/repeating-conic-gradient.html
[modify] https://crrev.com/a3410f5c72de0fecf8772dbeeee95514e57c4cb0/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp

Project Member

Comment 3 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ecd2115cc793eddb9e1abc518a1b6388130a61a2

commit ecd2115cc793eddb9e1abc518a1b6388130a61a2
Author: ericwilligers <ericwilligers@chromium.org>
Date: Tue Jun 06 20:42:59 2017

CSS: Remove support for unitless 0 angles in offset-rotate

Angles in offset-rotate must specify units.
https://github.com/w3c/csswg-drafts/issues/1162#issuecomment-293637767

Discussed in Intent:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/mP-bj7jCyvM/UChplbzpBgAJ

Bug:  727195 
Change-Id: Iac2e641b3a35c92bdf26e441d52d520469ef3ee6
Reviewed-on: https://chromium-review.googlesource.com/522483
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Rune Lillesveen <rune@opera.com>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477398}
[add] https://crrev.com/ecd2115cc793eddb9e1abc518a1b6388130a61a2/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/parsing/offset-parsing-invalid.html
[add] https://crrev.com/ecd2115cc793eddb9e1abc518a1b6388130a61a2/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/parsing/offset-parsing-valid.html
[delete] https://crrev.com/b57fe51214e15f834fbcb8c68684ce07d2397bf0/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/parsing/offset-rotate-parsing-invalid-expected.txt
[delete] https://crrev.com/b57fe51214e15f834fbcb8c68684ce07d2397bf0/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-offset-rotate.html
[modify] https://crrev.com/ecd2115cc793eddb9e1abc518a1b6388130a61a2/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
[modify] https://crrev.com/ecd2115cc793eddb9e1abc518a1b6388130a61a2/third_party/WebKit/public/platform/UseCounterFeature.def

Owner: ----
Status: Available (was: Started)
Only filter hue-rotate() remains.

We will receive use counter data when M60 reaches stable.

Status: Fixed (was: Available)
The spec for filter hue-rotate() has been updated to support unitless zero.
https://github.com/w3c/fxtf-drafts/issues/228

Owner: ericwilligers@chromium.org

Sign in to add a comment