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

On Fri, May 8, 2015 at 9:09 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 5/8/15 11:56 AM, Roger Hågensen wrote:
>> One way to cheapen the computational cost is to have partial case
>> insensitive matching.
>
> If you're walking the string at all, you have already lost in terms of
> performance for this stuff.

Looks like the patch that recently landed *did* exactly this - it
would do a string-walk when matching tags/attributes against SVG
elements. It was indeed slower, but it was just for SVG, and wasn't a
huge hit.

But then Elliot realized that we keep around a second pointer for the
uppercased tagname anyway (some of the tagname accessors return
uppercase for HTML), so he just rewrote it to store the proper casing
there instead, for SVG elements. ^_^  Now it's no extra memory or
runtime cost.

~TJ

Received on Friday, 8 May 2015 17:13:13 UTC