[HTML5] Wacky DOM behavior

Ian Hickson ian at hixie.ch
Thu Jun 28 10:52:53 PDT 2007

On Thu, 28 Jun 2007, Jeff Cutsinger wrote:
> I've been toying around with HTML5 a bit and I've run into this strange 
> behavior in Firefox (2.0).
> <nav>
>   <ul>...</ul>
> </nav>
> Results in the ul element being a sibling of the nav. This makes 
> scripting a bit difficult. Advice? Should I simply not use the new 
> elements? (I wrote a blog entry with more detail: 
> http://jeff.cutsinger.org/news/14/Adventures-in-HTML5). You can also see 
> the whole site (in its broken state) at http://jeff.cutsinger.org/test/ 

Yeah sadly Firefox and IE both are not doing default parsing in a way that 
is compatible with block-level element descendants (in Firefox's case), 
or any descendants (in IE's case). I recommend using <div class="foo"> 
instead of <foo> until such time as Firefox fixes their parsing behaviour. 
(In IE's case you can sidestep the problem with scripts, as it puts the 
end tag in the DOM too.) Urge Firefox to fix their parser too. :-)

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the Help mailing list