Bug 17686 - CSS3 Selector Test: negation pseudo-class should only accept simple selectors
Summary: CSS3 Selector Test: negation pseudo-class should only accept simple selectors
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://disruptive-innovations.com/zoo...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-05 14:02 PST by Eric Seidel (no email)
Modified: 2022-08-07 13:36 PDT (History)
11 users (show)

See Also:


Attachments
test case (256 bytes, text/html)
2008-03-27 12:44 PDT, Robert Blaut
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-03-05 14:02:41 PST
CSS3 Selector Test: negation pseudo-class should only accept simple selectors

    .blox16 { background-color: red; }
    .blox16:not(.blox15) { background-color: lime; }
    .blox16:not(.blox15[foo="blox14"]) { background-color: red; }

<div class="blox16 unitTest" foo="blox15" title="negation pseudo-class accepts only simple selectors for argument"></div>
Comment 1 Robert Blaut 2008-03-05 15:45:02 PST
I wonder if this test is valid. simple selectors are "either a type selector, universal selector, attribute selector, class selector, ID selector, content selector, or pseudo-class. One pseudo-element may be appended to the last sequence of simple selectors." 

In this case we have attribute selector and class selector. It seems that the combination of simple selectors are not simple selector any more but you should notice that an attribute selector is always combination of attribute selector and other simple selector ;) For me the test case is invalid.

Links to CSS Selectors spec:
http://www.w3.org/TR/css3-selectors/#negation
http://www.w3.org/TR/css3-selectors/#simple-selectors-dfn
http://www.w3.org/TR/css3-selectors/#attribute-selectors
Comment 2 Dave Hyatt 2008-03-05 15:50:24 PST
Yes, I posted on the author's blog even.  I don't think we should fix this.

Comment 3 Robert Blaut 2008-03-27 12:43:58 PDT
Some more words on this subject. Regarding attribute selectors, some people can claim: "Wait a second, "[class="test"]" is really simple selector and notation :not([class="test"] works as expected in Firefox and Opera and of cause in Webkit"? 

So is a [class="test"] really simple selector? No! Take a look on this fragment in specification:

"The universal selector, written "asterisk" (*), represents the qualified name of any element type.[...]

If the universal selector is not the only component of a sequence of simple selectors, the * may be omitted.

Examples:

*[hreflang|=en] and [hreflang|=en] are equivalent"

[http://www.w3.org/TR/css3-selectors/#universal-selector]

So this case "[class="test"]" is a simplified version of "*[class="test"]" and it is a sequence of simple selectors. Both cases a logically equal. So in my opinion, it's absolutely incorrect that this case  :not(*[class="test"]) - which is logically equivalent to :not([class="test"]) - does not work in Firefox and Opera, .

Take a look at an attached test case.

Ian, you are an editor of CSS3 Selectors specification. what you think about this issue?
 
Comment 4 Robert Blaut 2008-03-27 12:44:45 PDT
Created attachment 20134 [details]
test case
Comment 5 Dave Hyatt 2008-03-28 23:14:12 PDT
This may change.  Not fixing yet.  Brought it up with the CSS WG.

Comment 6 James Craig 2013-10-31 16:58:20 PDT
This has changed for CSS4. Suggest closing.
Comment 7 Ahmad Saleem 2022-08-07 13:36:32 PDT
I am unable to reproduce this bug in Safari 15.6 on macOS 12.5 and the attached test case show both line with lime / green background and it matches with other browsers (Chrome Canary 106 and Firefox Nightly 105). I am marking this as "RESOLVED CONFIGURATION CHANGED". Thanks!