Bug 166413 - New page does not fully repaint window
Summary: New page does not fully repaint window
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 170326 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-13 02:06 UTC by Daniel Richard G.
Modified: 2008-10-20 00:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
The partially repainted page (157.79 KB, image/png)
2008-07-13 02:07 UTC, Daniel Richard G.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Richard G. 2008-07-13 02:06:42 UTC
Version:           4.1.60 (using Devel)
Installed from:    Compiled sources
Compiler:          gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) 
OS:                Linux

NOTE: This bug was encountered while viewing a Google search result. It may not be reproduceable in the future, due to differing page content.

At the time that this report was filed, the bug can be consistently reproduced with the following procedure:

1. Open a new Konqueror window, and load up this URL:

http://www.google.com/search?hl=en&q=polyester+fur+breathe&start=20&sa=N

2. Scroll to the bottom, and click Next.

3. Note how the Page 4 search box and "Search" button appear at the top of the window, but the rest of the window still shows Page 3. (I will attach a screen shot of this bizarre situation.)

4. If you move the pointer around a bit, the entire window repaints, and the new page (Page 4) is shown correctly. (For a real interesting transition, try scrolling the page down, without using the mouse.)
Comment 1 Daniel Richard G. 2008-07-13 02:07:34 UTC
Created attachment 26071 [details]
The partially repainted page
Comment 2 Frank Reininghaus 2008-09-04 10:40:51 UTC
Thanks for the bug report. Right now, I cannot reproduce this on either Konqueror 4.1.1 or SVN trunk 856793 by clicking "Next", but I can get something very similar to your screenshot using the method given in bug 170326: Scroll down and press Enter in the location bar. The two bugs are probably duplicates.
Comment 3 Daniel Richard G. 2008-09-04 16:39:05 UTC
My original URL above no longer causes the bug. But could you try it again with this one?

http://www.google.com/search?hl=en&q=polyester+fur+breathe&start=50&sa=N

Scroll to the bottom, hit Next.
Comment 4 Frank Reininghaus 2008-09-04 17:46:01 UTC
I'm still unable to get any unusual effects by clicking "Next", but I'm pretty sure that this rendering issue is related to bug 170326 which I can reproduce.
Comment 5 Daniel Richard G. 2008-09-06 09:26:03 UTC
Nuts. The URL won't reproduce the bug for me either anymore. I guess I'll have to find a more stable bug-case than a page of Google search results :]

Here's hoping the two bugs are one in the same.
Comment 6 Germain Garand 2008-10-10 01:44:16 UTC
SVN commit 869761 by ggarand:

- fix incomplete repaints happening from time to time
  when jumping early during page load. (#166413)

- various RTL layout application (-reverse cmdline option) fixes
  . implement RTL scrollbars on CSS containers
  . fix iframes scrollbars in RTL mode
  . fix wrong direction when scrolling horizontally (#172258)
  . fix grey block on left of view (#170679)

- avoid smooth scrolling during early stage of layout if the option has
  the WhenEfficient value

BUG: 166413, 172258, 170679


 M  +1 -1      khtml_part.cpp  
 M  +18 -3     khtmlview.cpp  
 M  +2 -1      rendering/render_block.cpp  
 M  +3 -2      rendering/render_layer.cpp  
 M  +2 -1      rendering/render_replaced.cpp  


--- trunk/KDE/kdelibs/khtml/khtml_part.cpp #869760:869761
@@ -2576,7 +2576,7 @@
   bool quirkyName = !n && !d->m_doc->inStrictMode() && (name.isEmpty() || name.toLower() == "top");
 
   if (quirkyName) {
-      d->m_view->setContentsPos(0, 0);
+      d->m_view->setContentsPos( d->m_view->contentsX(), 0);
       return true;
   } else if (!n) {
       kDebug(6050) << name << "not found";
--- trunk/KDE/kdelibs/khtml/khtmlview.cpp #869760:869761
@@ -786,7 +786,8 @@
 
 void KHTMLView::setContentsPos( int x, int y)
 {
-   horizontalScrollBar()->setValue( x );
+   horizontalScrollBar()->setValue( QApplication::isRightToLeft() ?
+                           horizontalScrollBar()->maximum()-x : x );
    verticalScrollBar()->setValue( y );
 }
 
@@ -2382,6 +2383,13 @@
             }
         }
       }
+      case QEvent::Move: {
+          if (static_cast<QMoveEvent*>(e)->pos() != QPoint(0,0)) {
+              widget()->move(0,0);
+              updateScrollBars();
+              return true;
+          }
+      }
       default:
         break;
     }
@@ -3870,6 +3878,8 @@
             unscheduleRelayout();
             layout();
         }
+        if (d->smoothScrollMode == KHTMLView::SSMWhenEfficient)
+            d->shouldSmoothScroll = false;
     }
 
     if ( d->smoothScrollMode != SSMDisabled &&
@@ -3888,6 +3898,9 @@
     if (m_part->xmlDocImpl() && m_part->xmlDocImpl()->documentElement())
         m_part->xmlDocImpl()->documentElement()->dispatchHTMLEvent(EventImpl::SCROLL_EVENT, false, false);
 
+    if (QApplication::isRightToLeft())
+        dx = -dx;
+
     if (!d->smoothScrolling) {
         d->updateContentsXY();
     } else {
@@ -3907,6 +3920,7 @@
         KHTMLView* v = m_kwp->rootViewPos( off );
         if (v)
             w = v->widget();
+        off = viewport()->mapTo(this, off);
     }
 
 #ifdef FIX_QT_BROKEN_QWIDGET_SCROLL
@@ -3967,8 +3981,6 @@
         }
         return;
     }
-    if (d->firstRepaintPending)
-        return;
 
 #ifdef FIX_QT_BROKEN_QWIDGET_SCROLL
     if (hideScrollBars) {
@@ -4359,6 +4371,9 @@
     horizontalScrollBar()->setPageStep(p.width());
     verticalScrollBar()->setRange(0, v.height() - p.height());
     verticalScrollBar()->setPageStep(p.height());
+    if (!d->smoothScrolling) {
+        d->updateContentsXY();
+    }
 }
 
 void KHTMLView::slotMouseScrollTimer()
--- trunk/KDE/kdelibs/khtml/rendering/render_block.cpp #869760:869761
@@ -2617,7 +2617,8 @@
         return false;
 
     if (m_layer->verticalScrollbarWidth()) {
-        QRect vertRect(_tx + width() - borderRight() - m_layer->verticalScrollbarWidth(),
+        bool rtl = QApplication::isRightToLeft();
+        QRect vertRect(_tx + (rtl ? borderLeft() :  width() - borderRight() - m_layer->verticalScrollbarWidth()),
                        _ty + borderTop() - borderTopExtra(),
                        m_layer->verticalScrollbarWidth(),
                        height() + borderTopExtra() + borderBottomExtra()-borderTop()-borderBottom());
--- trunk/KDE/kdelibs/khtml/rendering/render_layer.cpp #869760:869761
@@ -843,15 +843,16 @@
     if (!m_hBar)
        b = m_vBar;
     int sw = b->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
+    bool rtl = b->layoutDirection() == Qt::RightToLeft;
 
     if (m_vBar) {
-       QRect vBarRect = QRect(tx + w - sw, ty, sw, h - (m_hBar ? sw : 0));
+       QRect vBarRect = QRect(tx + (rtl ? 0 : w-sw), ty, sw, h - (m_hBar ? sw : 0));
         m_vBar->resize(vBarRect.width(), vBarRect.height());
         m_vBar->m_kwp->setPos(QPoint(vBarRect.x(), vBarRect.y()));
     }
 
     if (m_hBar) {
-       QRect hBarRect = QRect(tx, ty + h - sw, w - (m_vBar ? sw : 0), sw);
+       QRect hBarRect = QRect(tx + (rtl && m_vBar ? sw : 0), ty + h - sw, w - (!rtl && m_vBar ? sw : 0), sw);
         m_hBar->resize(hBarRect.width(), hBarRect.height());
         m_hBar->m_kwp->setPos(QPoint(hBarRect.x(), hBarRect.y()));
     }
--- trunk/KDE/kdelibs/khtml/rendering/render_replaced.cpp #869760:869761
@@ -794,7 +794,8 @@
             if (hbr.isValid() && !hbr.isEmpty())
                 copyWidget(hbr, p, v->horizontalScrollBar(), tx+ of.x(), ty+ of.y(), buffered, buffer[1]);
         }
-        QRect vr = (r & v->viewport()->rect());
+        QPoint of = v->viewport()->mapTo(v, QPoint(0,0));
+        QRect vr = (r & v->viewport()->rect().translated(of));
         if (vr.isValid() && !vr.isEmpty())
             v->render(p, vr, thePoint);
     } else {
Comment 7 Germain Garand 2008-10-10 01:47:34 UTC
*** Bug 170326 has been marked as a duplicate of this bug. ***
Comment 8 Daniel Richard G. 2008-10-12 17:32:05 UTC
Confirmed that the original bug can no longer be reproduced in an Oct. 12th build (while observable in one from Sep. 28). Thank you, GG, for striking this one down!
Comment 9 Germain Garand 2008-10-20 00:29:40 UTC
SVN commit 873671 by ggarand:

automatically merged revision 869761:
- fix incomplete repaints happening from time to time
  when jumping early during page load. (#166413)

- various RTL layout application (-reverse cmdline option) fixes
  . implement RTL scrollbars on CSS containers
  . fix iframes scrollbars in RTL mode
  . fix wrong direction when scrolling horizontally (#172258)
  . fix grey block on left of view (#170679)

- avoid smooth scrolling during early stage of layout if the option has
  the WhenEfficient value

BUG: 166413, 172258, 170679

 M  +1 -1      khtml_part.cpp  
 M  +18 -3     khtmlview.cpp  
 M  +2 -1      rendering/render_block.cpp  
 M  +3 -2      rendering/render_layer.cpp  
 M  +2 -1      rendering/render_replaced.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=873671