New issue
Advanced search Search tips

Issue 725382 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

CSS: Use count literal 0 supplied as angle

Project Member Reported by ericwilligers@chromium.org, May 23 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

We should add use counters before retiring support for 0 from the following properties:

filter https://drafts.fxtf.org/filters/#FilterProperty

gradients (linear and conic) containing angles
https://drafts.csswg.org/css-images-3/#funcdef-linear-gradient
https://drafts.csswg.org/css-images-4/#conic-gradients
(used in https://drafts.csswg.org/css-backgrounds-3/#the-background-image and also -webkit-mask-image https://drafts.fxtf.org/css-masking-1/#the-mask-image where angle support is not shipping)

image-orientation https://drafts.csswg.org/css-images-3/#the-image-orientation (not present in CSS Images 4, not shipping, can perhaps be retired from the codebase)

offset-path https://drafts.fxtf.org/motion-1/#offset-path-property (can be changed immediately as ray paths have not shipped)

offset-rotate https://drafts.fxtf.org/motion-1/#offset-rotate-property (can most likely be changed immediately as few pages are positioning elements using motion path https://www.chromestatus.com/metrics/feature/timeline/popularity/1616)

rotate https://drafts.csswg.org/css-transforms-2/#propdef-rotate 

Note the rotate* and skew* functions of transform are not affected as they are specified to accept either an angle or the literal '0':
transform https://drafts.csswg.org/css-transforms-1/#transform-property https://drafts.csswg.org/css-transforms-1/#typedef-transform-function https://drafts.csswg.org/css-transforms-2/#three-d-transform-functions 



 
Project Member

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

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

commit e24202c3b5752cb040117fe5ae0247c27089766c
Author: ericwilligers <ericwilligers@chromium.org>
Date: Thu May 25 06:04:27 2017

CSS: Use count unitless 0 supplied as <angle>

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

We add use counters to detect how often 0 is currently being used as
an angle.

image-orientation and rotate and offset-path's ray() have not yet
shipped, so we don't need use counters for these, we simply reject 0
as an angle.

ConsumeGradientAngleOrPercent now accepts a CSSParserContext by
const reference.

ConsumeGradientLengthOrPercent has been implemented with the same
function signature as ConsumeGradientAngleOrPercent so they can
be called via ConsumeGradientColorStops using the same function pointer type.

BUG= 725382 

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

[add] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/LayoutTests/css-parser/unitless-zero-angle.html
[add] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-custom.html
[add] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-filter.html
[add] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-gradient.html
[add] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-offset-rotate.html
[add] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-transform.html
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIImageOrientation.cpp
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/properties/CSSPropertyAPITransform.cpp
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/css/properties/CSSPropertyOffsetPathUtils.cpp
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/e24202c3b5752cb040117fe5ae0247c27089766c/tools/metrics/histograms/enums.xml

Status: Fixed (was: Started)

Sign in to add a comment