Skip to content
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

[CSS Nesting] Don't serialize first implicit style rule inside group rule #13758

Conversation

mdubet
Copy link
Contributor

@mdubet mdubet commented May 11, 2023

e07871e

[CSS Nesting] Don't serialize first implicit style rule inside group rule
https://bugs.webkit.org/show_bug.cgi?id=256647
rdar://109208359

Reviewed by Antti Koivisto.

Orphaned properties in group rule are implicitly added
to a style rule with '&' as selector ;
this implicit style rule should not be serialized.

* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls.tentative.html:

 Import from WPT

* Source/WebCore/css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::appendCSSTextForItems const):
(WebCore::CSSGroupingRule::cssTextForDeclsAndRules const):
* Source/WebCore/css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::cssTextForDeclsAndRules const):

This behavior only concerns group rule, not style rule (where a property can't be orphaned)

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

5c8e400

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@mdubet mdubet self-assigned this May 11, 2023
@mdubet mdubet added the WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). label May 11, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 11, 2023
@mdubet mdubet removed the merging-blocked Applied to prevent a change from being merged label May 11, 2023
@mdubet mdubet force-pushed the css-nesting-remove-ampersand-only-for-first-at-rules branch from e355a61 to 5c8e400 Compare May 11, 2023 16:26
@mdubet mdubet added the merge-queue Applied to send a pull request to merge-queue label May 12, 2023
…rule

https://bugs.webkit.org/show_bug.cgi?id=256647
rdar://109208359

Reviewed by Antti Koivisto.

Orphaned properties in group rule are implicitly added
to a style rule with '&' as selector ;
this implicit style rule should not be serialized.

* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls.tentative.html:

 Import from WPT

* Source/WebCore/css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::appendCSSTextForItems const):
(WebCore::CSSGroupingRule::cssTextForDeclsAndRules const):
* Source/WebCore/css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::cssTextForDeclsAndRules const):

This behavior only concerns group rule, not style rule (where a property can't be orphaned)

Canonical link: https://commits.webkit.org/264003@main
@webkit-commit-queue webkit-commit-queue force-pushed the css-nesting-remove-ampersand-only-for-first-at-rules branch from 5c8e400 to e07871e Compare May 12, 2023 09:45
@webkit-commit-queue
Copy link
Collaborator

Committed 264003@main (e07871e): https://commits.webkit.org/264003@main

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

@webkit-commit-queue webkit-commit-queue merged commit e07871e into WebKit:main May 12, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).
Projects
None yet
5 participants