New issue
Advanced search Search tips

Issue 717833 link

Starred by 2 users

Issue metadata

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

Blocking:
issue 638055



Sign in to add a comment

CSS: Use count position values with 3 parts

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

Issue description

We should add a use counter so we can evaluate the impact of the following proposed syntax change:


From https://lists.w3.org/Archives/Public/www-style/2017Mar/0054.html

Tab and fantasai "just pushed the changes to drop the 3-value syntax from <position> per
   https://lists.w3.org/Archives/Public/www-style/2017Feb/0052.html
The canonical reference is now (again) in CSS Values and Units 3.
   https://drafts.csswg.org/css-values-3/#position

This implies changes to object-position, mask-position, radial gradients,
and offset-position. It also makes <position> available for use in
transform-origin and perspective-origin."

The only position property not affected is background-position.



In Blink, changing ConsumePosition would affect:- 

object-position
perspective-origin
offset-anchor (not shipped)
offset-position (not shipped)
scroll-snap-coordinate (not shipped)
scroll-snap-destination (not shipped)
center position for circle and ellipse basic shapes
radial gradient
conic gradient

 
Ignoring right and bottom, the following are permitted by the <bg-position> but not <position>
> center left <length-percentage>
> center top <length-percentage>
> left <length-percentage> center
> left <length-percentage> top
> left top <length-percentage>
> top left <length-percentage>
> top <length-percentage> center
> top <length-percentage> left

The following are permitted by <position> and begin with cases above:
> left <length-percentage> top <length-percentage>
> top <length-percentage> left <length-percentage>

Blocking: 638055
Cc: majidvp@chromium.org rbyers@chromium.org
Owner: ericwilligers@chromium.org
Status: Assigned (was: Available)
The syntax of position in CSS Values and Units 3 has recently changed
https://bugs.chromium.org/p/chromium/issues/detail?id=717833
https://drafts.csswg.org/css-values-3/#position

Should scroll-snap-coordinate and scroll-snap-destination be changed to use the new syntax?

Or should they be left unchanged?

Or should we delete the implementation of scroll-snap-coordinate and scroll-snap-destination as they don't appear in specs published after
https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/#scroll-snap-coordinate
 
I suggest using the new syntax for the unshipped offset-position and offset-anchor, and add one or more use counters for
-object-position
-perspective-origin
-center position for circle and ellipse basic shapes
-radial gradient
-conic gradient
in preparation for an Intent to Deprecate and Remove support for three valued positions.

background-position would continue to support three valued positions.

Cc: sunyunjia@chromium.org
For scroll-snap-coordinate and scroll-snap-destination. We are going to remove those in favor of implementing the new syntax. But that happens when the patch for the new syntax lands. Here is the WIP: https://codereview.chromium.org/2767213003/
Cc: fmalita@chromium.org
Use counter CL uploaded https://codereview.chromium.org/2888283006/

Should unshipped conic gradient use the new position grammar that forbids three values? Or use the same legacy position grammar as shipped radial gradient?

Project Member

Comment 5 by bugdroid1@chromium.org, May 24 2017

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

commit a951d7b5e8647b077be37f420254b73063a30b4c
Author: ericwilligers <ericwilligers@chromium.org>
Date: Wed May 24 18:21:31 2017

CSS: Use count position values with 3 parts

The CSS Working Group recently changed the grammar of <position> such
that 3-value syntax is no longer supported.
https://lists.w3.org/Archives/Public/www-style/2017Mar/0054.html

We update parsing logic so that the following now use count three value
positions, in preparation for future deprecation and removal discussions:
object-position https://drafts.csswg.org/css-images-3/#the-object-position
perspective-origin
https://drafts.csswg.org/css-transforms-2/#perspective-origin-property
scroll-snap-coordinate (not shipped, not in current spec)
https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/#scroll-snap-coordinate
scroll-snap-destination (not shipped, not in current spec)
https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/#scroll-snap-destination
center position for circle and ellipse basic shapes
https://drafts.csswg.org/css-shapes/#supported-basic-shapes
(used in https://www.w3.org/TR/css-shapes-1/#shape-outside-property and
https://drafts.fxtf.org/css-masking-1/#the-clip-path and
https://drafts.fxtf.org/motion-1/#offset-path-property )
position for radial and (not shipped) conic gradients
https://drafts.csswg.org/css-images-3/#radial-gradients
https://drafts.csswg.org/css-images-4/#conic-gradients
(used in https://drafts.csswg.org/css-backgrounds-3/#the-background-image )

The following no longer accept three value positions:
offset-anchor (property not yet shipped, expecting to ship soon)
https://drafts.fxtf.org/motion-1/#offset-anchor-property
offset-position (property not yet shipped, expecting to ship soon)
https://drafts.fxtf.org/motion-1/#offset-position-property

The following are not affected:
background-position
https://drafts.csswg.org/css-backgrounds-3/#background-position
(continues to support three values)
transform-origin
https://drafts.csswg.org/css-transforms/#transform-origin-property
(has never used <position>, instead defines its own grammar)

BUG= 717833 

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

[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing-expected.txt
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/scroll-snap-parsing.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-circle.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-basic-shape-ellipse.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-conic-gradient.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-object-position.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-perspective-origin.html
[add] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetAnchor.cpp
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapCoordinate.cpp
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/css/properties/CSSPropertyShapeUtils.cpp
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/a951d7b5e8647b077be37f420254b73063a30b4c/tools/metrics/histograms/enums.xml

Status: Fixed (was: Assigned)

Sign in to add a comment