W3C home > Mailing lists > Public > public-html@w3.org > June 2009

Re: getElementsByName should match any element

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 9 Jun 2009 18:09:56 -0700
Message-ID: <63df84f0906091809v21727d5dr5ee3734712c89757@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: Ian Hickson <ian@hixie.ch>, "public-html@w3.org" <public-html@w3.org>
On Tue, Jun 9, 2009 at 5:31 PM, Boris Zbarsky<bzbarsky@mit.edu> wrote:
> Ian Hickson wrote:
>>
>> What do other browser vendors want here? Should I not match IE?
>>
>> (I definitely don't want to make it ignore the namespace. It's bad enough
>> that we're considering making APIs that encourage screwing up HTML by
>> sprinkling name="" attributes everywhere; we don't want to screw up SVG and
>> MathML as well.)
>
> I'd be fine with adding a namespace check here in Gecko.
>
> I don't have a strong opinion on the other issue, but my general thoughts
> are:
>
> 1)  I wish this API just didn't exist.
> 2)  I sort of wish the name attribute did not exist.
> 3)  The fact that some nodes in HTML can be named and some can't,
>    and that which ones can is pretty arbitrary, is really silly.
> 4)  Doing a simple namespace check and name attribute check is a
>    lot faster than also checking whether the element is in the
>    "blessed with names" list.
>
> Honestly, items 1, 2, 3 make me want to spend as little code as possible on
> implementing this thing while retaining reasonable web compat (so not just
> ripping it out altogether, sadly).  Item 4 suggests that "as little code as
> possible" should be matching any element in the HTML namespace with the
> right name attribute in the null namespace on it...
>
> If the spec stays as it is, adding the namespace check will be a high
> priority (in fact, see https://bugzilla.mozilla.org/show_bug.cgi?id=497242),
> whereas doing the rest of it will be pretty low priority, imo.  If nothing
> else because doing it will likely entail nontrivial web compat issues.
>
> To be clear, that's my personal opinion, not representing any sort of
> Mozilla consensus on this; Jonas might have his own opinion.  ;)

I definitely have my own opinion!!

Which is that I agree with everything that Boris said.

/ Jonas
Received on Wednesday, 10 June 2009 01:10:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:38 GMT