W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2015

[whatwg] Case-sensitivity of CSS type selectors in HTML

From: Rune Lillesveen <rune@opera.com>
Date: Thu, 7 May 2015 13:16:26 +0200
Message-ID: <CANz6XvS_XTThAaDCEh4G1YpuA+itSU_cM=8qe2jL2fQ-TECRqA@mail.gmail.com>
To: whatwg@whatwg.org
Cc: Tab Atkins <tabatkins@google.com>, Elliott Sprehn <esprehn@google.com>
Currently, the HTML spec says that type selectors matches case
sensitively for non-html elements like svg elements in html documents
[1]. So according to the spec, and the implementation in Gecko, the
rules below matches according to the prose:

<!DOCTYPE html>
<style>
foreignObject { color: red }
foreignobject { color: green }
</style>
<foreignOBJECT>Matches both rules. Case-insensitive match. Is
green.</foreignOBJECT>
<svg>
    <FOREIGNobject>Matches the first rule because the parser
normalizes to the camelCased form as per spec. Is red.</FOREIGNobject>
</svg>

This adds an implementation complexity to type selector matching.
What's the rationale for matching the selector case-sensitively in the
svg case?

I'm sorry if I've missed previous discussions. I did see a few really
long mails and threads about svg in html on this list, but weren't
able to find the resolution for this in reasonable time.

Should we change the spec in this regard?

I did have a correct implementation for Blink, but was asked in the
review [2] to match insensitively for non-html elements in html
documents due to the complexity.


[1] https://html.spec.whatwg.org/multipage/scripting.html#selectors
[2] https://codereview.chromium.org/1099963003

-- 
Rune Lillesveen
Received on Thursday, 7 May 2015 11:16:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:31 UTC