-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BCD for CSS Anchor Positioning spec #22813
Add BCD for CSS Anchor Positioning spec #22813
Conversation
I'm very dubious of that version 125 number. There's not afaik been an intent to ship yet, and https://chromiumdash.appspot.com/schedule suggests the cut off for Chrome 125 was April 1st? Edit: okay that's an intent to ship now |
@lukewarlow yeah, that's a good point. @mfreed7 / @rachelandrew, do you have any updated information on this? |
https://groups.google.com/a/chromium.org/g/blink-dev/c/jGTYNuidPRs |
This pull request has merge conflicts that must be resolved before it can be merged. |
api/Element.json
Outdated
@@ -223,6 +223,39 @@ | |||
} | |||
} | |||
}, | |||
"anchorElement": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec PR adds this to HTMLElement
not Element
. Also, I don't see Chrome 125 shipping this. Should we remove this for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is not included in what's shipping so I wouldn't include it in this dataset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops! In my next commit, I've moved it to HTMLElement
.
The thing is though, it is supported, not behind a flag, in Canary (I've tested it). I'm guessing it just won't be shipped in Chrome stable for some time. So I feel like it is useful to keep this data for folks doing testing of preview features.
How can we represent features in this state? I thought we used to have some kind of "preview" value to use for this, but I can't find mention of it in the BCD data schema doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for moving it. See #22813 (review) for setting preview and partial implementation because it is on the wrong interface at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm - the anchor
attribute won’t ship in 125. (And current Canaries and Beta should not support it - Chris, please file a bug if you see some observable support.) We are still hoping to ship it soon once the spec discussion concludes, but I don’t know when that will be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfreed7 OK, filed at https://issues.chromium.org/issues/335744345. Is that OK? I've never filed a Chromium bug before ;-)
So I should just remove this for now?
And, can I clarify — this is just the anchorElement
property we are talking about? The anchor
HTML attribute is still shipping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm removing the anchor
attribute in #22910.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, WFM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for filing the bug - I just commented there. I suspect you have Experimental Web Platform Features enabled, which is why you see the anchorElement
property available. Neither the anchor
content attribute nor the anchorElement
IDL attribute are shipping in Chrome in 125 or likely 126 at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfreed7 OK, filed at https://issues.chromium.org/issues/335744345. Is that OK? I've never filed a Chromium bug before ;-)
Also, yes of course, that was perfect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this Chris. I double-checked all of this against the @openwebdocs BCD collector and left some comments.
- need to have sub features for property values.
- anchorElement should probably be removed
- anchor-scope seem unsupported, also remove?
- What about adding the CSSPositionTryDescriptors interface?
Co-authored-by: Florian Scholz <fs@florianscholz.com>
…rowser-compat-data into css-anchor-positioning
@Elchi3 ok, I think I've done everything you asked for here, except for Can you show me how to go about generating BCD for this? There's over 70 properties 😱 |
Thanks Chris, so now you know why I said let's generate this stuff :)) A gist for you for CSSPositionTryDescriptors from the collector: https://gist.github.com/Elchi3/2fcdc552ec5defba79ffd789e398f901 (Doesn't yet contain spec_urls.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Chris! Ready from my side! 👍
Super awesome, thanks @Elchi3! |
Summary
CSS Anchor Positioning is set to be released in Chrome 125. The associated Chrome Status entry does not appear to be very up-to-date, but I have been assured by Chrome engineering that this is the case.
This PR adds BCD for all the features in the spec, namely:
anchor-name
propertyanchor-scope
propertyposition-anchor
propertyposition-visibility
propertyanchor()
functionanchor()
as a value:top
left
bottom
right
inset-block-start
inset-block-end
inset-inline-start
inset-inline-end
inset-block
inset-inline
inset
anchor-center
value, which is supported on the following properties (I've added a subfeature for each):justify-self
align-self
justify-items
align-items
anchor-size()
functionanchor-size()
as a value:width
height
min-width
min-height
max-width
max-height
block-size
inline-size
min-block-size
min-inline-size
max-block-size
max-inline-size
inset-area
propertyposition-try-options
propertyposition-try-order
propertyposition-try
shorthand property@position-try
at-ruleCSSPositionTryRule
CSSOM interface and its properties:name
style
Note that there are features that don't appear to be supported yet in Chrome, as of the creation of this PR — the
anchor-scope
property, and theposition-try*
properties/@position-try
at-rule. AFAIUI, these should be added/enabled fairly soon, so I've added them in for now. I'll hopefully get a confirmation soon either way, so I can remove/retest as appropriate.Note that there are also a couple of features that Chrome supports but aren't in a spec yet (see https://github.com/whatwg/html/pull/9144/files):
anchor
attribute, used to declare the ID of an element that you want this element to be anchored to (i.e. its anchor element).Element.anchorElement
property, used to access a reference to an element's anchor element.I also added in data points for Chrome/CxA 125, so that my BCD doesn't error out.
Test results and supporting details
Related issues