Re: document[id] and document.id to <element id="id"> matching

On Mon, 06 Apr 2009 23:19:28 +0200, Michael A. Puls II  
<shadow2531@gmail.com> wrote:
> 1. I don't really understand the part about there always being one  
> element by definition and 'lists' and collections in this case. I don't  
> really understand the first iframe case either.

<iframe> is special cased because if there are multiple elements matching  
the document[name] and one of them is <iframe> you would get the <iframe>  
element itself back as part of the list and not a reference to the global  
object of that element.

That there is always one element follows from the list of values that make  
up the "names of the supported named properties". The algorithm would not  
be called at all otherwise, because there would not be a property with  
that name.


> 2. I'm not sure when exactly it says to match iframe in these cases.

<iframe> elements with a name attribute (regardless of any other  
attributes) whose value matches the input.


> 3. I'm not sure if the named element conditions are as compatible as  
> they could be. Specifically, <img> matching in the spec is compatible  
> with Safari more than it is Opera, Firefox and kind of IE.

True, but the Safari behavior requires the least amount of checks while  
still remaining compatible with content.


> 4. Opera seems to do more iframe matching than any others in these  
> cases, which it looks like it should stop doing. But, is the spec  
> following IE here or something different? I can't tell for sure and,  
> Firefox and Safari don't match iframes at all in these cases.

Care to elaborate?


> FYI though: opera matching for <iframe id="test"> (IFRAME (as Window  
> object) with no @name) seems to be a compatibility problem with at least  
> some pages on at least one Wifi AP.

Yeah, we should change that.


> 5. Opera matches <canvas> and <video> in these cases. Not sure about  
> <canvas>, but matching for <video> in this case *might* make sense to be  
> consistent with <object> and <embed>. Then again, there's probably no  
> reason to add more chaos when Safari and Firefox don't currently do it.  
> Have <video> and <canvas> been considered? What about <audio>?

I don't think we should be extending this magic list. It's a hack anyway.


> No with that said, that's just a review of document.id to @id. I'm not  
> sure how good the spec does @name matching. Haven't tested that.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Monday, 6 April 2009 21:34:43 UTC