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

List:       kde-commits
Subject:    branches/KDE/4.1/kdelibs/khtml
From:       Germain Garand <germain () ebooksfrance ! org>
Date:       2008-10-19 22:29:38
Message-ID: 1224455378.884634.6270.nullmailer () svn ! kde ! org
[Download RAW message or body]

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  


--- branches/KDE/4.1/kdelibs/khtml/khtml_part.cpp #873670:873671
@@ -2572,7 +2572,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";
--- branches/KDE/4.1/kdelibs/khtml/khtmlview.cpp #873670:873671
@@ -785,7 +785,8 @@
 
 void KHTMLView::setContentsPos( int x, int y)
 {
-   horizontalScrollBar()->setValue( x );
+   horizontalScrollBar()->setValue( QApplication::isRightToLeft() ?
+                           horizontalScrollBar()->maximum()-x : x );
    verticalScrollBar()->setValue( y );
 }
 
@@ -2377,6 +2378,13 @@
             }
         }
       }
+      case QEvent::Move: {
+          if (static_cast<QMoveEvent*>(e)->pos() != QPoint(0,0)) {
+              widget()->move(0,0);
+              updateScrollBars();
+              return true;
+          }
+      }
       default:
         break;
     }
@@ -3878,6 +3886,8 @@
             unscheduleRelayout();
             layout();
         }
+        if (d->smoothScrollMode == KHTMLView::SSMWhenEfficient)
+            d->shouldSmoothScroll = false;
     }
 
     if ( d->smoothScrollMode != SSMDisabled &&
@@ -3896,6 +3906,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 {
@@ -3915,6 +3928,7 @@
         KHTMLView* v = m_kwp->rootViewPos( off );
         if (v)
             w = v->widget();
+        off = viewport()->mapTo(this, off);
     }
 
 #ifdef FIX_QT_BROKEN_QWIDGET_SCROLL
@@ -3975,8 +3989,6 @@
         }
         return;
     }
-    if (d->firstRepaintPending)
-        return;
 
 #ifdef FIX_QT_BROKEN_QWIDGET_SCROLL
     if (hideScrollBars) {
@@ -4363,6 +4375,9 @@
     horizontalScrollBar()->setPageStep(p.width());
     verticalScrollBar()->setRange(0, v.height() - p.height());
     verticalScrollBar()->setPageStep(p.height());
+    if (!d->smoothScrolling) {
+        d->updateContentsXY();
+    }
 }
 
 void KHTMLView::slotMouseScrollTimer()
--- branches/KDE/4.1/kdelibs/khtml/rendering/render_block.cpp #873670:873671
@@ -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());
--- branches/KDE/4.1/kdelibs/khtml/rendering/render_layer.cpp #873670:873671
@@ -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()));
     }
--- branches/KDE/4.1/kdelibs/khtml/rendering/render_replaced.cpp #873670:873671
@@ -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 {
[prev in list] [next in list] [prev in thread] [next in thread] 

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