Small test case for bug in renderer floats

Vadim Plessky lucy-ples at mtu-net.ru
Mon Jul 29 14:28:59 BST 2002


On Monday 29 July 2002 2:43 pm, Koos Vriezen wrote:
|  On Mon, 29 Jul 2002, Vadim Plessky wrote:
|  > On Sunday 28 July 2002 5:15 pm, Koos Vriezen wrote:
|  > |  This is rendered wrong
|  > |    <html><body>
|  > |     <table style="float:left;" border=1><tr><td>table cell</table>
|  > |     some text
|  > |    </body></html>
|  > |
|  > |  or with a div
|  > |
|  > |    <html><body>
|  > |     <div style="float:left;" border=1>div text<br>div text</div>
|  > |     some text
|  > |    </body></html>
|  > |
|  > |  Seems the float gets an extra left offset if the height is greater
|  > | than height of surrounding text.
|  >
|  > I can't understand what do you mean here.
|
|  I mean, if you test one of the above test cases, you see the 'some text'
|  text starts on top of the last letter of 'table cell' or 'div text' text
|  (depending which test case).
|  If I turn on DEBUG_LAYOUT/FLOAT_DEBUG/BOX_DEBUG, I see that the float is
|  rendered twice, one correct and one with an xoffset of 10 too much.
|  If you extend the height of surrounding text, eg. add '<br>more text..'
|  after 'some text', its rendered correctly.

ok, now I see.
This testcase demonstrates that problem is with floating div's offset from 
left border of <body>

<html><body style="border: 1px dashed navy; padding: 0;">
<div style="float:left; border: 1px solid lime; width: 8em; ">div text<br>div 
text</div>
some text
</body></html>

Compare rendering with Mozilla and you will see some difference :-)
// thanks to dashed border around body

and, BTW, problem is related not to the amount of text outside floating DIV, 
but to the heigh tof body.
See another testcase:

<html><body style="border: 1px dashed navy;">
<div style="float:left; border: 1px solid lime; width: 8em; ">div text<br>div 
text</div>
some text <br> more text blah blah <br> more more more text
</body></html>

And now when we have detailed descriptiuon for the bug, I can tell you that I 
filed bug report aganst this problem 21.04.2002, Bug#41403
CSS1: incorrect rendering for { float:right } block (misplaced right border) 
[testcase])
You can follow your bug's status at http://bugs.kde.org/db/41/41403.html

|
|  > Pls check attached testcase - both <table> and <div> render (almost)
|  > identically.
|
|  So what?

I had impresion that you compare differences of using <table> and <div> with 
CSS property 'float: left'
And prepared testcase which demonstares that rendering is identical (that's 
was not visible from your testcase)

|
|  > BTW: you forgot to close </td></tr> in your example
|
|  IMO those close tags are optional, see
|  http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#h-11.2.5
|

They may be optional, but if you write testcase, it's better to use 
well-written HTML. I would prefer XHTML 1.0/1.1 over HTML x.y, validated by 
W3C Validator (in case you compare output with, say, Mozilla; rendering by MS 
IE is different story)

|
|  Regards,
|
|  Koos Vriezen

Kind Regards,
-- 

Vadim Plessky
http://kde2.newmail.ru  (English)
33 Window Decorations and 6 Widget Styles for KDE
http://kde2.newmail.ru/kde_themes.html
KDE mini-Themes
http://kde2.newmail.ru/themes/





More information about the kfm-devel mailing list