[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:14:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit dda1d1b433438dc78cf31d4630ffffcfcb703e05
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 13 09:44:17 2002 +0000

    	Fix for 3121865, content missing at disney.com.  Make
    	sure blocks track width overflow as well as height
    	overflow and ensure that a layer's dimensions expand
    	to encompass both width and height overflow.
    
    	Also fixes a bug with line breaking that allowed unbreakable
    	words to actually be broken up when they were the only word
    	on a line.  This is wrong and differs from all other
    	browsers, so the patch in bidi.cpp fixes us to match
    	other browsers.  (This was required to fix the above bug.)
    
            Reviewed by mjs.
    
            * khtml/rendering/bidi.cpp:
            (RenderFlow::findNextLineBreak):
            * khtml/rendering/render_flow.cpp:
            (RenderFlow::RenderFlow):
            (RenderFlow::layout):
            (RenderFlow::layoutBlockChildren):
            * khtml/rendering/render_flow.h:
            * khtml/rendering/render_layer.cpp:
            (RenderLayer::updateLayerPosition):
            * khtml/rendering/render_object.cpp:
            (RenderObject::nodeAtPoint):
            * khtml/rendering/render_object.h:
            * khtml/rendering/render_table.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3032 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 11e50c7..740f39c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,32 @@
+2002-12-13  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3121865, content missing at disney.com.  Make
+	sure blocks track width overflow as well as height
+	overflow and ensure that a layer's dimensions expand
+	to encompass both width and height overflow.
+
+	Also fixes a bug with line breaking that allowed unbreakable
+	words to actually be broken up when they were the only word
+	on a line.  This is wrong and differs from all other
+	browsers, so the patch in bidi.cpp fixes us to match
+	other browsers.  (This was required to fix the above bug.)
+	
+        Reviewed by mjs.
+
+        * khtml/rendering/bidi.cpp:
+        (RenderFlow::findNextLineBreak):
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::RenderFlow):
+        (RenderFlow::layout):
+        (RenderFlow::layoutBlockChildren):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_layer.cpp:
+        (RenderLayer::updateLayerPosition):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::nodeAtPoint):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_table.h:
+
 2002-12-12  Richard Williamson   <rjw at apple.com>
 
         Fixed 3116584.  Made letter-spacing, word-spacing, and text-decoration play
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 11e50c7..740f39c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2002-12-13  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3121865, content missing at disney.com.  Make
+	sure blocks track width overflow as well as height
+	overflow and ensure that a layer's dimensions expand
+	to encompass both width and height overflow.
+
+	Also fixes a bug with line breaking that allowed unbreakable
+	words to actually be broken up when they were the only word
+	on a line.  This is wrong and differs from all other
+	browsers, so the patch in bidi.cpp fixes us to match
+	other browsers.  (This was required to fix the above bug.)
+	
+        Reviewed by mjs.
+
+        * khtml/rendering/bidi.cpp:
+        (RenderFlow::findNextLineBreak):
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::RenderFlow):
+        (RenderFlow::layout):
+        (RenderFlow::layoutBlockChildren):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_layer.cpp:
+        (RenderLayer::updateLayerPosition):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::nodeAtPoint):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_table.h:
+
 2002-12-12  Richard Williamson   <rjw at apple.com>
 
         Fixed 3116584.  Made letter-spacing, word-spacing, and text-decoration play
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 8cbfb34..e7ef5bd 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -1430,7 +1430,7 @@ BidiIterator RenderFlow::findNextLineBreak(BidiIterator &start, QPtrList<BidiIte
     }
 
  end:
-
+    int determinedWidth = w + tmpW;
     if( lBreak == start && !lBreak.obj->isBR() ) {
         // we just add as much as possible
         if ( m_pre ) {
@@ -1443,27 +1443,24 @@ BidiIterator RenderFlow::findNextLineBreak(BidiIterator &start, QPtrList<BidiIte
             }
         } else if( lBreak.obj ) {
             if( last != o ) {
-                // better break between object boundaries than in the middle of a word
+                // better to break between object boundaries than in the middle of a word
                 lBreak.obj = o;
                 lBreak.pos = 0;
+                determinedWidth -= tmpW;
             } else {
-                int w = 0;
-                if( lBreak.obj->isText() )
-                    w += static_cast<RenderText *>(lBreak.obj)->width(lBreak.pos, 1);
-                else
-                    w += lBreak.obj->width();
-                while( lBreak.obj && w < width ) {
-                    ++lBreak;
-                    if( !lBreak.obj ) break;
-                    if( lBreak.obj->isText() )
-                    w += static_cast<RenderText *>(lBreak.obj)->width(lBreak.pos, 1);
-                    else
-                    w += lBreak.obj->width();
-                }
+                // Don't ever break in the middle of a word if we can help it.
+                // There's no room at all. We just have to be on this line,
+                // even though we'll spill out.
+                lBreak.obj = o;
+                lBreak.pos = pos;
             }
         }
     }
 
+    // FIXME: XXXdwh Support rtl.
+    if (style()->direction() == LTR && m_overflowWidth < borderLeft() + paddingLeft() + determinedWidth)
+        m_overflowWidth = borderLeft() + paddingLeft() + determinedWidth;
+    
     // make sure we consume at least one char/object.
     if( lBreak == start )
         ++lBreak;
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 0e7c82c..8d8d21e 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -58,6 +58,7 @@ RenderFlow::RenderFlow(DOM::NodeImpl* node)
     m_maxTopPosMargin = m_maxTopNegMargin = m_maxBottomPosMargin = m_maxBottomNegMargin = 0;
     m_topMarginQuirk = m_bottomMarginQuirk = false;
     m_overflowHeight = 0;
+    m_overflowWidth = 0;
     
     m_continuation = 0;
 }
@@ -232,7 +233,8 @@ void RenderFlow::layout()
     int oldWidth = m_width;
 
     calcWidth();
-
+    m_overflowWidth = m_width;
+    
     bool relayoutChildren = false;
     if ( oldWidth != m_width )
         relayoutChildren = true;
@@ -331,8 +333,10 @@ void RenderFlow::layout()
     }
     
     // overflow:hidden will just clip, so we don't have overflow.
-    if (style()->overflow()==OHIDDEN)
+    if (style()->overflow()==OHIDDEN) {
         m_overflowHeight = m_height;
+        m_overflowWidth = m_width;
+    }
     
     if (isTableCell()) {
         // Table cells need to grow to accommodate both overhanging floats and
@@ -371,6 +375,10 @@ void RenderFlow::layout()
         m_maxBottomNegMargin = m_maxBottomPosMargin = 0;
     }
 
+    // Always ensure our overflow width is at least as large as our width.
+    if (m_overflowWidth < m_width)
+        m_overflowWidth = m_width;
+        
     setLayouted();
 }
 
@@ -717,6 +725,12 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
             addOverHangingFloats( static_cast<RenderFlow *>(child), -child->xPos(), -child->yPos(), true );
         }
 
+        // See if this child has made our overflow need to grow.
+        // XXXdwh Work with left overflow as well as right overflow.
+        int rightChildPos = child->overflowWidth() + child->xPos();
+        if (rightChildPos > m_overflowWidth)
+            m_overflowWidth = rightChildPos;
+            
         child = child->nextSibling();
     }
 
@@ -744,7 +758,7 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
     // Always make sure our overflowheight is at least our height.
     if (m_overflowHeight < m_height)
         m_overflowHeight = m_height;
-   
+        
     if (canCollapseWithChildren && !topMarginContributor) {
         // Update our max pos/neg bottom margins, since we collapsed our bottom margins
         // with our children.
diff --git a/WebCore/khtml/rendering/render_flow.h b/WebCore/khtml/rendering/render_flow.h
index 236c393..8aea16f 100644
--- a/WebCore/khtml/rendering/render_flow.h
+++ b/WebCore/khtml/rendering/render_flow.h
@@ -165,10 +165,11 @@ public:
     void bidiReorderLine(const BidiIterator &start, const BidiIterator &end);
     BidiIterator findNextLineBreak(BidiIterator &start, QPtrList<BidiIterator>& midpoints);
 
-    // The height of a block when you include overflow spillage out of the bottom
+    // The height (and width) of a block when you include 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 m_overflowHeight; }
+    virtual int overflowWidth() const { return m_overflowWidth; }
     
     virtual bool isSelfCollapsingBlock() const { return m_height == 0; }
     virtual bool isTopMarginQuirk() const { return m_topMarginQuirk; }
@@ -244,9 +245,11 @@ private:
     bool m_topMarginQuirk;
     bool m_bottomMarginQuirk;
     
-    // How much content overflows out of our block vertically (all we support
-    // for now is spillage out of the bottom, which is the common case).
+    // How much content overflows out of our block vertically or horizontally (all we support
+    // for now is spillage out of the bottom and the right, which are the common cases).
+    // XXX Generalize to work with top and left as well.
     int m_overflowHeight;
+    int m_overflowWidth;
     
     // An inline can be split with blocks occurring in between the inline content.
     // When this occurs we need a pointer to our next object.  We can basically be
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index 49d76af..fc448cc 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -72,6 +72,11 @@ 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());
 }
 
 RenderLayer*
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index f400f56..da74609 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -1035,8 +1035,8 @@ bool RenderObject::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
     int tx = _tx + xPos();
     int ty = _ty + yPos();
     
-    inside |= (style()->visibility() != HIDDEN && ((_y >= ty) && (_y < ty + height()) &&
-                  (_x >= tx) && (_x < tx + width()))) || isBody() || isHtml();
+    inside |= (style()->visibility() != HIDDEN && ((_y >= ty) && (_y < ty + overflowHeight()) &&
+                  (_x >= tx) && (_x < tx + overflowWidth()))) || isBody() || isHtml();
     
     // ### table should have its own, more performant method
     if (overhangingContents() || isInline() || isRoot() || isTableRow() || isTableSection() || inside || mouseInside() ) {
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index b448329..b7f06b4 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -384,6 +384,7 @@ public:
     // 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(); }
     
     // 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
diff --git a/WebCore/khtml/rendering/render_table.h b/WebCore/khtml/rendering/render_table.h
index f43a095..caa762a 100644
--- a/WebCore/khtml/rendering/render_table.h
+++ b/WebCore/khtml/rendering/render_table.h
@@ -105,6 +105,8 @@ public:
     void recalcColInfos();
 
     // overrides
+    virtual int overflowHeight() const { return height(); }
+    virtual int overflowWidth() const { return width(); }
     virtual void addChild(RenderObject *child, RenderObject *beforeChild = 0);
     virtual void paint(QPainter *, int x, int y, int w, int h,
                        int tx, int ty, int paintPhase);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list