This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The non-normative text for form[name] in http://www.whatwg.org/specs/web-apps/current-work/#the-form-element states that only <img> elements with the given ID can match. I believe this should be by ID or name.
Do you have a test demonstrating this? I'm not 100% sure I follow.
Certainly, <form><img name="n"/></form><script>alert(document.forms[0]["n"]);</script> Per that non-normative text afaict, the <img/> won't match. (I'm assuming the "Returns the form control" part of that text to refer to the 'listed elements' of the form. Which does not have <img/>.)
Ah, I see. Yeah, that's intentional. The non-normative text ignores what happens for non-normative content. <img name> is non-normative.
That doesn't make much sense :-) Where is <img name> called out as being outside of what the spec requires when the algorithms below (in normative text) includes it, but without stating that it is not a requirement to also consider <img name>? I would expect the non-normative box to be a summary of normative text, at least here. (A trifling detail given that the text isn't normative, but still.)
(In reply to sof from comment #4) > Where is <img name> called out as being > outside of what the spec requires when the algorithms below (in normative > text) includes it, but without stating that it is not a requirement to also > consider <img name>? I don't understand that question. The idea is that implementors refer to the normative text to implement browsers, and authors refer to the non-normative text when figuring out how the APIs work. Authors don't need to know anything about what happens with <img name>, since if they're using it they've probably made a mistake, and the validator will help them to convert to using id="" or whatnot. So the non-normative text doesn't mention it. This is one of the main ways the non-normative API descriptions differ from the normative ones; if the non-normative text were pedantically correct, it might as well be normative.
A problem here is/was how the line between normative and not is drawn (where is that defined); just trust the non-normative text as always being accurate? But I now see that http://www.whatwg.org/specs/web-apps/current-work/#non-conforming-features enumerates img.name as obsolete. So, we're fine in this regard.
(In reply to sof from comment #6) > A problem here is/was how the line between normative and not is drawn (where > is that defined); just trust the non-normative text as always being accurate? As an implementors, you should just ignore the non-normative text entirely. Especially the domintro blocks, but also anything that says "Note:", to be honest.
And definitely ignore all the examples. And the diagrams. And the text in the indexes, and any tables marked non-normative, and... :-)