WebCore's Anonymous Blocks

Album Cover: White Blood Cells

"Every breath that is in your lungs is a tiny little gift to me."
White Stripes / Dead Leaves and the Dirty Ground

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:

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

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

Comments

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

This is actually mandated by CSS.

Permalink

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

Thanks for the additional info, Anne.

Permalink

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.

Name:

Email Address:

Website:

Comments:

Check this box if you hate spam.