Skip to content

[css-anchor-position-1] Implement parsing support for anchor-center value#35517

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Scony:281846-css-anchoring-anchor-center-parsing
Oct 24, 2024
Merged

[css-anchor-position-1] Implement parsing support for anchor-center value#35517
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Scony:281846-css-anchoring-anchor-center-parsing

Conversation

@Scony
Copy link
Copy Markdown
Contributor

@Scony Scony commented Oct 21, 2024

c0f2f40

[css-anchor-position-1] Implement parsing support for anchor-center value
https://bugs.webkit.org/show_bug.cgi?id=281846

Reviewed by Tim Nguyen.

This change adds parsing support for `anchor-center` CSS value as specified in:
https://drafts.csswg.org/css-anchor-position-1/#anchor-center

* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-001-expected.txt:
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Align.cpp:
(WebCore::CSSPropertyParserHelpers::isSelfPositionKeyword):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::alignmentOffset):
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForGridItem const):
(WebCore::RenderGrid::rowAxisPositionForGridItem const):
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* Source/WebCore/rendering/style/RenderStyleConstants.h:

Canonical link: https://commits.webkit.org/285641@main

3df0c5d

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
⏳ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@Scony Scony self-assigned this Oct 21, 2024
@Scony Scony added the CSS Cascading Style Sheets implementation label Oct 21, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 21, 2024
@Scony Scony removed the merging-blocked Applied to prevent a change from being merged label Oct 22, 2024
@Scony Scony force-pushed the 281846-css-anchoring-anchor-center-parsing branch from f8e1f72 to 228fb71 Compare October 22, 2024 11:50
@Scony Scony marked this pull request as ready for review October 22, 2024 18:32
@Scony Scony force-pushed the 281846-css-anchoring-anchor-center-parsing branch from 228fb71 to 47ddd35 Compare October 23, 2024 09:09
@Scony Scony requested a review from anttijk October 23, 2024 09:45
Copy link
Copy Markdown
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, feel free to land this

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 23, 2024
@tuankiet65
Copy link
Copy Markdown
Member

LGTM. I'd prefer that the TODOs have links to the bugzilla to implement them, but I suppose you're close to getting them work anyway.

@Scony Scony removed the merging-blocked Applied to prevent a change from being merged label Oct 23, 2024
@Scony Scony force-pushed the 281846-css-anchoring-anchor-center-parsing branch from 47ddd35 to 3df0c5d Compare October 23, 2024 19:13
@Scony
Copy link
Copy Markdown
Contributor Author

Scony commented Oct 23, 2024

LGTM. I'd prefer that the TODOs have links to the bugzilla to implement them, but I suppose you're close to getting them work anyway.

I've added the links as in few days I'm starting holidays, so it will take at least few weeks before I land the followup.

@Scony Scony added the merge-queue Applied to send a pull request to merge-queue label Oct 24, 2024
…alue

https://bugs.webkit.org/show_bug.cgi?id=281846

Reviewed by Tim Nguyen.

This change adds parsing support for `anchor-center` CSS value as specified in:
https://drafts.csswg.org/css-anchor-position-1/#anchor-center

* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-001-expected.txt:
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Align.cpp:
(WebCore::CSSPropertyParserHelpers::isSelfPositionKeyword):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::alignmentOffset):
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForGridItem const):
(WebCore::RenderGrid::rowAxisPositionForGridItem const):
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* Source/WebCore/rendering/style/RenderStyleConstants.h:

Canonical link: https://commits.webkit.org/285641@main
@webkit-commit-queue webkit-commit-queue force-pushed the 281846-css-anchoring-anchor-center-parsing branch from 3df0c5d to c0f2f40 Compare October 24, 2024 09:26
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 285641@main (c0f2f40): https://commits.webkit.org/285641@main

Reviewed commits have been landed. Closing PR #35517 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit c0f2f40 into WebKit:main Oct 24, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 24, 2024
@yisibl
Copy link
Copy Markdown

yisibl commented Oct 25, 2024

Does the current parsing support unsafe anchor-center?

@Scony
Copy link
Copy Markdown
Contributor Author

Scony commented Oct 25, 2024

Does the current parsing support unsafe anchor-center?

No - unless previous implementation supported it - in that case it does as a side effect.

@nt1m
Copy link
Copy Markdown
Member

nt1m commented Oct 25, 2024

Does the current parsing support unsafe anchor-center?

No - unless previous implementation supported it - in that case it does as a side effect.

It should work with this patch, since anything in isSelfPositionKeyword should work with safe/unsafe.

Though I did notice that the parser-grammar-unused changes in this patch are incorrect. They should be undone, and anchor-center should be added here instead: https://searchfox.org/wubkat/rev/1e937703de6af995ef2cd93867292c9da1d3b86c/Source/WebCore/css/CSSProperties.json#10997

@yisibl
Copy link
Copy Markdown

yisibl commented Oct 25, 2024

I mention it because this case requires the unsafe anchor-center.
https://x.com/tabatkins/status/1849581984143777956

@Scony
Copy link
Copy Markdown
Contributor Author

Scony commented Oct 25, 2024

Does the current parsing support unsafe anchor-center?

No - unless previous implementation supported it - in that case it does as a side effect.

It should work with this patch, since anything in isSelfPositionKeyword should work with safe/unsafe.

Though I did notice that the parser-grammar-unused changes in this patch are incorrect. They should be undone, and anchor-center should be added here instead: https://searchfox.org/wubkat/rev/1e937703de6af995ef2cd93867292c9da1d3b86c/Source/WebCore/css/CSSProperties.json#10997

Good point, I'll fix that before adding actual implementation.

As for unsafe anchor-center - I'll take a deeper look at it by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS Cascading Style Sheets implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants