Re: Selectors, getElementsByTagName() and camelCase SVG

On Wed, Apr 1, 2009 at 11:42 AM, Maciej Stachowiak <mjs@apple.com> wrote:
>
> On Apr 1, 2009, at 6:57 AM, Henri Sivonen wrote:
>
>> On Apr 1, 2009, at 16:39, Henri Sivonen wrote:
>>
>>> Making the comparisons actually case-sensitive seems bad at least in the
>>> context of Gecko.
>>
>>
>> Oops. That should have been:
>>>
>>> Making the comparisons actually case-*in*sensitive seems bad at least in
>>> the context of Gecko.
>
> Oops, should have read this email before replying to the last one. Why would
> this be bad?

Performance wise a case insensitive compare is *much* more expensive
than a case sensitive one. Especially since there are neat tricks you
can do for case sensitive compares which turns a string compare into
basically a pointer compare.

However I think we'd get the effect of a case insensitive compare if
we made getElementsByTagName use the same case-correcting algorithm as
the parser does.

/ Jonas

Received on Wednesday, 1 April 2009 19:42:55 UTC