[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:33:26 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 94a703698aa5626fb8548e10a1ab01f4d0adcc4f
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Apr 2 23:19:07 2003 +0000

    	Fix for excite.com.  There are many bugs being fixed that all
    	contributed to the wideness of the table.
    
            Reviewed by darin
    
            * khtml/rendering/table_layout.cpp:
            (shouldScaleColumns):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4000 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 09666d9..ed2b07c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,13 @@
+2003-04-01  David Hyatt  <hyatt at apple.com>
+
+	Fix for excite.com.  There are many bugs being fixed that all
+	contributed to the wideness of the table.
+	
+        Reviewed by darin
+
+        * khtml/rendering/table_layout.cpp:
+        (shouldScaleColumns):
+
 2003-04-02  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 09666d9..ed2b07c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2003-04-01  David Hyatt  <hyatt at apple.com>
+
+	Fix for excite.com.  There are many bugs being fixed that all
+	contributed to the wideness of the table.
+	
+        Reviewed by darin
+
+        * khtml/rendering/table_layout.cpp:
+        (shouldScaleColumns):
+
 2003-04-02  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/rendering/table_layout.cpp b/WebCore/khtml/rendering/table_layout.cpp
index 0208352..b509718 100644
--- a/WebCore/khtml/rendering/table_layout.cpp
+++ b/WebCore/khtml/rendering/table_layout.cpp
@@ -530,20 +530,30 @@ static bool shouldScaleColumns(RenderTable* table)
     // A special case.  If this table is not fixed width and contained inside
     // a cell, then don't bloat the maxwidth by examining percentage growth.
     bool scale = true;
-    Length tw = table->style()->width();
-    if ((tw.isVariable() || tw.isPercent()) && !table->isPositioned()) {
-        RenderBlock* cb = table->containingBlock();
-        while (cb && !cb->isRoot() && !cb->isTableCell() &&
-               cb->style()->width().isVariable() && !cb->isFloatingOrPositioned())
-            cb = cb->containingBlock();
-
-        if (cb && cb->isTableCell() &&
-            (cb->style()->width().isVariable() || cb->style()->width().isPercent())) {
-            // The cell must be variable or percent.  The enclosing table *must* be auto.
-            RenderTableCell* cell = static_cast<RenderTableCell*>(cb);
-            if (cell->table()->style()->width().isVariable())
-                scale = false;
+    while (table) {
+        Length tw = table->style()->width();
+        if ((tw.isVariable() || tw.isPercent()) && !table->isPositioned()) {
+            RenderBlock* cb = table->containingBlock();
+            while (cb && !cb->isRoot() && !cb->isTableCell() &&
+                cb->style()->width().isVariable() && !cb->isPositioned())
+                cb = cb->containingBlock();
+
+            table = 0;
+            if (cb && cb->isTableCell() &&
+                (cb->style()->width().isVariable() || cb->style()->width().isPercent())) {
+                if (tw.isPercent())
+                    scale = false;
+                else {
+                    RenderTableCell* cell = static_cast<RenderTableCell*>(cb);
+                    if (cell->colSpan() > 1 || cell->table()->style()->width().isVariable())
+                        scale = false;
+                    else
+                        table = cell->table();
+                }
+            }
         }
+        else
+            table = 0;
     }
     return scale;
 }
@@ -717,7 +727,7 @@ int AutoTableLayout::calcEffectiveWidth()
 
 	// make sure minWidth and maxWidth of the spanning cell are honoured
 	if ( cMinWidth > minWidth ) {
-	    if ( allColsAreFixed ) {
+            if ( allColsAreFixed ) {
 #ifdef DEBUG_LAYOUT
 		qDebug("extending minWidth of cols %d-%d to %dpx currentMin=%d accroding to fixed sum %d", col, lastCol-1, cMinWidth, minWidth, fixedWidth );
 #endif
@@ -728,7 +738,7 @@ int AutoTableLayout::calcEffectiveWidth()
 #endif
 		    fixedWidth -= layoutStruct[pos].width.value;
 		    cMinWidth -= w;
-		    layoutStruct[pos].effMinWidth = w;
+                    layoutStruct[pos].effMinWidth = w;
 		}
 
 	    } else {
@@ -736,10 +746,12 @@ int AutoTableLayout::calcEffectiveWidth()
 		qDebug("extending minWidth of cols %d-%d to %dpx currentMin=%d", col, lastCol-1, cMinWidth, minWidth );
 #endif
 		int maxw = maxWidth;
-		for ( unsigned int pos = col; maxw > 0 && pos < lastCol; pos++ ) {
+                int minw = minWidth;
+                for ( unsigned int pos = col; maxw > 0 && pos < lastCol; pos++ ) {
 		    if ( layoutStruct[pos].width.type == Fixed && haveVariable && fixedWidth <= cMinWidth ) {
 			int w = QMAX( layoutStruct[pos].effMinWidth, layoutStruct[pos].width.value );
 			fixedWidth -= layoutStruct[pos].width.value;
+                        minw -= layoutStruct[pos].effMinWidth;
 #ifdef DEBUG_LAYOUT
                         qDebug("   col %d: min=%d, effMin=%d, new=%d", pos, layoutStruct[pos].effMinWidth, layoutStruct[pos].effMinWidth, w );
 #endif
@@ -748,14 +760,17 @@ int AutoTableLayout::calcEffectiveWidth()
                         layoutStruct[pos].effMinWidth = w;
                     }
 		}
-                
-		for ( unsigned int pos = col; maxw > 0 && pos < lastCol; pos++ ) {
+
+                for ( unsigned int pos = col; maxw > 0 && pos < lastCol && minWidth < cMinWidth; pos++ ) {
 		    if ( !(layoutStruct[pos].width.type == Fixed && haveVariable && fixedWidth <= cMinWidth) ) {
-			int w = QMAX( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].effMaxWidth / maxw );
+                        int w = QMAX( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].effMaxWidth / maxw );
+                        w = QMIN(layoutStruct[pos].effMinWidth+(cMinWidth-minw), w);
+                                                
 #ifdef DEBUG_LAYOUT
                         qDebug("   col %d: min=%d, effMin=%d, new=%d", pos, layoutStruct[pos].effMinWidth, layoutStruct[pos].effMinWidth, w );
 #endif
                         maxw -= layoutStruct[pos].effMaxWidth;
+                        minw -= layoutStruct[pos].effMinWidth;
                         cMinWidth -= w;
                         layoutStruct[pos].effMinWidth = w;
                     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list