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


The following commit has been merged in the debian/unstable branch:
commit c2d1fac07da1c7d9016f9d1a4f28d6acdf99275a
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 13 00:07:31 2003 +0000

    	Two fixes.  The first is more help with macromedia.  Floats could
    	get lost and not painted by the correct layer still.  The new
    	code is more robust about checking if a layer crossing occurred
    	in the case where you want to addOverhangingFloats to a parent.
    
    	The second fix changes the priority of space allocation when
    	growing cells from their minwidths to their preferred widths.
    	The old code did fixed and then percent.  The new code does
    	percent and then fixed.
    
    	Also when tables are overconstrained after growing cells to their
    	effective widths, instead of shrinking cells without regard for
    	their type, I implemented a shrink system that follows the same
    	priority (reversed) that was used when growing the cells originally.
    
            Reviewed by darin
    
            * khtml/rendering/render_block.cpp:
            * khtml/rendering/table_layout.cpp:
            (AutoTableLayout::layout):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3810 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 8b744cd..22dfd27 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,26 @@
+2003-03-12  David Hyatt  <hyatt at apple.com>
+
+	Two fixes.  The first is more help with macromedia.  Floats could
+	get lost and not painted by the correct layer still.  The new
+	code is more robust about checking if a layer crossing occurred
+	in the case where you want to addOverhangingFloats to a parent.
+
+	The second fix changes the priority of space allocation when
+	growing cells from their minwidths to their preferred widths.
+	The old code did fixed and then percent.  The new code does
+	percent and then fixed.
+
+	Also when tables are overconstrained after growing cells to their
+	effective widths, instead of shrinking cells without regard for
+	their type, I implemented a shrink system that follows the same
+	priority (reversed) that was used when growing the cells originally.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/table_layout.cpp:
+        (AutoTableLayout::layout):
+
 2003-03-12  Trey Matteson  <trey at apple.com>
 
 	3190784 REGRESSION: crash in KWQListIteratorImpl in form completion code at sonyericsson.com page
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 8b744cd..22dfd27 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,26 @@
+2003-03-12  David Hyatt  <hyatt at apple.com>
+
+	Two fixes.  The first is more help with macromedia.  Floats could
+	get lost and not painted by the correct layer still.  The new
+	code is more robust about checking if a layer crossing occurred
+	in the case where you want to addOverhangingFloats to a parent.
+
+	The second fix changes the priority of space allocation when
+	growing cells from their minwidths to their preferred widths.
+	The old code did fixed and then percent.  The new code does
+	percent and then fixed.
+
+	Also when tables are overconstrained after growing cells to their
+	effective widths, instead of shrinking cells without regard for
+	their type, I implemented a shrink system that follows the same
+	priority (reversed) that was used when growing the cells originally.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/table_layout.cpp:
+        (AutoTableLayout::layout):
+
 2003-03-12  Trey Matteson  <trey at apple.com>
 
 	3190784 REGRESSION: crash in KWQListIteratorImpl in form completion code at sonyericsson.com page
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 88bac7c..315b756 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -1616,7 +1616,9 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset,
 #ifdef DEBUG_LAYOUT
     kdDebug( 6040 ) << (void *)this << ": adding overhanging floats xoff=" << xoff << "  offset=" << offset << " child=" << child << endl;
 #endif
-    if ( !flow->m_specialObjects || (child && flow->layer()) )
+
+    // Prevent floats from being added to the root by <html>.
+    if ( !flow->m_specialObjects || (child && flow->isHtml()) )
         return;
 
     // we have overhanging floats
@@ -1632,7 +1634,8 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset,
              ( ( !child && r->endY > offset ) ||
                ( child && flow->yPos() + r->endY > height() ) ) ) {
 
-            if (child)
+            if (child && (flow->enclosingLayer() == enclosingLayer()))
+                // Set noPaint to true only if we didn't cross layers.
                 r->noPaint = true;
 
             SpecialObject* f = 0;
@@ -1659,6 +1662,10 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset,
                     special->left -= marginLeft();
                     special->noPaint = true;
                 }
+                else
+                    // Only paint if |flow| isn't.
+                    special->noPaint = !r->noPaint;
+                
                 special->width = r->width;
                 special->node = r->node;
                 m_specialObjects->append(special);
diff --git a/WebCore/khtml/rendering/table_layout.cpp b/WebCore/khtml/rendering/table_layout.cpp
index 7d4fafb..cfd3ad5 100644
--- a/WebCore/khtml/rendering/table_layout.cpp
+++ b/WebCore/khtml/rendering/table_layout.cpp
@@ -847,6 +847,37 @@ void AutoTableLayout::layout()
         }
     }
 
+    // allocate width to percent cols
+    if ( available > 0 && havePercent ) {
+        for ( int i = 0; i < nEffCols; i++ ) {
+            Length &width = layoutStruct[i].effWidth;
+            if ( width.type == Percent ) {
+                int w = kMax ( int( layoutStruct[i].effMinWidth ), width.minWidth( tableWidth ) );
+                available += layoutStruct[i].calcWidth - w;
+                layoutStruct[i].calcWidth = w;
+            }
+        }
+        if ( totalPercent > 100 ) {
+            // remove overallocated space from the last columns
+            int excess = tableWidth*(totalPercent-100)/100;
+            for ( int i = nEffCols-1; i >= 0; i-- ) {
+                if ( layoutStruct[i].effWidth.type == Percent ) {
+                    int w = layoutStruct[i].calcWidth;
+                    int reduction = kMin( w,  excess );
+                    // the lines below might look inconsistent, but that's the way it's handled in mozilla
+                    excess -= reduction;
+                    int newWidth = kMax( int (layoutStruct[i].effMinWidth), w - reduction );
+                    available += w - newWidth;
+                    layoutStruct[i].calcWidth = newWidth;
+                    //qDebug("col %d: reducing to %d px (reduction=%d)", i, newWidth, reduction );
+                }
+            }
+        }
+    }
+#ifdef DEBUG_LAYOUT
+    qDebug("percent satisfied: available is %d", available);
+#endif
+    
     // then allocate width to fixed cols
     if ( available > 0 ) {
 	for ( int i = 0; i < nEffCols; ++i ) {
@@ -861,37 +892,6 @@ void AutoTableLayout::layout()
     qDebug("fixed satisfied: available is %d", available);
 #endif
 
-    // then allocate width to percent cols
-    if ( available > 0 && havePercent ) {
-	for ( int i = 0; i < nEffCols; i++ ) {
-	    Length &width = layoutStruct[i].effWidth;
-	    if ( width.type == Percent ) {
-                int w = kMax ( int( layoutStruct[i].effMinWidth ), width.minWidth( tableWidth ) );
-		available += layoutStruct[i].calcWidth - w;
-		layoutStruct[i].calcWidth = w;
-	    }
-	}
-	if ( totalPercent > 100 ) {
-	    // remove overallocated space from the last columns
-	    int excess = tableWidth*(totalPercent-100)/100;
-	    for ( int i = nEffCols-1; i >= 0; i-- ) {
-		if ( layoutStruct[i].effWidth.type == Percent ) {
-		    int w = layoutStruct[i].calcWidth;
-		    int reduction = kMin( w,  excess );
-		    // the lines below might look inconsistent, but that's the way it's handled in mozilla
-		    excess -= reduction;
-		    int newWidth = kMax( int (layoutStruct[i].effMinWidth), w - reduction );
-		    available += w - newWidth;
-		    layoutStruct[i].calcWidth = newWidth;
-		    //qDebug("col %d: reducing to %d px (reduction=%d)", i, newWidth, reduction );
-		}
-	    }
-	}
-    }
-#ifdef DEBUG_LAYOUT
-    qDebug("percent satisfied: available is %d", available);
-#endif
-
     // now satisfy relative
     if ( available > 0 ) {
 	for ( int i = 0; i < nEffCols; i++ ) {
@@ -924,41 +924,41 @@ void AutoTableLayout::layout()
     qDebug("variable satisfied: available is %d",  available );
 #endif
 
-    // spread over fixed colums
-    if ( available > 0 && numFixed) {
-        // still have some width to spread, distribute to fixed columns
+    // spread over percent colums
+    if ( available > 0 && hasPercent && totalPercent < 100) {
+        // still have some width to spread, distribute weighted to percent columns
         for ( int i = 0; i < nEffCols; i++ ) {
             Length &width = layoutStruct[i].effWidth;
-            if ( width.isFixed() ) {
-                int w = available * layoutStruct[i].effMaxWidth / totalFixed;
+            if ( width.isPercent() ) {
+                int w = available * width.value / totalPercent;
                 available -= w;
-                totalFixed -= layoutStruct[i].effMaxWidth;
+                totalPercent -= width.value;
                 layoutStruct[i].calcWidth += w;
+                if (!available || !totalPercent) break;
             }
         }
     }
 
 #ifdef DEBUG_LAYOUT
-    qDebug("after fixed distribution: available=%d",  available );
+    qDebug("after percent distribution: available=%d",  available );
 #endif
-
-    // spread over percent colums
-    if ( available > 0 && hasPercent && totalPercent < 100) {
-        // still have some width to spread, distribute weighted to percent columns
+    
+    // spread over fixed colums
+    if ( available > 0 && numFixed) {
+        // still have some width to spread, distribute to fixed columns
         for ( int i = 0; i < nEffCols; i++ ) {
             Length &width = layoutStruct[i].effWidth;
-            if ( width.isPercent() ) {
-                int w = available * width.value / totalPercent;
+            if ( width.isFixed() ) {
+                int w = available * layoutStruct[i].effMaxWidth / totalFixed;
                 available -= w;
-                totalPercent -= width.value;
+                totalFixed -= layoutStruct[i].effMaxWidth;
                 layoutStruct[i].calcWidth += w;
-                if (!available || !totalPercent) break;
             }
         }
     }
 
 #ifdef DEBUG_LAYOUT
-    qDebug("after percent distribution: available=%d",  available );
+    qDebug("after fixed distribution: available=%d",  available );
 #endif
 
     // spread over the rest
@@ -980,18 +980,99 @@ void AutoTableLayout::layout()
     // if we have overallocated, reduce every cell according to the difference between desired width and minwidth
     // this seems to produce to the pixel exaxt results with IE. Wonder is some of this also holds for width distributing.
     if ( available < 0 ) {
-	int mw = 0;
-	for ( int i = nEffCols-1; i >= 0; i-- )
-	    mw += layoutStruct[i].calcWidth - layoutStruct[i].effMinWidth;
-	for ( int i = nEffCols-1; i >= 0 && mw > 0; i-- ) {
-	    int minMaxDiff = layoutStruct[i].calcWidth-layoutStruct[i].effMinWidth;
-	    int reduce = available * minMaxDiff / mw;
-	    layoutStruct[i].calcWidth += reduce;
-	    available -= reduce;
-	    mw -= minMaxDiff;
-	    if ( available >= 0 )
-		break;
-	}
+        // Need to reduce cells with the following prioritization:
+        // (1) Variable
+        // (2) Relative
+        // (3) Fixed
+        // (4) Percent
+        // This is basically the reverse of how we grew the cells.
+        if (available < 0) {
+            int mw = 0;
+            for ( int i = nEffCols-1; i >= 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isVariable())
+                    mw += layoutStruct[i].calcWidth - layoutStruct[i].effMinWidth;
+            }
+            
+            for ( int i = nEffCols-1; i >= 0 && mw > 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isVariable()) {
+                    int minMaxDiff = layoutStruct[i].calcWidth-layoutStruct[i].effMinWidth;
+                    int reduce = available * minMaxDiff / mw;
+                    layoutStruct[i].calcWidth += reduce;
+                    available -= reduce;
+                    mw -= minMaxDiff;
+                    if ( available >= 0 )
+                        break;
+                }
+            }
+        }
+
+        if (available < 0) {
+            int mw = 0;
+            for ( int i = nEffCols-1; i >= 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isRelative())
+                    mw += layoutStruct[i].calcWidth - layoutStruct[i].effMinWidth;
+            }
+            
+            for ( int i = nEffCols-1; i >= 0 && mw > 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isRelative()) {
+                    int minMaxDiff = layoutStruct[i].calcWidth-layoutStruct[i].effMinWidth;
+                    int reduce = available * minMaxDiff / mw;
+                    layoutStruct[i].calcWidth += reduce;
+                    available -= reduce;
+                    mw -= minMaxDiff;
+                    if ( available >= 0 )
+                        break;
+                }
+            }
+        }
+
+        if (available < 0) {
+            int mw = 0;
+            for ( int i = nEffCols-1; i >= 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isFixed())
+                    mw += layoutStruct[i].calcWidth - layoutStruct[i].effMinWidth;
+            }
+            
+            for ( int i = nEffCols-1; i >= 0 && mw > 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isFixed()) {
+                    int minMaxDiff = layoutStruct[i].calcWidth-layoutStruct[i].effMinWidth;
+                    int reduce = available * minMaxDiff / mw;
+                    layoutStruct[i].calcWidth += reduce;
+                    available -= reduce;
+                    mw -= minMaxDiff;
+                    if ( available >= 0 )
+                        break;
+                }
+            }
+        }
+
+        if (available < 0) {
+            int mw = 0;
+            for ( int i = nEffCols-1; i >= 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isPercent())
+                    mw += layoutStruct[i].calcWidth - layoutStruct[i].effMinWidth;
+            }
+            
+            for ( int i = nEffCols-1; i >= 0 && mw > 0; i-- ) {
+                Length &width = layoutStruct[i].effWidth;
+                if (width.isPercent()) {
+                    int minMaxDiff = layoutStruct[i].calcWidth-layoutStruct[i].effMinWidth;
+                    int reduce = available * minMaxDiff / mw;
+                    layoutStruct[i].calcWidth += reduce;
+                    available -= reduce;
+                    mw -= minMaxDiff;
+                    if ( available >= 0 )
+                        break;
+                }
+            }
+        }
     }
 
     //qDebug( "    final available=%d", available );

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list