a testcase for a new khtml problem
Luciano Montanaro
mikelima at cirulla.net
Wed Apr 27 14:08:22 BST 2005
El Martes 26 Abril 2005 20:08, Leo Savernik escribió:
> Am Dienstag, 26. April 2005 18:59 schrieb Luciano Montanaro:
> > El Martes 26 Abril 2005 18:39, Leo Savernik escribió:
> > > Am Dienstag, 26. April 2005 15:00 schrieb Luciano Montanaro:
> > > > I first thought the problem was limited to the non standard
> > > > document.all[]
> > >
> > > It is.
> >
> > Uh... does the page really work for you, or is it buggy?
>
> With *all* occurrences of document.all replaced with getElementById, it
> works: document.getElementById('i'+index).style.background = '#ffff00';
> // document.all['i'+index].style.background = '#ffff00';
> index = (index + 1) % 10;
> //document.all['i'+index].style.background = '#ffcc00';
> document.getElementById('i'+index).style.background = '#ffcc00';
> setTimeout('cycleFocus()', 1000);
Oops. Yes, I forgot the first line.
The script is not executed because the document.all returns an exception:
WARNING: KJS Type error: Attempted to access property on [object
HTMLCollection] object (result of expression document.all["i"+index])
This is because in the All: case the KJS::HTMLDocument::tryGet() method
the object is returned, but it is "hidden".
This makes it of type Undefined. This in turn makes the
KJS::Reference::getvalue() method throw an exception.
I'm not sure this is the intended behaviour; is it possible to do anything
useful with document.all if it is hidden?
A simple workaround for this problem is changing the useragent to an
explorer variety. Doing that, the page displays fine.
Luciano
--
Luciano Montanaro //
\\ //
\x/Un euro, un voto!
More information about the kfm-devel
mailing list