[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:49:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c9e2ce03b888dee9e9223a95a667c25fed75d726
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 1 17:40:55 2003 +0000

    	Fix for 3347286, hang on pepboys.com.  Text-indent had numerous bugs that
    	resulted in an infinite loop because some incorrect values were being compared.
    	This patch changes floats to ignore text-indent when positioning themselves
    	(as they should).
    
    	The maxwidth computation also didn't deal properly with text-indent, applying it
    	multiple times instead of once, and also only applying it for text and not for
    	inline replaced elements (images, form controls, etc.).
    
    	With these changes pepboys.com renders correctly.  This patch also conveniently fixes
    	the last rendering error on meyerweb's Matrix stylesheet.
    
            Reviewed by darin
    
            * khtml/rendering/render_block.cpp:
            * khtml/rendering/render_block.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 254a116..1fc8492 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,22 @@
+2003-07-31  Dave Hyatt  <hyatt at apple.com>
+
+	Fix for 3347286, hang on pepboys.com.  Text-indent had numerous bugs that
+	resulted in an infinite loop because some incorrect values were being compared.
+	This patch changes floats to ignore text-indent when positioning themselves
+	(as they should).
+
+	The maxwidth computation also didn't deal properly with text-indent, applying it
+	multiple times instead of once, and also only applying it for text and not for
+	inline replaced elements (images, form controls, etc.).
+
+	With these changes pepboys.com renders correctly.  This patch also conveniently fixes
+	the last rendering error on meyerweb's Matrix stylesheet.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+
 2003-07-31  Richard Williamson   <rjw at apple.com>
 
 	Fixed 3359152.  SPI to get the background color for a frame.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 254a116..1fc8492 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,22 @@
+2003-07-31  Dave Hyatt  <hyatt at apple.com>
+
+	Fix for 3347286, hang on pepboys.com.  Text-indent had numerous bugs that
+	resulted in an infinite loop because some incorrect values were being compared.
+	This patch changes floats to ignore text-indent when positioning themselves
+	(as they should).
+
+	The maxwidth computation also didn't deal properly with text-indent, applying it
+	multiple times instead of once, and also only applying it for text and not for
+	inline replaced elements (images, form controls, etc.).
+
+	With these changes pepboys.com renders correctly.  This patch also conveniently fixes
+	the last rendering error on meyerweb's Matrix stylesheet.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+
 2003-07-31  Richard Williamson   <rjw at apple.com>
 
 	Fixed 3359152.  SPI to get the background color for a frame.
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 4f61672..032e6d8 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -1314,11 +1314,11 @@ void RenderBlock::positionNewFloats()
                 y = QMAX( leftBottom(), y );
             int heightRemainingLeft = 1;
             int heightRemainingRight = 1;
-            int fx = leftRelOffset(y,lo, &heightRemainingLeft);
-            while (rightRelOffset(y,ro, &heightRemainingRight)-fx < fwidth)
+            int fx = leftRelOffset(y,lo, false, &heightRemainingLeft);
+            while (rightRelOffset(y,ro, false, &heightRemainingRight)-fx < fwidth)
             {
                 y += QMIN( heightRemainingLeft, heightRemainingRight );
-                fx = leftRelOffset(y,lo, &heightRemainingLeft);
+                fx = leftRelOffset(y,lo, false, &heightRemainingLeft);
             }
             if (fx<0) fx=0;
             f->left = fx;
@@ -1331,11 +1331,11 @@ void RenderBlock::positionNewFloats()
                 y = QMAX( rightBottom(), y );
             int heightRemainingLeft = 1;
             int heightRemainingRight = 1;
-            int fx = rightRelOffset(y,ro, &heightRemainingRight);
-            while (fx - leftRelOffset(y,lo, &heightRemainingLeft) < fwidth)
+            int fx = rightRelOffset(y,ro, false, &heightRemainingRight);
+            while (fx - leftRelOffset(y,lo, false, &heightRemainingLeft) < fwidth)
             {
                 y += QMIN(heightRemainingLeft, heightRemainingRight);
-                fx = rightRelOffset(y,ro, &heightRemainingRight);
+                fx = rightRelOffset(y,ro, false, &heightRemainingRight);
             }
             if (fx<f->width) fx=f->width;
             f->left = fx - f->width;
@@ -1385,7 +1385,8 @@ RenderBlock::leftOffset() const
 }
 
 int
-RenderBlock::leftRelOffset(int y, int fixedOffset, int *heightRemaining ) const
+RenderBlock::leftRelOffset(int y, int fixedOffset, bool applyTextIndent,
+                           int *heightRemaining ) const
 {
     int left = fixedOffset;
     if (m_floatingObjects) {
@@ -1404,7 +1405,7 @@ RenderBlock::leftRelOffset(int y, int fixedOffset, int *heightRemaining ) const
         }
     }
 
-    if ( m_firstLine && style()->direction() == LTR ) {
+    if (applyTextIndent && m_firstLine && style()->direction() == LTR) {
         int cw=0;
         if (style()->textIndent().isPercent())
             cw = containingBlock()->contentWidth();
@@ -1425,7 +1426,8 @@ RenderBlock::rightOffset() const
 }
 
 int
-RenderBlock::rightRelOffset(int y, int fixedOffset, int *heightRemaining ) const
+RenderBlock::rightRelOffset(int y, int fixedOffset, bool applyTextIndent,
+                            int *heightRemaining ) const
 {
     int right = fixedOffset;
 
@@ -1445,7 +1447,7 @@ RenderBlock::rightRelOffset(int y, int fixedOffset, int *heightRemaining ) const
         }
     }
     
-    if ( m_firstLine && style()->direction() == RTL ) {
+    if (applyTextIndent && m_firstLine && style()->direction() == RTL) {
         int cw=0;
         if (style()->textIndent().isPercent())
             cw = containingBlock()->contentWidth();
@@ -1973,6 +1975,8 @@ void RenderBlock::calcInlineMinMaxWidth()
     normal = oldnormal = style()->whiteSpace() == NORMAL;
 
     InlineMinMaxIterator childIterator(this, this);
+    RenderObject* prev = 0;
+    bool addedTextIndent = false; // Only gets added in once.
     while (RenderObject* child = childIterator.next())
     {
         normal = child->style()->whiteSpace() == NORMAL;
@@ -1984,6 +1988,19 @@ void RenderBlock::calcInlineMinMaxWidth()
             // the new min-width, if it is the widest chunk seen so far, and
             // it can also become the max-width.
 
+            // For floats, unless the previous element was floating,
+            // we terminate the current line as far as maxwidth
+            // is concerned.
+            // FIXME: This is insanely hard to get right.  Floats can have 'clear' set
+            // on them, which would force them to dodge one another.  Floats can have left
+            // or right alignment as well, and technically a right-aligned float could
+            // sit on the same line even if the previous element is text.
+            // At some point think about clear and float alignment here.
+            if (child->isFloating() && (!prev || !prev->isFloating())) {
+                if (m_maxWidth < inlineMax) m_maxWidth = inlineMax;
+                inlineMax = 0;
+            }
+            
             // Children fall into three categories:
             // (1) An inline flow object.  These objects always have a min/max of 0,
             // and are included in the iteration solely so that their margins can
@@ -2056,6 +2073,15 @@ void RenderBlock::calcInlineMinMaxWidth()
                     inlineMin = 0;
                 }
 
+                // Add in text-indent.  This is added in only once.
+                int ti = 0;
+                if (!addedTextIndent) {
+                    addedTextIndent = true;
+                    ti = style()->textIndent().minWidth(cw);
+                    childMin+=ti;
+                    childMax+=ti;
+                }
+                
                 // Add our width to the max.
                 inlineMax += childMax;
 
@@ -2098,11 +2124,15 @@ void RenderBlock::calcInlineMinMaxWidth()
                 else
                     trailingSpaceChild = 0;
 
-                // Add in text-indent.
-                int ti = cstyle->textIndent().minWidth(cw);
-                childMin+=ti; beginMin += ti;
-                childMax+=ti; beginMax += ti;
-
+                // Add in text-indent.  This is added in only once.
+                int ti = 0;
+                if (!addedTextIndent) {
+                    addedTextIndent = true;
+                    ti = style()->textIndent().minWidth(cw);
+                    childMin+=ti; beginMin += ti;
+                    childMax+=ti; beginMax += ti;
+                }
+                
                 // If we have no breakable characters at all,
                 // then this is the easy case. We add ourselves to the current
                 // min and max and continue.
@@ -2156,6 +2186,7 @@ void RenderBlock::calcInlineMinMaxWidth()
         }
 
         oldnormal = normal;
+        prev = child;
     }
 
     if (trailingSpaceChild && trailingSpaceChild->isText() && !m_pre) {
diff --git a/WebCore/khtml/rendering/render_block.h b/WebCore/khtml/rendering/render_block.h
index 12775b2..40c8995 100644
--- a/WebCore/khtml/rendering/render_block.h
+++ b/WebCore/khtml/rendering/render_block.h
@@ -149,12 +149,14 @@ public:
     virtual int rightmostPosition(bool includeOverflowInterior=true) const;
 
     int rightOffset() const;
-    int rightRelOffset(int y, int fixedOffset, int *heightRemaining = 0) const;
-    int rightOffset(int y) const { return rightRelOffset(y, rightOffset()); }
+    int rightRelOffset(int y, int fixedOffset, bool applyTextIndent = true,
+                       int *heightRemaining = 0) const;
+    int rightOffset(int y) const { return rightRelOffset(y, rightOffset(), true); }
 
     int leftOffset() const;
-    int leftRelOffset(int y, int fixedOffset, int *heightRemaining = 0) const;
-    int leftOffset(int y) const { return leftRelOffset(y, leftOffset()); }
+    int leftRelOffset(int y, int fixedOffset, bool applyTextIndent = true,
+                      int *heightRemaining = 0) const;
+    int leftOffset(int y) const { return leftRelOffset(y, leftOffset(), true); }
 
     virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, bool inside=false);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list