[webkit-help] <hr/> rendering problems

Dmitry M dmitrym at gmail.com
Mon Mar 1 14:36:29 PST 2010


Good afternoon all. I was hoping for some help from the list for a
problem that I'm currently facing. I'm currently investigating WebKit
found within Qt 4.6.0.

I have the following HTML file:

  1 <html>
  2   <body style="margin:0px;">
  3     <div>
  4         <hr/>
  5     </div>
  6     <p>
  7         <img style="width:18em;height:27em" src="images/alice02a.gif"/>
  8     </p>
  9   </body>
 10 </html>

which gets rendered as following:

  1   RenderBlock {HTML} at (0,0) size 569x415
  2     RenderBody {BODY} at (0,7) size 569x394
  3       RenderBlock {DIV} at (0,0) size 569x2
  4         RenderBlock {HR} at (0,0) size 569x2 [border: (1px inset #000000)]
  5       RenderBlock {P} at (0,16) size 569x378
  6         RenderImage {IMG} at (0,0) size 252x378
  7         RenderText {#text} at (0,0) size 0x0



I have two questions.

First, on line 2 of the html source, I clearly specify the margins to
be 0. Yet, on line 2 of the rendered tree, BODY appears to start at
the offset of 7. Why?

Second, I have a question about the HR tag. DumpRenderTree output
claims that HR renderblock and the enclosing div (lines 3,4 in the
rendered output) are of height 2. Yet the next div (line 5) starts at
offset 16, which to me means that the real height of the block is
16-2=14. Can anyone provide any explanation as to how the Y position
of the block at line 5 was calculated?

Thanks in advance,

-Dmitry


More information about the webkit-help mailing list