[Bug 117516] Firefox 2.0.0.3 incorrectly(?) applies .className on self-closing HTML element

StephanBeal sgbeal at googlemail.com
Tue May 29 10:29:01 UTC 2007


Public bug reported:

Binary package hint: firefox

First a an example which shows the error, taken from a web page i'm
currently writing:

<div id='stephan_wii_id_placeholder'></div>
<!-- try to avoid Wii-ID harvesters by showing my Wii ID using JS...
-->
<script language='javascript'>
var elem = document.getElementById( 'stephan_wii_id_placeholder' );
if( elem ) {
  elem.innerHTML = "In case you're interested in registering my Wii with your Wii, my Wii ID is: 3914 8893 1259 1505";
  elem.className = 'achtung';
}
</script>

That code works incorrectly if the leading <div> is self-closing, like
this:

<div id='...' />

In that case, Firefox applies the new .className ('achtung') to what
appears to be the remainder of the DOM elements in the same branch of
the tree containing the div tree. When using a separate closing tag this
does not happen. As far as i am aware, XHTML/XML defines no semantic
differences between <foo/> and <foo></foo>, so i would expect <div />
and <div></div> className

Not entirely unexpectedly: this same behaviour also appears in Konqueror
3.5.7.

Upon closer investigation, we can simplify the error case by doing this:

<div id='...' class='achtung' />     = behaves erroneously(?) as described above
<div id='...' class='achtung'></div>  = behaves as expected/desired.


Take care,

----- stephan beal

ProblemType: Bug
Architecture: i386
Date: Tue May 29 12:16:15 2007
DistroRelease: Ubuntu 7.04
Package: firefox 2.0.0.3+1-0ubuntu2
PackageArchitecture: i386
SourcePackage: firefox
Uname: Linux owl 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux

** Affects: firefox (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
Firefox 2.0.0.3 incorrectly(?) applies .className on self-closing HTML element
https://bugs.launchpad.net/bugs/117516
You received this bug notification because you are a member of Mozilla
Bugs, which is a bug contact for firefox in ubuntu.




More information about the Ubuntu-mozillateam-bugs mailing list