[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:07:28 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a43aa62bad069407cc84f422139136eb8976a384
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 30 08:26:30 2003 +0000

    	Fix for 3466628, widgets in overflow blocks don't move when the overflow block is scrolled.  This
    	was a regression caused by my change to move widgets only during layout and not at paint time.  The
    	problem with this is that scrolling an overflow block doesn't do a layout, just a repaint.  I patched
    	the layer code to update widget positions on an overflow block scroll.
    
    	This then exposed a bug in absolutePosition, namely that the scroll offset was never factored in when
    	computing absolutePosition.  This bug also explains why text selection and cursor display were wrong
    	inside scrolled overflow blocks.
    
            Reviewed by mjs
    
            * khtml/rendering/render_box.cpp:
            (RenderBox::absolutePosition):
            * khtml/rendering/render_layer.cpp:
            (RenderLayer::scrollToOffset):
            * khtml/rendering/render_object.cpp:
            (RenderObject::absolutePosition):
            * khtml/rendering/render_text.cpp:
            (RenderText::cursorPos):
            (RenderText::posOfChar):
            * khtml/rendering/render_text.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 2df8234..c0cceee 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,27 @@
+2003-10-29  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3466628, widgets in overflow blocks don't move when the overflow block is scrolled.  This
+	was a regression caused by my change to move widgets only during layout and not at paint time.  The
+	problem with this is that scrolling an overflow block doesn't do a layout, just a repaint.  I patched
+	the layer code to update widget positions on an overflow block scroll.
+
+	This then exposed a bug in absolutePosition, namely that the scroll offset was never factored in when
+	computing absolutePosition.  This bug also explains why text selection and cursor display were wrong
+	inside scrolled overflow blocks.
+	
+        Reviewed by mjs
+
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::absolutePosition):
+        * khtml/rendering/render_layer.cpp:
+        (RenderLayer::scrollToOffset):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::absolutePosition):
+        * khtml/rendering/render_text.cpp:
+        (RenderText::cursorPos):
+        (RenderText::posOfChar):
+        * khtml/rendering/render_text.h:
+
 2003-10-29  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index fd01a38..fee3ddd 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -529,11 +529,15 @@ bool RenderBox::absolutePosition(int &xPos, int &yPos, bool f)
     RenderObject *o = container();
     if( o && o->absolutePosition(xPos, yPos, f))
     {
+        if (o->style()->hidesOverflow() && o->layer())
+            o->layer()->subtractScrollOffset(xPos, yPos); 
+            
         if(!isInline() || isReplaced())
             xPos += m_x, yPos += m_y;
 
         if(isRelPositioned())
             relativePositionOffset(xPos, yPos);
+
         return true;
     }
     else
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index d927b7d..19bdb9c 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -452,7 +452,12 @@ RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repaint)
     m_scrollY = y;
 
     // FIXME: Fire the onscroll DOM event.
-    
+
+#if APPLE_CHANGES
+    // Move our widgets.
+    m_object->updateWidgetPositions();
+#endif
+
     // Just schedule a full repaint of our object.
     if (repaint)
         m_object->repaint(true);
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 5a1c18c..772d2e7 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -1286,8 +1286,13 @@ QRect RenderObject::viewRect() const
 
 bool RenderObject::absolutePosition(int &xPos, int &yPos, bool f)
 {
-    if(parent())
-        return parent()->absolutePosition(xPos, yPos, f);
+    RenderObject* o = parent();
+    if (o) {
+        o->absolutePosition(xPos, yPos, f);
+        if (o->style()->hidesOverflow() && o->layer())
+            o->layer()->subtractScrollOffset(xPos, yPos); 
+        return true;
+    }
     else
     {
         xPos = yPos = 0;
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 2579e2a..354bc41 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -492,34 +492,14 @@ void RenderText::cursorPos(int offset, int &_x, int &_y, int &height)
       _x += fm.rightBearing( *(str->s + s->m_start + pos - 1 ) );
 
   int absx, absy;
-
-  RenderObject *cb = containingBlock();
-
-  if (cb && cb != this && cb->absolutePosition(absx,absy))
-  {
-    _x += absx;
-    _y += absy;
-  } else {
-    // we don't know our absolute position, and there is not point returning
-    // just a relative one
-    _x = _y = -1;
-  }
-}
-
-bool RenderText::absolutePosition(int &xPos, int &yPos, bool)
-{
-    return RenderObject::absolutePosition(xPos, yPos, false);
+  absolutePosition(absx,absy);
+  _x += absx;
+  _y += absy;
 }
 
 void RenderText::posOfChar(int chr, int &x, int &y)
 {
-    if (!parent())
-    {
-       x = -1;
-       y = -1;
-       return;
-    }
-    parent()->absolutePosition( x, y, false );
+    absolutePosition( x, y, false );
 
     //if( chr > (int) str->l )
     //chr = str->l;
diff --git a/WebCore/khtml/rendering/render_text.h b/WebCore/khtml/rendering/render_text.h
index 839da0e..ea4043b 100644
--- a/WebCore/khtml/rendering/render_text.h
+++ b/WebCore/khtml/rendering/render_text.h
@@ -194,7 +194,6 @@ public:
     virtual SelectionState selectionState() const {return m_selectionState;}
     virtual void setSelectionState(SelectionState s) {m_selectionState = s; }
     virtual void cursorPos(int offset, int &_x, int &_y, int &height);
-    virtual bool absolutePosition(int &/*xPos*/, int &/*yPos*/, bool f = false);
     void posOfChar(int ch, int &x, int &y);
 
     virtual short marginLeft() const { return style()->marginLeft().minWidth(0); }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list