Bug 224228 - Layout of site in konqueror is wrong
Summary: Layout of site in konqueror is wrong
Status: VERIFIED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.3.4
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-25 21:43 UTC by Darin McBride
Modified: 2011-12-19 02:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screen shot of funky layout (124.57 KB, image/png)
2010-01-25 21:44 UTC, Darin McBride
Details
test case (278 bytes, text/html)
2010-01-26 01:07 UTC, Germain Garand
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Darin McBride 2010-01-25 21:43:43 UTC
Version:           4.3.4 (KDE 4.3.4) (using 4.3.4 (KDE 4.3.4), Gentoo)
Compiler:          x86_64-pc-linux-gnu-gcc
OS:                Linux (x86_64) release 2.6.31-gentoo-r6

http://ktorrent.org/forum/viewtopic.php?f=1&t=94 is an example (every page in ktorrent's forums seem to appear the same).

Basically, the table-looking bit is off the window to the right, instead of being directly below the "New Topic/Post reply" buttons as they are in other browsers (I just tried Chromium).  I'll attach a screen shot.
Comment 1 Darin McBride 2010-01-25 21:44:23 UTC
Created attachment 40227 [details]
Screen shot of funky layout
Comment 2 Germain Garand 2010-01-26 01:07:59 UTC
Created attachment 40232 [details]
test case
Comment 3 Germain Garand 2010-01-28 11:28:23 UTC
SVN commit 1081435 by ggarand:

rework the behaviour of flowing-around-floats objects /wrt floats, to match
the general evolution of CSS engines.

We used to match mostly Gecko 1.8, but the behaviour has changed a lot
in the 1.9 serie. Notably, the clearing of floats by those objects is now
allowed even in auto-width containers, and generally uses the computed
width.

WebCore has some similar logic in recent trunk though the algorithm is a
bit wasteful and not so compatible in some aspects, so I only followed part
of it.

All in all, we agree the most with Opera/MSIE 7+ now (especially
considering the table-with-align-attribute behaviour).


BUG: 224228

 M  +26 -10    render_block.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1081435
Comment 4 Darin McBride 2010-01-29 18:33:42 UTC
I took your patch, applied it to my 4.3.5 kdelibs, and the site works fine now.  Thanks!
Comment 5 Maciej Mrozowski 2010-06-06 05:16:34 UTC
Patch seems not to be applicable to 4.4 - it causes khtml to freeze (likely infinite loop) on some pages here  - https://bugs.gentoo.org for instance.

Apparently exit conditions within "while (true) { ... }" are not met.
Comment 6 Maciej Mrozowski 2010-06-06 05:23:36 UTC
if (!childw || needsRecalc) {
  int oy = child->yPos();
  int ow = child->width();
  child->setPos(child->xPos(), cury);
  child->calcWidth();
  childw = child->width();
  child->setPos(child->xPos(), oy);
  child->setWidth(ow);
}

I don't know the code, but looks like needsRecalc should be set to false before leaving this conditional block:

if (!childw || needsRecalc) {
[...]
  childw = child->width();
  child->setPos(child->xPos(), oy);
  child->setWidth(ow);
  needsRecalc = false;
}