WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

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

Open Scony opened this issue 1 year ago โ€ข 1 comments
trafficstars

f8e1f7229c0a882457f223ae288d019e4ee413a8

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

Reviewed by NOBODY (OOPS!).

WIP

* 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:

https://github.com/WebKit/WebKit/commit/f8e1f7229c0a882457f223ae288d019e4ee413a8

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
โœ… ๐Ÿงช vision-wk2 โŒ ๐Ÿงช mac-intel-wk2
โœ… ๐Ÿ›  tv โœ… ๐Ÿ›  mac-safer-cpp
โœ… ๐Ÿ›  tv-sim
โœ… ๐Ÿ›  watch
โœ… ๐Ÿ›  watch-sim

Scony avatar Oct 21 '24 13:10 Scony

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.

tuankiet65 avatar Oct 23 '24 17:10 tuankiet65

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 avatar Oct 23 '24 19:10 Scony

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

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

webkit-commit-queue avatar Oct 24 '24 09:10 webkit-commit-queue

Does the current parsing support unsafe anchor-center?

yisibl avatar Oct 25 '24 04:10 yisibl

Does the current parsing support unsafe anchor-center?

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

Scony avatar Oct 25 '24 06:10 Scony

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

nt1m avatar Oct 25 '24 07:10 nt1m

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

yisibl avatar Oct 25 '24 07:10 yisibl

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.

Scony avatar Oct 25 '24 13:10 Scony