DescriptionSupport type selector for camel-cased SVG elements in HTML.
In HTML documents, type selectors are case-insensitive for HTML elements,
but case sensitive for SVG elements [1]. We store the lower case version
of the type selector. For SVG elements, the tag name is normalized to
the camel-case version during parsing. That means we would never match
SVG tag names containing upper-case letters in HTML documents.
This CL matches SVG tag names case-insensitively in HTML documents. That
is not correct according to spec, but at least makes it possible to use
type selectors for SVG elements in HTML documents.
Since the tag name for SVG elements are still stored camelCased, we need
to lower the localName() before using it collecting tag rules from rule
sets or collecting tag name hashes for the the bloom filter.
[1] https://html.spec.whatwg.org/multipage/scripting.html#selectors
BUG=237435
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195038
Patch Set 1 #Patch Set 2 : Use map lookup instead of lower() method. #Patch Set 3 : Use an enum for tag casing and fix an introduced implicit type selector bug #Patch Set 4 : Fix performance regression. tagMatches() became too big to be inlined on Linux. #
Total comments: 2
Patch Set 5 : Always case-insensitive in HTML documents #Patch Set 6 : Added case-sensitive test #Patch Set 7 : Rebased #Patch Set 8 : Rebase issue. querySelector didn't use tagMatches anymore. #
Total comments: 2
Patch Set 9 : Removed stray include #
Total comments: 4
Patch Set 10 : Addressed review issues. #Messages
Total messages: 22 (2 generated)
|