Closed Bug 7588 Opened 25 years ago Closed 25 years ago

HTMLish class selectors should not be allowed in CSS for XUL

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: dbaron, Assigned: peterl-retired)

References

Details

HTMLish class selectors (using a ".") should not be allowed in CSS for XUL.  The
CSS2 spec (section 6.8.3, I think) is quite clear on this.  Any XML application
other than HTML (which was the only thing to which CSS1 applied) should be
required to use:

element[class~="value"] { property: value; }

(Most current XUL usage seems to use = instead of ~=.)
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
Sorry, beg to differ. Class selectors in CSS bind to any element that expresses
the notion of class to the style system. XML does not have a mechanism to do
this (yet), but HTML, XHTML and XUL do. This is perfectly legal. Within a given
XML namespace we can define the notion of "class" any way we want to.
I do think the spec is pretty clear on this one:

  For style sheets used with HTML, authors may use the dot (.) notation as an
  alternative to the "~=" notation... (5.8.3)

XHTML is HTML (since it is meant to be displayed on browsers that don't know
XML).  XUL is not.

It does disturb me a bit to see this since XUL is going to be one of the first
major public uses of XML+CSS.  However, if you want it this way, that's your
choice.
As far as I can tell, David is correct here.

In a very early draft of CSS2:
   http://www.w3.org/TR/WD-CSS2-971104/selector.html#h-6.3.3
...there was an "@class" rule which decided which attribute should be used to
interpret the "." notation. This was removed from CSS2 in the early 1998 draft,
which states, as does the final CSS2 specification, that the "." notation only
applies to HTML (and by extension, XHTML).
Status: RESOLVED → VERIFIED
Based on Peterl comments, verified bug invalid.
Should we reopen this bug?
See Also: → 89982
I think it works well right now in Firefox. See also https://github.com/w3c/csswg-drafts/issues/534
You need to log in before you can comment on or make changes to this bug.