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

On Mon, 06 Apr 2009 17:33:58 -0400, Anne van Kesteren <annevk@opera.com> wrote:

> On Mon, 06 Apr 2009 23:19:28 +0200, Michael A. Puls II  
> <shadow2531@gmail.com> wrote:
>> 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.

So, the spec's saying that @id doesn't matter at all for document.foo matching for iframe, ever?

document.foo matches <iframe id="foo" name="non-empty"> in IE and Opera where the @name value is anything non-empty, not necessarily the same value as @id.

>> 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.

Well, it seems like it's kind of like this:

IE: hasAttribute("name") && getAttribute("name").length > 0
Safari: hasAttribute("name");
Firefox and Opera: no checking for @name

Firefox and Opera seem like they have less check than Safari. But, are you saying that Safari's behavior is preferred over that because it's a little close to IE's.

>> 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?

document.foo matches <iframe id="foo"> and <iframe id="foo name=""> in Opera. Those don't match in any other browser, so it seems that Opera shouldn't do that.

I was wonder what the spec said and if it said anything about IE and Opera's case of: 

document.foo matching <iframe id="foo" name="non-empty"> where the @name value is anything non-empty, not necessarily the same value as @id.

However, judging from response about, the spec is saying that @id has nothing to do with it, which seems to not match 2 browsers (Opera and IE).

If that's O.K. with everyone, no arguments. Just wanted to bring it up to make sure this part's covered.

>> 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.

So, then <canvas> and <video> should not be named elements like they are in Opera. Understood.

-- 
Michael

Received on Monday, 6 April 2009 22:42:37 UTC