- From: Sébastien Pierre via GitHub <sysbot+gh@w3.org>
- Date: Mon, 26 Sep 2016 18:59:16 +0000
- To: public-css-archive@w3.org
sebastien has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-selectors] Support `.` (dot) notation for non-XHTML namespaces == Regarding https://drafts.csswg.org/selectors-4/#class-html Browsers currently render CSS stylesheets using the `.classname` (*dot notation*) differently from the `[class~="classname"]` notation depending on the node's namespace. For instance, Firefox treats both cases the same for non-XHTML XML nodes while Chrome only applies the `[class~=...]` form in http://ffctn.com/doc/chrome-test-style.xml The issue has been around for a while (see [Bugzilla #7758](https://bugzilla.mozilla.org/show_bug.cgi?id=7588) and [Chromium #69444](https://bugs.chromium.org/p/chromium/issues/detail?id=649444#c6)), and boils down to this: - The [spec is clear](https://bugzilla.mozilla.org/show_bug.cgi?id=7588#c2) in saying that dot-notation is meant for (X)HTML nodes - However, the common practice is that developers prefer/use the dot-notation - Developers willing to use CSS stylesheets for non-XHTML namespace XML currently can't reliably use the dot-notation because of the different interpretations by browsers - As a result, one option to so would be to write the CSS in dot-notation and then transpile it to `[class=~...]` notation, which would lead to having either two stylesheets (one per notation) or a default stylesheet in `[class=~...]` notation instead of the dot-notation. Given that the dot notation is an alternative syntax to the `[class=~...]` (at least according to [this comment](https://bugzilla.mozilla.org/show_bug.cgi?id=7588#c2)), it would be good if it had the same treatment across all browsers. Ultimately, I feel XML does not deserve to be treated as a second-class citizen of the web, and would benefit get the same level of tooling support as HTML. Maybe the spec can help by clarifying that if an XML node has a `class` attribute, then any corresponding dot-notation CSS selector should match? Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/534 using your GitHub account
Received on Monday, 26 September 2016 18:59:25 UTC