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

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