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

Re: getElementsByName should match any element

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 09 Jun 2009 20:31:38 -0400
Message-ID: <4A2EFEEA.5060101@mit.edu>
To: Ian Hickson <ian@hixie.ch>
CC: "public-html@w3.org" <public-html@w3.org>
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.  ;)

-Boris
Received on Wednesday, 10 June 2009 00:32:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:04 UTC