Don't reopen active formatting elements for whitespace

Consider the following markup (note missing </a>):

<ul>
<li><a href="1">foo</li>
</ul>
<ul>
<li><a href="2">bar</a></li>
</ul>

With an HTML5 parser this will result in 3 extra 'a' elements. Firefox 3.5  
seems to not create them for line breaks, but does create them for tabs  
and spaces (why?). Safari matches the spec. Recreating them screws up  
keyboard navigation in Firefox. Safari seems to skip links that have 0  
width or 0 height in the tab order.

I think it would be better to not reopen formatting elements upon seeing a  
character token that consists of just whitespace.

Whether the leading whitespace in " x" in

<div><a></div> x

should be put inside the link or not I don't know. Firefox doesn't put it  
inside the link (if it was a linebreak instead).

-- 
Simon Pieters
Opera Software

Received on Thursday, 16 July 2009 12:22:53 UTC