JS: window.myid and document.myid

David Faure dfaure at trolltech.com
Wed Jun 18 00:08:38 BST 2003


On Tuesday 17 June 2003 19:22, Koos Vriezen wrote:
> On Sun, 15 Jun 2003, George Staikos wrote:
> 
> > On Sunday 15 June 2003 08:25, Koos Vriezen wrote:
> > > Hi,
> > >
> > > Shouldn't tags like <OBJECT ID='myid'> also be found with document.myid
> > > (currently in HEAD only window.myid works)?
> >
> >    It seems that at least some sites expect the object id to be a child of the
> > document node.  I saw this recently as well.
> 
> Did some testing today with
> 
>   <html><head><script>
>   function showIt() {
>     var str = "document.mytable=" + document.mytable + "\n";
>     str += "window.mytable=" + window.mytable + "\n";
>     alert (str);
>     var str = "document.myobj=" + document.myobj + "\n";
>     str += "window.myobj=" + window.myobj + "\n";
>     alert (str);
>     var str = "document.myemb=" + document.myemb + "\n";
>     str += "window.myemb=" + window.myemb + "\n";
>     alert (str);
>   }
>   </script></head>
>   <body onClick="showIt()"><table id="mytable"></table>
>   <object id="myobj"></object><embed id="myemb"></embed>
>   </body></html>
> 
> And it seems konqueror is the only one not supporting document.id on
> OBJECT. Don't know why IE doesn't support it on EMBED but I've seen
> document.id on EMBEDs too IIRC, maybe because in this test it has no
> servicetype set.

Can you add the relevant test cases to khtmltests/ecma/document.html ?
This is where most of the other testcases for document.myid are.

>                       window.id                 document.id
> konqueror 3.1.2   mytable/myobj/myembed               -
> IE 6              mytable/myobj/myembed            myobj
> Mozilla 1.3               -                     myobj/myembed
> 
> I think it's good to support document.id on OBJECT and at least APPLET
> elements too (see attached patch).

Thanks.

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html




More information about the kfm-devel mailing list