WebCore's Anonymous Blocks

Album Cover: Eyes Open

"It's hard to argue when you won't stop making sense."
Snow Patrol / Hands Open

Posted on September 08, 2007 8:37 PM in Web Development
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

In Content Model Changes in HTML5, I wrote about how I'd feel dirty mixing inline content with block-level content.

According to WebCore Rendering II - Blocks and Inlines, that is a good thing:

All in-flow children of a block flow must be blocks, or all in-flow children of a block flow must be inlines.

Apparently, at least in WebCore, whenever this rule is broken, the renderer will construct an "anonymous block flow" to correct the error, like so:

 <anonymous block>
  Some text
 </anonymous block>
  Some more text

So remember, mixing inline and block-level content should make you feel dirty ;)


Anne van Kesteren on September 09, 2007 at 1:13 PM:

This is actually mandated by CSS.


Bernie Zimmermann on September 10, 2007 at 8:40 AM:

Thanks for the additional info, Anne.


Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.


Email Address:



Check this box if you hate spam.