[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: bug in render_root.cpp
From:       Antti Koivisto <koivisto () iki ! fi>
Date:       2001-07-31 19:49:20
[Download RAW message or body]

On Tuesday 31 July 2001 20:49, Martin Pley wrote:
> Hi, all.
>
> For nearly one week the horizontal scrollbar doesn't work if you load a
> large, plain image in konqueror. (nobody noticed it? :o) )
> (example: load
> http://www.mathematik.uni-bielefeld.de/~mmutz/kde-developers-2400.jpg in
> your konqueror and look at the hoizontal scrollbar)
> The bug is there since v1.78 of /kdelibs/khtml/rendering/render_root.cpp
> If you undo this commit it works again. The cvs-commit-message of 1.78 only
> tells "root width fixes". So i don't know what this was for, but there were
> changes only 2 lines. Anyone knows what this commit was intended for?

Patch attached. Lars or Dirk, please review. The patch remembers to take in 
the account (possibly overflowing) inline elements when calculating the 
rightmost position of a document.

Also removed one unnecessary call to docWidth() which is not a free method.


  antti

["rightmost_position.patch" (text/x-diff)]

? rendering/~render_root.cpp
Index: rendering/render_flow.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_flow.cpp,v
retrieving revision 1.214
diff -u -3 -d -p -r1.214 render_flow.cpp
--- rendering/render_flow.cpp	2001/07/29 19:48:46	1.214
+++ rendering/render_flow.cpp	2001/07/31 19:42:12
@@ -810,14 +810,12 @@ int RenderFlow::rightmostPosition() cons
 {
     int right = RenderBox::rightmostPosition();
 
-    if ( !m_childrenInline ) {
-        RenderObject *c;
-        for (c = firstChild(); c; c = c->nextSibling()) {
-	    if (!c->isPositioned() && !c->isFloating()) {
-		int childRight = xPos() + c->rightmostPosition();
-		if (childRight > right)
-		    right = childRight;
-	    }
+    RenderObject *c;
+    for (c = firstChild(); c; c = c->nextSibling()) {
+	if (!c->isPositioned() && !c->isFloating()) {
+	    int childRight = xPos() + c->rightmostPosition();
+	    if (childRight > right)
+		right = childRight;
 	}
     }
 
Index: rendering/render_root.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_root.cpp,v
retrieving revision 1.80
diff -u -3 -d -p -r1.80 render_root.cpp
--- rendering/render_root.cpp	2001/07/29 20:39:05	1.80
+++ rendering/render_root.cpp	2001/07/31 19:42:12
@@ -274,7 +274,7 @@ void RenderRoot::updateHeight()
     {
         if( h < m_view->visibleHeight() )
             h = m_view->visibleHeight();
-        m_view->resizeContents(docWidth(), h);
+        m_view->resizeContents(w, h);
     }
     m_view->repaintContents( 0, 0, w, h, FALSE );       //sync repaint!
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic