JS regression - found the problem

David Joham djoham at yahoo.com
Thu Apr 3 18:24:10 BST 2003


Cool. Thanks David.

Could I ask a favor? Would it be possible for you to look at bug 43546 if you have a chance? It's
a problem with z-index on relative positioned elements. It doesn't work in Konq or Safari and it
makes some of the pages I'm developing look dorky. Basically, I'm using the code in the recreation
to build tabs on my web pages. In Konq, the active tab doesn't show the way I want it to. It's
actually kinda embarrasing when I'm working on Konq all day and my manager comes in and wants to
know why the page doesn't look right :(

I've looked into changing the way I build those tabs, but it would be a lot of work.

I just looked at the recreation in Mozilla again. Without the images there, you may have to reduce
the font size slightly to get the proper look. Opera displayed it correctly though.

If you don't have time, that's OK. I've actually tried to go in and fix it myself but all I got
for my efforts were lots of Dr. Konqi dialogs :)

Thanks again

David

--- David Faure <dfaure at trolltech.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Thursday 03 April 2003 06:29, David Joham wrote:
> > Found the problem...
> > 
> > In HM_ScriptDOM.js, there's a call to the removeAttribute method of a newly created DOM
> object.
> > This call is failing in Konq with a "DOM Exception 8" error for some reason.
> > 
> > This call seems to fail whenever you call it in Konqueror regardless of whether or not the DOM
> > object was in the HTML or created via JavaScript. Putting a try/catch around this one line of
> code
> > made the menus work with one visual glitch that's new since the last time I looked at these
> menus.
> > Nothing major at all, the menus are fully functional.
> > 
> > I've created a small recreation that demonstrates the problem. Debugging Konq's code is beyond
> my
> > C++ skills so I'll have to pass this off to someone more qualified at this point.
> 
> No problem, you did the hard part of the job ;)
> 
> - --- dom_element.cpp     8 Feb 2003 02:24:52 -0000       1.37
> +++ dom_element.cpp     3 Apr 2003 07:42:16 -0000
> @@ -180,8 +180,7 @@ void Element::removeAttribute( const DOM
>      int exceptioncode = 0;
>      NamedNodeMapImpl *attributes = static_cast<ElementImpl*>(impl)->attributes(false);
>      attributes->removeNamedItem(id, DOMString(), DOMString(), exceptioncode);
> - -    if ( exceptioncode )
> - -        throw DOMException( exceptioncode );
> +    // ignore exceptioncode, it's allowed to remove attributes that don't exist.
>  }
> 
>  Attr Element::getAttributeNode( const DOMString &name )
> 
> This fixes it, and the spec for removeAttribute indeed doesn't say that it
> should throw a NOT_FOUND_ERR. 
> 
> I wonder how many other methods near that one are similarly wrong though 
> (and what should happen on null nodes (impl==0)?
> And to match to the spec in the header filer, isn't there a test for 
> impl->isReadOnly() missing, like in removeAttributeNode?).
> 
> - -- 
> David FAURE, faure at kde.org, sponsored by TrollTech to work on KDE,
> Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
> How to write a Makefile.am for KDE/Qt code:
> http://developer.kde.org/documentation/other/makefile_am_howto.html
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
> 
> iD8DBQE+i+cO72KcVAmwbhARAlRnAJ9SFYYDQ57ovtLg1ocs2IjwUVu7ywCfRKh9
> b+tsWB3eXeX5BC6eVLwaLhU=
> =aeh2
> -----END PGP SIGNATURE-----
> 

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com




More information about the kfm-devel mailing list