[testcase] HTMLCollectionImpl::item broken?

David Faure faure at kde.org
Mon May 2 20:44:30 BST 2005


On Monday 02 May 2005 18:28, Koos Vriezen wrote:
> On Mon, May 02, 2005 at 05:17:56PM +0200, Martijn Klingens wrote:
> > While trying to get my new employer's several intranet-sites working in Konq I 
> > encountered a problem with item().
> > 
> > David was kind enough to debug the issue for me, the testcase is up at 
> > http://kdab.net/~dfaure/spaze.html and pasted below for convenience:
> > 
> > <body>
> >   <div id="myDiv">bla</div>
> >   <script>
> >     d=document.getElementById('myDiv');
> >     d.innerText = document.all.item('myDiv').tagName;

Oh, I see the problem - item('myDiv') is unsupported, we only support item(index),
as per the DOM. item(name) is an IE extension. I added it now, with a kdWarning
about it being non-standard (Harri plans on adding a mechanism for presenting
such warnings to the user together with the js errors).

> I don't understand, I get 'DIV' with CVS version from a week ago

I'm really really surprised by that - we never supported item('name').

But I was wrong to accuse your dom node cache, it's fine, it was
the call to item() itself which wasn't (the name was converted to 0, so
the call was equivalent to document.all.item(0)).

Anyway: fixed.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list