W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2016

[csswg-drafts] selector matching should be specified as being from right to left, not left to right

From: L. David Baron via GitHub <sysbot+gh@w3.org>
Date: Wed, 16 Nov 2016 19:12:58 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-189812370-1479323576-sysbot+gh@w3.org>
dbaron has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== selector matching should be specified as being from right to left, 
not left to right ==
As discussed in today's teleconference, I'm opening this issue to 
cover [an issue I raised in 
2015](https://lists.w3.org/Archives/Public/www-style/2015Mar/0432.html):

The [section on evaluating a 
selector](https://drafts.csswg.org/selectors-4/#evaluating-selectors) 
introduces an algorithm that defines how selectors are matched.  It 
does so by doing the matching from left to right (across combinators),
 which is the opposite of what all implementations that I'm aware of 
do.

Specifying it this way seems like a very bad idea, because it 
introduces a number of risks:

 1. specification authors might introduce features that are easy to 
describe in the spec's left-to-right matching but hard to implement in
 the implementations' right-to-left matching

 2. we might want to introduce features that are simple in the 
implementations' right-to-left matching, but that are hard to describe
 it the spec's right-to-left matching

 3. we might introduce features where it's easy to make subtle errors 
in the mapping between the two descriptions; this can lead to things 
that are technically bugs in implementations, and might even do so 
interoperably.  It's better for these not to be bugs, and just to 
match the spec.

So I think that if the spec introduces an algorithmic description of 
selector matching (as the current draft of selectors-4 does), that 
algorithm should work the same way implementations work.

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/720 using your GitHub 
account
Received on Wednesday, 16 November 2016 19:13:04 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:05 UTC