IFRAME - @name should be allowed

Consider the following text/html example:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <style>
            #test {
                border: 1px solid #000;
                width: 600px;
                height: 300px;
            }
        </style>
    </head>
    <body>
        <p><a href="http://example.com/" target="test">test</a></p>
        <p><iframe id="test"></iframe></p>
    </body>
</html>

Clicking on the link in Opera and Safari will load example.com in the
iframe. Doing the same in IE7 and Firefox will open example.com in a
new window/tab.

To make things work *as intended* in all browsers, you need
name="test" on the iframe.

Even if you were to consider a script solution with an onclick
handler, @name is still needed for the frames collection in Firefox so
that you can do a frames["test"].location.href change for example. Of
course, you could do getElementById("test") and do a .src change. But,
in other situations where you want to do something with the framed
document, you might want to use the frames collection instead of
getElementById, so you don't have to mess with the
document/contentDocument issue between IE and other browsers. In this
case, the frames collection is desired, but doesn't work without the
@name on the iframe, unless you use frame indexes.

But, even though you can do a suitable JS solution and workaround the
issues, it shouldn't be necessary.

So, @name needs to be allowed on iframe, especially as part of
supporting existing content.

Of course, since the same type of issue happens with @id and @name for
MAP, maybe there needs to be more discussion on how this should be
handled.

-- 
Michael

Received on Thursday, 14 February 2008 01:06:35 UTC