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


The following commit has been merged in the debian/unstable branch:
commit b92c5c37ab997a3744cd917be240244feffb5aff
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Apr 1 20:17:34 2003 +0000

    	Table code fixes.  Working to try to fix excite.com.
    
            Reviewed by darin
    
            * khtml/rendering/table_layout.cpp:
            (shouldScaleColumns):
            (AutoTableLayout::calcMinMaxWidth):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3990 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index d9337ce..3a00c5e 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>
+
+	Table code fixes.  Working to try to fix excite.com.
+	
+        Reviewed by darin
+
+        * khtml/rendering/table_layout.cpp:
+        (shouldScaleColumns):
+        (AutoTableLayout::calcMinMaxWidth):
+
 2003-04-01  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d9337ce..3a00c5e 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>
+
+	Table code fixes.  Working to try to fix excite.com.
+	
+        Reviewed by darin
+
+        * khtml/rendering/table_layout.cpp:
+        (shouldScaleColumns):
+        (AutoTableLayout::calcMinMaxWidth):
+
 2003-04-01  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 c25afc9..0208352 100644
--- a/WebCore/khtml/rendering/table_layout.cpp
+++ b/WebCore/khtml/rendering/table_layout.cpp
@@ -525,6 +525,28 @@ void AutoTableLayout::fullRecalc()
 	recalcColumn( i );
 }
 
+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;
+        }
+    }
+    return scale;
+}
 
 void AutoTableLayout::calcMinMaxWidth()
 {
@@ -539,27 +561,28 @@ void AutoTableLayout::calcMinMaxWidth()
     int maxPercent = 0;
     int maxNonPercent = 0;
 
+    int remainingPercent = 100;
     for ( unsigned int i = 0; i < layoutStruct.size(); i++ ) {
 	minWidth += layoutStruct[i].effMinWidth;
 	maxWidth += layoutStruct[i].effMaxWidth;
 	if ( layoutStruct[i].effWidth.type == Percent ) {
-	    int pw = ( layoutStruct[i].effMaxWidth * 100) / layoutStruct[i].effWidth.value;
-	    maxPercent = kMax( pw,  maxPercent );
+            int percent = kMin(layoutStruct[i].effWidth.value, remainingPercent);
+            int pw = ( layoutStruct[i].effMaxWidth * 100) / kMax(percent, 1);
+            remainingPercent -= percent;
+            maxPercent = kMax( pw,  maxPercent );
 	} else {
 	    maxNonPercent += layoutStruct[i].effMaxWidth;
 	}
     }
 
-    int totalpct = totalPercent();
-    if (totalpct >= 100)
-        totalpct = 99;
-    
-    maxNonPercent = (maxNonPercent * 100 + 50) / (100-totalpct);
-    maxWidth = kMax( maxNonPercent,  maxWidth );
-   
-    maxWidth = kMax( maxWidth, maxPercent );
-    maxWidth = kMax( maxWidth, spanMaxWidth );
+    if (shouldScaleColumns(table)) {
+        maxNonPercent = (maxNonPercent * 100 + 50) / kMax(remainingPercent, 1);
+        maxWidth = kMax( maxNonPercent,  maxWidth );
+        maxWidth = kMax( maxWidth, maxPercent );
+    }
 
+    maxWidth = kMax( maxWidth, spanMaxWidth );
+    
     int bs = table->bordersAndSpacing();
     minWidth += bs;
     maxWidth += bs;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list