[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 07:37:17 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 340a3d649dfb5f427c40e1778c57b4c7e0f223ef
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Apr 15 23:29:04 2003 +0000

    	Fix for 3220809, overflow values other than visible should not
    	affect the document's height (or document scrollbars).  This
    	fixes squidfingers.com and briefcase.yahoo.com
    
    	Also laying a bunch of groundwork for overflow:auto and scroll
    	by adding them as supported values now.
    
    	Fixed overflow so that overflow objects now dodge floats and
    	don't let them intrude into their space.
    
            Reviewed by darin
    
            * khtml/css/cssstyleselector.cpp:
            * khtml/rendering/render_block.cpp:
            * khtml/rendering/render_block.h:
            * khtml/rendering/render_box.cpp:
            (RenderBox::containingBlockWidth):
            (RenderBox::repaint):
            (RenderBox::repaintRectangle):
            (RenderBox::calcWidth):
            (RenderBox::calcAbsoluteVertical):
            (RenderBox::lowestPosition):
            (RenderBox::rightmostPosition):
            * khtml/rendering/render_box.h:
            * khtml/rendering/render_flow.cpp:
            (RenderFlow::repaint):
            (RenderFlow::lowestPosition):
            (RenderFlow::rightmostPosition):
            * khtml/rendering/render_flow.h:
            * khtml/rendering/render_layer.cpp:
            (RenderLayer::updateLayerPosition):
            (RenderLayer::convertToLayerCoords):
            (RenderLayer::scrollOffset):
            * khtml/rendering/render_layer.h:
            * khtml/rendering/render_object.cpp:
            (RenderObject::setLayouted):
            (RenderObject::detach):
            * khtml/rendering/render_object.h:
            * khtml/rendering/render_style.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 4c3e1ae..5015c67 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,45 @@
+2003-04-15  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3220809, overflow values other than visible should not
+	affect the document's height (or document scrollbars).  This
+	fixes squidfingers.com and briefcase.yahoo.com
+
+	Also laying a bunch of groundwork for overflow:auto and scroll
+	by adding them as supported values now.
+
+	Fixed overflow so that overflow objects now dodge floats and
+	don't let them intrude into their space.
+	
+        Reviewed by darin
+
+        * khtml/css/cssstyleselector.cpp:
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::containingBlockWidth):
+        (RenderBox::repaint):
+        (RenderBox::repaintRectangle):
+        (RenderBox::calcWidth):
+        (RenderBox::calcAbsoluteVertical):
+        (RenderBox::lowestPosition):
+        (RenderBox::rightmostPosition):
+        * khtml/rendering/render_box.h:
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::repaint):
+        (RenderFlow::lowestPosition):
+        (RenderFlow::rightmostPosition):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_layer.cpp:
+        (RenderLayer::updateLayerPosition):
+        (RenderLayer::convertToLayerCoords):
+        (RenderLayer::scrollOffset):
+        * khtml/rendering/render_layer.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::setLayouted):
+        (RenderObject::detach):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_style.h:
+
 2003-04-15  Trey Matteson  <trey at apple.com>
 
 	3229318 - no back entry created when searching at lonelyplanet.com
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4c3e1ae..5015c67 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,45 @@
+2003-04-15  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3220809, overflow values other than visible should not
+	affect the document's height (or document scrollbars).  This
+	fixes squidfingers.com and briefcase.yahoo.com
+
+	Also laying a bunch of groundwork for overflow:auto and scroll
+	by adding them as supported values now.
+
+	Fixed overflow so that overflow objects now dodge floats and
+	don't let them intrude into their space.
+	
+        Reviewed by darin
+
+        * khtml/css/cssstyleselector.cpp:
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::containingBlockWidth):
+        (RenderBox::repaint):
+        (RenderBox::repaintRectangle):
+        (RenderBox::calcWidth):
+        (RenderBox::calcAbsoluteVertical):
+        (RenderBox::lowestPosition):
+        (RenderBox::rightmostPosition):
+        * khtml/rendering/render_box.h:
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::repaint):
+        (RenderFlow::lowestPosition):
+        (RenderFlow::rightmostPosition):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_layer.cpp:
+        (RenderLayer::updateLayerPosition):
+        (RenderLayer::convertToLayerCoords):
+        (RenderLayer::scrollOffset):
+        * khtml/rendering/render_layer.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::setLayouted):
+        (RenderObject::detach):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_style.h:
+
 2003-04-15  Trey Matteson  <trey at apple.com>
 
 	3229318 - no back entry created when searching at lonelyplanet.com
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 2335ff0..049df1b 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -1893,12 +1893,11 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
         case CSS_VAL_VISIBLE:
             o = OVISIBLE; break;
         case CSS_VAL_HIDDEN:
+            o = OHIDDEN; break;
         case CSS_VAL_SCROLL:
+            o = OSCROLL; break;
         case CSS_VAL_AUTO:
-            // For now we map overflow:auto and overflow:scroll to overflow:hidden.
-            // This at least keeps the layout of the surrounding page correct until
-            // we provide support for auto and scroll values. -dwh
-            o = OHIDDEN; break;
+            o = OAUTO; break;
         default:
             return;
         }
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 506dadb..7bde4bf 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -481,7 +481,7 @@ void RenderBlock::layout()
             m_height += borderBottom() + paddingBottom();
         }
 
-        if (m_overflowHeight > m_height)
+        if (m_overflowHeight > m_height && !style()->hidesOverflow())
             m_height = m_overflowHeight + borderBottom() + paddingBottom();
     }
 
@@ -720,7 +720,8 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
         // Note this occurs after the test for positioning and floating above, since
         // we want to ensure that we don't artificially increase our height because of
         // a positioned or floating child.
-        if ( child->style()->flowAroundFloats() && !child->isFloating() &&
+        if ( (child->style()->hidesOverflow() || child->style()->flowAroundFloats())
+             && !child->isFloating() &&
              style()->width().isFixed() && child->minWidth() > lineWidth( m_height ) ) {
             m_height = QMAX( m_height, floatBottom() );
             shouldCollapseChild = false;
@@ -905,9 +906,11 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
 
         int chPos = xPos + child->marginLeft();
 
-        if(style()->direction() == LTR) {
+        if (style()->direction() == LTR) {
             // html blocks flow around floats
-            if ( ( style()->htmlHacks() || child->isTable() ) && child->style()->flowAroundFloats() ) 			{
+            if (child->style()->hidesOverflow() ||
+                 (( style()->htmlHacks() || child->isTable() ) && child->style()->flowAroundFloats()))
+            {
                 int leftOff = leftOffset(m_height);
                 if (leftOff != xPos) {
                     // The object is shifting right. The object might be centered, so we need to
@@ -924,7 +927,8 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             }
         } else {
             chPos -= child->width() + child->marginLeft() + child->marginRight();
-            if ( ( style()->htmlHacks() || child->isTable() ) && child->style()->flowAroundFloats() )
+            if (child->style()->hidesOverflow() ||
+                ((style()->htmlHacks() || child->isTable()) && child->style()->flowAroundFloats()))
                 chPos -= leftOffset(m_height);
         }
 
@@ -940,8 +944,9 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
         if (child->isRenderBlock())
             prevFlow = static_cast<RenderBlock*>(child); 
 
-        if ( child->hasOverhangingFloats() ) {
-            // need to add the float to our special objects
+        if ( child->hasOverhangingFloats() && !child->style()->hidesOverflow()) {
+            // need to add the child's floats to our floating objects list, but not in the case where
+            // overflow is auto/scroll
             addOverHangingFloats( static_cast<RenderBlock *>(child), -child->xPos(), -child->yPos(), true );
         }
 
@@ -1470,7 +1475,7 @@ RenderBlock::floatBottom() const
 }
 
 int
-RenderBlock::lowestPosition() const
+RenderBlock::lowestPosition(bool includeOverflowInterior) const
 {
     // We don't make any attempt to have this be correct for
     // any single object, since this is only done for the entire
@@ -1480,14 +1485,16 @@ RenderBlock::lowestPosition() const
     
     // FIXME: Maybe we can use m_overflowHeight instead?
 
-    int bottom = RenderFlow::lowestPosition();
-
+    int bottom = RenderFlow::lowestPosition(includeOverflowInterior);
+    if (!includeOverflowInterior && style()->hidesOverflow())
+        return bottom;
+    
     if (m_floatingObjects) {
         FloatingObject* r;
         QPtrListIterator<FloatingObject> it(*m_floatingObjects);
         for ( ; (r = it.current()); ++it ) {
             if (!r->noPaint) {
-                int lp = r->startY + r->node->lowestPosition();
+                int lp = r->startY + r->node->lowestPosition(false);
                 bottom = QMAX(bottom, lp);
             }
         }
@@ -1497,7 +1504,7 @@ RenderBlock::lowestPosition() const
         RenderObject* r;
         QPtrListIterator<RenderObject> it(*m_positionedObjects);
         for ( ; (r = it.current()); ++it ) {
-            int lp = r->yPos() + r->lowestPosition();
+            int lp = r->yPos() + r->lowestPosition(false);
             bottom = QMAX(bottom, lp);
         }
     }
@@ -1505,7 +1512,7 @@ RenderBlock::lowestPosition() const
     return bottom;
 }
 
-int RenderBlock::rightmostPosition() const
+int RenderBlock::rightmostPosition(bool checkScroll) const
 {
     // We don't make any attempt to have this be correct for
     // any single object, since this is only done for the entire
@@ -1515,14 +1522,16 @@ int RenderBlock::rightmostPosition() const
     
     // FIXME: Maybe we can use m_overflowWidth instead?
 
-    int right = RenderFlow::rightmostPosition();
-
+    int right = RenderFlow::rightmostPosition(checkScroll);
+    if (!checkScroll && style()->hidesOverflow())
+        return right;
+    
     if (m_floatingObjects) {
         FloatingObject* r;
         QPtrListIterator<FloatingObject> it(*m_floatingObjects);
         for ( ; (r = it.current()); ++it ) {
             if (!r->noPaint) {
-                int rp = r->left + r->node->rightmostPosition();
+                int rp = r->left + r->node->rightmostPosition(false);
            	right = QMAX(right, rp);
             }
         }
@@ -1532,7 +1541,7 @@ int RenderBlock::rightmostPosition() const
         RenderObject* r;
         QPtrListIterator<RenderObject> it(*m_positionedObjects);
         for ( ; (r = it.current()); ++it ) {
-            int rp = r->xPos() + r->rightmostPosition();
+            int rp = r->xPos() + r->rightmostPosition(false);
             right = QMAX(right, rp);
         }
     }
@@ -1584,7 +1593,7 @@ RenderBlock::clearFloats()
     // pass fAF's unless they contain overhanging stuff
     bool parentHasFloats = false;
     while (prev) {
-        if (!prev->isRenderBlock() || prev->isFloating() ||
+        if (!prev->isRenderBlock() || prev->isFloating() || prev->style()->hidesOverflow() ||
             (prev->style()->flowAroundFloats() &&
              // A <table> or <ul> can have a height of 0, so its ypos may be the same
              // as m_y.  That's why we have a <= and not a < here. -dwh
@@ -1617,8 +1626,8 @@ RenderBlock::clearFloats()
     if(!prev->isRenderBlock()) return;
     RenderBlock * flow = static_cast<RenderBlock *>(prev);
     if(!flow->m_floatingObjects) return;
-    if( ( style()->htmlHacks() || isTable() ) && style()->flowAroundFloats())
-        return; //html tables and lists flow as blocks
+    if (style()->hidesOverflow() || (( style()->htmlHacks() || isTable() ) && style()->flowAroundFloats()))
+        return; // these elements don't allow floats from previous blocks to intrude into their space.
 
     if(flow->floatBottom() > offset)
         addOverHangingFloats( flow, 0, offset );
@@ -1802,7 +1811,7 @@ void RenderBlock::calcMinMaxWidth()
     // We need to sanity-check our m_minWidth, and not let it exceed our clipped boundary. -dwh
     // FIXME: For now, punt on trying to apply this fix to table cells.  We don't know an accurate
     // width for the cell here, so we can't do a comparison.
-    if (style()->overflow() == OHIDDEN && m_minWidth > m_width && !isTableCell())
+    if (style()->hidesOverflow() && m_minWidth > m_width && !isTableCell())
         m_minWidth = m_width;
 
     setMinMaxKnown();
diff --git a/WebCore/khtml/rendering/render_block.h b/WebCore/khtml/rendering/render_block.h
index a306772..1fb7d0f 100644
--- a/WebCore/khtml/rendering/render_block.h
+++ b/WebCore/khtml/rendering/render_block.h
@@ -133,8 +133,8 @@ public:
     inline int rightBottom();
 
     virtual unsigned short lineWidth(int y) const;
-    virtual int lowestPosition() const;
-    virtual int rightmostPosition() const;
+    virtual int lowestPosition(bool includeOverflowInterior=true) const;
+    virtual int rightmostPosition(bool includeOverflowInterior=true) const;
 
     int rightOffset() const;
     int rightRelOffset(int y, int fixedOffset, int *heightRemaining = 0) const;
@@ -157,7 +157,7 @@ public:
     
     // overrides RenderObject
     virtual bool requiresLayer() { return !isTableCell() &&
-        (isPositioned() || isRelPositioned() || style()->overflow()==OHIDDEN); }
+        (isPositioned() || isRelPositioned() || style()->hidesOverflow()); }
     
 #ifndef NDEBUG
     virtual void printTree(int indent=0) const;
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 686a934..e59cf19 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -407,7 +407,7 @@ void RenderBox::close()
 short RenderBox::containingBlockWidth() const
 {
     RenderBlock* cb = containingBlock();
-    if (( style()->htmlHacks() || isTable() ) && style()->flowAroundFloats() 
+    if ((style()->hidesOverflow() || ((style()->htmlHacks() || isTable()) && style()->flowAroundFloats()))
             && style()->width().isVariable())
         return cb->lineWidth(m_y);
     else
@@ -450,14 +450,15 @@ void RenderBox::repaint(bool immediate)
 {
     //kdDebug( 6040 ) << "repaint!" << endl;
     int ow = style() ? style()->outlineWidth() : 0;
-    repaintRectangle(-ow, -ow, overflowWidth()+ow*2, overflowHeight()+ow*2, immediate);
+    repaintRectangle(-ow, -ow, effectiveWidth()+ow*2, effectiveHeight()+ow*2, immediate);
 }
 
 void RenderBox::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f)
 {
-    if (style()->overflow() == OHIDDEN) {
+    if (style()->hidesOverflow()) {
         int ow = style() ? style()->outlineWidth() : 0;
-        QRect boxRect(-ow, -ow, overflowWidth()+ow*2, overflowHeight()+ow*2);
+        QRect boxRect(-ow, -ow, width()+ow*2, height()+ow*2);
+        m_layer->scrollOffset(x,y); // For overflow:auto/scroll.
         QRect repaintRect(x, y, w, h);
         if (!repaintRect.intersects(boxRect))
             return;
@@ -527,7 +528,7 @@ void RenderBox::calcWidth()
 
         int cw;
         RenderBlock *cb = containingBlock();
-        if (style()->flowAroundFloats())
+        if (style()->hidesOverflow() || style()->flowAroundFloats())
             cw = cb->lineWidth( m_y );
         else
             cw = cb->contentWidth();
@@ -1134,9 +1135,7 @@ void RenderBox::calcAbsoluteVertical()
     if (m_height<h+pab) //content must still fit
         m_height = h+pab;
 
-    // This is a hack. The block shouldn't be getting stretched anyway.
-    // At least make overflow: hidden work. -dwh
-    if (style()->overflow() == OHIDDEN && m_height > h+pab)
+    if (style()->hidesOverflow() && m_height > h+pab)
         m_height = h+pab;
     
     m_marginTop = mt;
@@ -1148,12 +1147,12 @@ void RenderBox::calcAbsoluteVertical()
 }
 
 
-int RenderBox::lowestPosition() const
+int RenderBox::lowestPosition(bool checkScroll) const
 {
     return m_height + marginBottom();
 }
 
-int RenderBox::rightmostPosition() const
+int RenderBox::rightmostPosition(bool checkScroll) const
 {
     return m_width;
 }
diff --git a/WebCore/khtml/rendering/render_box.h b/WebCore/khtml/rendering/render_box.h
index aa996c4..1ffac9f 100644
--- a/WebCore/khtml/rendering/render_box.h
+++ b/WebCore/khtml/rendering/render_box.h
@@ -85,8 +85,8 @@ public:
 
     virtual void position(InlineBox* box, int from, int len, bool reverse);
     
-    virtual int lowestPosition() const;
-    virtual int rightmostPosition() const;
+    virtual int lowestPosition(bool includeOverflowInterior=true) const;
+    virtual int rightmostPosition(bool includeOverflowInterior=true) const;
 
     virtual void repaint(bool immediate=false);
 
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index dc45065..d582974 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -257,7 +257,7 @@ void RenderFlow::repaint(bool immediate)
         if (firstLineBox() && firstLineBox()->topOverflow() < 0) {
             int ow = style() ? style()->outlineWidth() : 0;
             repaintRectangle(-ow, -ow+firstLineBox()->topOverflow(),
-                             overflowWidth()+ow*2, overflowHeight()+ow*2, immediate);
+                             effectiveWidth()+ow*2, effectiveHeight()+ow*2, immediate);
         }
         else
             return RenderBox::repaint();
@@ -265,10 +265,12 @@ void RenderFlow::repaint(bool immediate)
 }
 
 int
-RenderFlow::lowestPosition() const
+RenderFlow::lowestPosition(bool includeOverflowInterior) const
 {
-    int bottom = RenderBox::lowestPosition();
-
+    int bottom = RenderBox::lowestPosition(includeOverflowInterior);
+    if (!includeOverflowInterior && style()->hidesOverflow())
+        return bottom;
+    
     // FIXME: It's not OK to look only at the last non-floating
     // non-positioned child (e.g., negative margins, or a child that itself has
     // overflow that goes beyond the last child).  We want to switch over to using overflow,
@@ -278,7 +280,7 @@ RenderFlow::lowestPosition() const
     if (isRenderBlock() || checkOverhangsOnly) {
         for (RenderObject *c = lastChild(); c; c = c->previousSibling()) {
             if (!c->isFloatingOrPositioned() && (!checkOverhangsOnly || c->overhangingContents())) {
-                int lp = c->yPos() + c->lowestPosition();
+                int lp = c->yPos() + c->lowestPosition(false);
                 bottom = QMAX(bottom, lp);
                 break;
             }
@@ -288,16 +290,18 @@ RenderFlow::lowestPosition() const
     return bottom;
 }
 
-int RenderFlow::rightmostPosition() const
+int RenderFlow::rightmostPosition(bool includeOverflowInterior) const
 {
-    int right = RenderBox::rightmostPosition();
-
+    int right = RenderBox::rightmostPosition(includeOverflowInterior);
+    if (!includeOverflowInterior && style()->hidesOverflow())
+        return right;
+    
     // FIXME: We want to switch over to using overflow,
     // but we tried it and it didn't work, so there must be some issues with overflow that
     // still need to be worked out.
     for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
         if (!c->isFloatingOrPositioned()) {
-            int rp = c->xPos() + c->rightmostPosition();
+            int rp = c->xPos() + c->rightmostPosition(false);
             right = QMAX(right, rp);
         }
     }
diff --git a/WebCore/khtml/rendering/render_flow.h b/WebCore/khtml/rendering/render_flow.h
index 13bbda3..d0b3cfe 100644
--- a/WebCore/khtml/rendering/render_flow.h
+++ b/WebCore/khtml/rendering/render_flow.h
@@ -71,8 +71,8 @@ public:
 
     virtual void repaint(bool immediate = false);
 
-    virtual int lowestPosition() const;
-    virtual int rightmostPosition() const;
+    virtual int lowestPosition(bool includeOverflowInterior=true) const;
+    virtual int rightmostPosition(bool includeOverflowInterior=true) const;
     
 protected:
     // An inline can be split with blocks occurring in between the inline content.
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index b218bb7..7e4a05e 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -99,11 +99,13 @@ void RenderLayer::updateLayerPosition()
         static_cast<RenderBox*>(m_object)->relativePositionOffset(x, y);
     
     setPos(x,y);
-    
-    if (m_object->overflowWidth() > m_object->width())
-        setWidth(m_object->overflowWidth());
-    if (m_object->overflowHeight() > m_object->height())
-        setHeight(m_object->overflowHeight());
+
+    if (!m_object->style()->hidesOverflow()) {
+        if (m_object->overflowWidth() > m_object->width())
+            setWidth(m_object->overflowWidth());
+        if (m_object->overflowHeight() > m_object->height())
+            setHeight(m_object->overflowHeight());
+    }
 }
 
 RenderLayer*
@@ -253,6 +255,12 @@ RenderLayer::convertToLayerCoords(RenderLayer* ancestorLayer, int& x, int& y)
 }
 
 void
+RenderLayer::scrollOffset(int& x, int& y)
+{
+    // FIXME: Implement for overflow:auto/scroll
+}
+
+void
 RenderLayer::paint(QPainter *p, int x, int y, int w, int h, bool selectionOnly)
 {
     // Create the z-tree of layers that should be displayed.
diff --git a/WebCore/khtml/rendering/render_layer.h b/WebCore/khtml/rendering/render_layer.h
index 1f602c9..005fbe7 100644
--- a/WebCore/khtml/rendering/render_layer.h
+++ b/WebCore/khtml/rendering/render_layer.h
@@ -101,6 +101,8 @@ public:
         m_x = xPos;
         m_y = yPos;
     }
+
+    void scrollOffset(int& x, int& y);
     
     void updateLayerPosition();
     
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index a4d0bdd..13bda0e 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -377,12 +377,12 @@ void RenderObject::setLayouted(bool b)
         // shouldn't be needed, and it's unfortunate that it is necessary.  -dwh
 
         RenderObject* clippedObj = 
-            (style()->overflow() == OHIDDEN && !isText()) ? this : 0;
+            (style()->hidesOverflow() && !isText()) ? this : 0;
         
         while( o ) {
             root = o;
             o->m_layouted = false;
-            if (o->style()->overflow() == OHIDDEN && !clippedObj)
+            if (o->style()->hidesOverflow() && !clippedObj)
                 clippedObj = o;
             o = o->container();
         }
@@ -1146,7 +1146,7 @@ void RenderObject::detach(RenderArena* renderArena)
 {
     // If we're an overflow:hidden object that currently needs layout, we need
     // to make sure the view isn't holding on to us.
-    if (!layouted() && style()->overflow() == OHIDDEN) {
+    if (!layouted() && style()->hidesOverflow()) {
         RenderRoot* r = root();
         if (r && r->view()->layoutObject() == this)
             r->view()->unscheduleRelayout();
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 8237e82..973328d 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -120,7 +120,7 @@ public:
     virtual QRect getOverflowClipRect(int tx, int ty) { return QRect(0,0,0,0); }
     virtual QRect getClipRect(int tx, int ty) { return QRect(0,0,0,0); }
     bool hasClip() { return isPositioned() &&  style()->hasClip(); }
-    bool hasOverflowClip() { return style()->overflow() == OHIDDEN; }
+    bool hasOverflowClip() { return style()->hidesOverflow(); }
 
     virtual int getBaselineOfFirstLineBox() { return -1; } // Tables and blocks implement this.
     virtual InlineFlowBox* getFirstLineBox() { return 0; } // Tables and blocks implement this.
@@ -407,14 +407,18 @@ public:
     virtual short width() const { return 0; }
     virtual int height() const { return 0; }
 
-    // The height of a block when you include overflow spillage out of the bottom
+    // The height of a block when you include normal flow overflow spillage out of the bottom
     // of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside
     // it would have an overflow height of borderTop() + paddingTop() + 100px.
     virtual int overflowHeight() const { return height(); }
     virtual int overflowWidth() const { return width(); }
     virtual void setOverflowHeight(int) {}
     virtual void setOverflowWidth(int) {}
-    
+
+    // Gives the effective overflow width/height once you factor in the object's overflow style.
+    int effectiveHeight() const { return style()->hidesOverflow() ? height() : overflowHeight(); }
+    int effectiveWidth() const { return style()->hidesOverflow() ? width() : overflowWidth(); }
+
     // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (render_flow) 
     // to return the remaining width on a given line (and the height of a single line). -dwh
     virtual short offsetWidth() const { return width(); }
@@ -535,9 +539,9 @@ public:
 
     virtual void cursorPos(int /*offset*/, int &/*_x*/, int &/*_y*/, int &/*height*/);
 
-    virtual int lowestPosition() const {return 0;}
+    virtual int lowestPosition(bool includeOverflowInterior=true) const {return 0;}
 
-    virtual int rightmostPosition() const {return 0;}
+    virtual int rightmostPosition(bool includeOverflowInterior=true) const {return 0;}
 
     // recursively invalidate current layout
     // unused: void invalidateLayout();
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index a6832f3..1f3270d 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -298,7 +298,7 @@ public:
 // Random visual rendering model attributes. Not inherited.
 
 enum EOverflow {
-    OVISIBLE, OHIDDEN, SCROLL, AUTO
+    OVISIBLE, OHIDDEN, OSCROLL, OAUTO
 };
 
 enum EVerticalAlign {
@@ -606,7 +606,7 @@ protected:
 
 	noninherited_flags._display = INLINE;
 	noninherited_flags._bg_repeat = REPEAT;
-	noninherited_flags._bg_attachment = SCROLL;
+	noninherited_flags._bg_attachment = true;
 	noninherited_flags._overflow = OVISIBLE;
 	noninherited_flags._vertical_align = BASELINE;
 	noninherited_flags._clear = CNONE;
@@ -701,6 +701,9 @@ public:
     const QColor &  	    outlineColor() const {  return background->outline.color; }
 
     EOverflow overflow() const { return  noninherited_flags._overflow; }
+    bool hidesOverflow() const { return overflow() != OVISIBLE; }
+    bool scrollsOverflow() const { return overflow() == OSCROLL || overflow() == OAUTO; }
+
     EVisibility visibility() const { return inherited_flags._visibility; }
     EVerticalAlign verticalAlign() const { return  noninherited_flags._vertical_align; }
     Length verticalAlignLength() const { return box->vertical_align; }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list