Skip to content

[selectors-4] should the >> syntax for the descendant combinator still exist? #641

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

Closed
dbaron opened this issue Oct 24, 2016 · 8 comments · Fixed by #2162
Closed

[selectors-4] should the >> syntax for the descendant combinator still exist? #641

dbaron opened this issue Oct 24, 2016 · 8 comments · Fixed by #2162
Labels

Comments

@dbaron
Copy link
Member

dbaron commented Oct 24, 2016

Depending on the resolution of #640, I think we should perhaps consider removing the >> synonym for the descendant combinator, currently specified in selectors-4. It's not clear to me if the extra syntax is still worthwhile if >>> is removed.

@dbaron dbaron added the selectors-4 Current Work label Oct 24, 2016
@SebastianZ
Copy link
Contributor

The >> syntax also serves the purpose of clarification. a >> b is more explicit than a b.

Sebastian

@Ms2ger
Copy link

Ms2ger commented Oct 25, 2016

I think that would have been a fine argument when CSS1 was being developed, but I believe at this point having two syntaxes for the same thing would reduce clarity.

@TakayoshiKochi
Copy link
Member

Adding one data point:
according to http://caniuse.com/#search=%3E%3E Safari 10 and Safari Technology Preview
already implements >>.

As I tested on my local OSX, >> did not work on Safari 10.0.1, but it DID work on Safari TP 16.

@SebastianZ
Copy link
Contributor

I believe at this point having two syntaxes for the same thing would reduce clarity.

I can see that this might be the case if both combinators are mixed within style sheets, though my argument that a >> b is more explicit is still valid.

Sebastian

ayg added a commit to ayg/web-platform-tests that referenced this issue Aug 8, 2017
Its future is not yet decided:
  w3c/csswg-drafts#641
Only WebKit supports it.  We shouldn't encourage other browsers to
implement it until a final decision is made on whether we want to keep
it.
@zcorpan
Copy link
Member

zcorpan commented Aug 17, 2017

It was added to webkit in https://bugs.webkit.org/show_bug.cgi?id=140525 with some resistance and a final note:

I'll nuke ">>" if it goes out of the spec.

cc @BenjaminPoulain

@TakayoshiKochi
Copy link
Member

TakayoshiKochi commented Aug 21, 2017

Looks like the last comment was made 2+ years ago...
Still, is this dependent on WICG/webcomponents#78 to make any move forward?

zcorpan pushed a commit to web-platform-tests/wpt that referenced this issue Aug 22, 2017
Its future is not yet decided:
  w3c/csswg-drafts#641
Only WebKit supports it.  We shouldn't encourage other browsers to
implement it until a final decision is made on whether we want to keep
it.
@anttijk
Copy link

anttijk commented Sep 8, 2017

WebKit support for >> was removed in https://trac.webkit.org/r221788

hubot pushed a commit to WebKit/WebKit-http that referenced this issue Sep 8, 2017
https://bugs.webkit.org/show_bug.cgi?id=175765

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Tests for these have been removed in WPT master, just update expectations until new version is imported.

* web-platform-tests/dom/nodes/Element-matches-expected.txt:
* web-platform-tests/dom/nodes/Element-webkitMatchesSelector-expected.txt:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt:

Source/WebCore:

This is an alternative syntax for the normal descendant combinator (just space) that was
advertised as being consistent with > (child combinator) and >>> (shadow piercing combinator).
The latter has been killed so it is not consistent with anything anymore.

No other engine besides WebKit has implemented this and the WPT tests have been removed
(in web-platform-tests/wpt#6785). Full removal from spec is still
open (w3c/csswg-drafts#641) but we shouldn't encourage adoption of
this pointless feature.

While this has shipped the compatibility risk is low as no other engine implemented it and
there were no incentives to use it over the standard syntax.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* css/CSSSelector.h:
(WebCore::CSSSelector::hasDescendantRelation const):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively const):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserSelector.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserSelector.h:
* css/parser/CSSSelectorParser.cpp:
(WebCore::isDescendantCombinator):
(WebCore::CSSSelectorParser::consumeCombinator):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):

LayoutTests:

* fast/css/ancestor-of-hovered-element-removed.html:
* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/css/currentColor-value-style-update.html:
* fast/css/descendant-combinator-doubled-child-syntax-styling-expected.html: Removed.
* fast/css/descendant-combinator-doubled-child-syntax-styling.html: Removed.
* fast/css/parsing-css-attribute-case-insensitive-value-1-expected.txt:
* fast/css/parsing-css-attribute-case-insensitive-value-1.html:
* fast/css/parsing-css-attribute-case-insensitive-value-4-expected.txt:
* fast/css/parsing-css-attribute-case-insensitive-value-4.html:
* fast/css/parsing-css-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/css/parsing-css-descendant-combinator-doubled-child-syntax.html: Removed.
* fast/selectors/case-insensitive-attribute-register-requirement-2.html:
* fast/selectors/element-closest-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/selectors/element-closest-descendant-combinator-doubled-child-syntax.html: Removed.
* fast/selectors/element-matches-attribute-ascii-case-insensitive-html.html:
* fast/selectors/element-matches-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/selectors/element-matches-descendant-combinator-doubled-child-syntax.html: Removed.
* fast/selectors/id-attribute-querySelector-used-as-id-selector-quirks.html:
* fast/selectors/id-attribute-querySelector-used-as-id-selector.html:
* fast/selectors/nth-child-matching-first.html:
* fast/selectors/nth-last-child-matching-first.html:
* fast/selectors/querySelector-attribute-ascii-case-insensitive-html.html:
* fast/selectors/querySelector-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/selectors/querySelector-descendant-combinator-doubled-child-syntax.html: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@221788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
rachelandrew pushed a commit to rachelandrew/web-platform-tests that referenced this issue Nov 8, 2017
Its future is not yet decided:
  w3c/csswg-drafts#641
Only WebKit supports it.  We shouldn't encourage other browsers to
implement it until a final decision is made on whether we want to keep
it.
@css-meeting-bot
Copy link
Member

The Working Group just discussed [selectors-4] should thesyntax for the descendant combinator still exist?.

The full IRC log of that discussion <dael> Topic: [selectors-4] should thesyntax for the descendant combinator still exist?
<dael> github: https://github.com//issues/641
<dael> fantasai: We had intro a double child selector syntax. The reason to do that was to a have a visually representative syntax for a desc. combinator but more was to bridge gap between child and shadow piercing descendant selector. Shadow piercing was removed or obj and && syntax was removed. Do we want to persue to have visable combinator or drop it?
<dael> Rossen_: dbaron I see you proposed the removal originally. Do you still favor removing?
<dael> dbaron: I would. Introducing new syntax and dealing with compat isn't a thing we should spend time on without a good reason to do so
<dael> Rossen_: Other opinions or obj?
<astearns> +1 for removal. It's nice but not worth it
<dael> fantasai: What dbaron said made sense
<dael> Rossen_: I'm also with dbaron
<dael> Resolved: removed the descendant combinator from selectors 4

ewilligers pushed a commit to ewilligers/csswg-drafts that referenced this issue Jan 4, 2018
CSS Selectors 4 previously allowed >> as an alternative
for whitespace. This has been removed.

resolves w3c#641
ewilligers pushed a commit to ewilligers/csswg-drafts that referenced this issue Jan 4, 2018
CSS Selectors 4 previously allowed >> as an alternative
for whitespace. This has been removed.

resolves w3c#641
fantasai pushed a commit that referenced this issue Jan 4, 2018
CSS Selectors 4 previously allowed >> as an alternative
for whitespace. This has been removed.

resolves #641
ryanhaddad pushed a commit to WebKit/WebKit that referenced this issue Dec 22, 2020
https://bugs.webkit.org/show_bug.cgi?id=175765

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Tests for these have been removed in WPT master, just update expectations until new version is imported.

* web-platform-tests/dom/nodes/Element-matches-expected.txt:
* web-platform-tests/dom/nodes/Element-webkitMatchesSelector-expected.txt:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt:

Source/WebCore:

This is an alternative syntax for the normal descendant combinator (just space) that was
advertised as being consistent with > (child combinator) and >>> (shadow piercing combinator).
The latter has been killed so it is not consistent with anything anymore.

No other engine besides WebKit has implemented this and the WPT tests have been removed
(in web-platform-tests/wpt#6785). Full removal from spec is still
open (w3c/csswg-drafts#641) but we shouldn't encourage adoption of
this pointless feature.

While this has shipped the compatibility risk is low as no other engine implemented it and
there were no incentives to use it over the standard syntax.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* css/CSSSelector.h:
(WebCore::CSSSelector::hasDescendantRelation const):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively const):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserSelector.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserSelector.h:
* css/parser/CSSSelectorParser.cpp:
(WebCore::isDescendantCombinator):
(WebCore::CSSSelectorParser::consumeCombinator):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):

LayoutTests:

* fast/css/ancestor-of-hovered-element-removed.html:
* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/css/currentColor-value-style-update.html:
* fast/css/descendant-combinator-doubled-child-syntax-styling-expected.html: Removed.
* fast/css/descendant-combinator-doubled-child-syntax-styling.html: Removed.
* fast/css/parsing-css-attribute-case-insensitive-value-1-expected.txt:
* fast/css/parsing-css-attribute-case-insensitive-value-1.html:
* fast/css/parsing-css-attribute-case-insensitive-value-4-expected.txt:
* fast/css/parsing-css-attribute-case-insensitive-value-4.html:
* fast/css/parsing-css-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/css/parsing-css-descendant-combinator-doubled-child-syntax.html: Removed.
* fast/selectors/case-insensitive-attribute-register-requirement-2.html:
* fast/selectors/element-closest-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/selectors/element-closest-descendant-combinator-doubled-child-syntax.html: Removed.
* fast/selectors/element-matches-attribute-ascii-case-insensitive-html.html:
* fast/selectors/element-matches-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/selectors/element-matches-descendant-combinator-doubled-child-syntax.html: Removed.
* fast/selectors/id-attribute-querySelector-used-as-id-selector-quirks.html:
* fast/selectors/id-attribute-querySelector-used-as-id-selector.html:
* fast/selectors/nth-child-matching-first.html:
* fast/selectors/nth-last-child-matching-first.html:
* fast/selectors/querySelector-attribute-ascii-case-insensitive-html.html:
* fast/selectors/querySelector-descendant-combinator-doubled-child-syntax-expected.txt: Removed.
* fast/selectors/querySelector-descendant-combinator-doubled-child-syntax.html: Removed.


Canonical link: https://commits.webkit.org/193141@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants