[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 08:38:18 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e931089354c1078196d9df49fa6afe3959e93015
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 5 20:21:09 2004 +0000

    	A collection of fixes.
    
    	(1) Fix a regression from the style sharing landing that made visited and unvisited links accidentally share.
    	(2) Make sure 100% height divs fill the <body> in quirks mode, even if the body has no height specified.
    	(3) Make sure table cell percentage heights exclude border/padding.
    	(4) Make sure that before flexing auto height is used for the contents of the cells.
    
            Reviewed by darin
    
            * khtml/css/cssstyleselector.cpp:
            (khtml::CSSStyleSelector::canShareStyleWithElement):
            (khtml::CSSStyleSelector::locateSharedStyle):
            * khtml/rendering/render_box.cpp:
            (RenderBox::calcPercentageHeight):
            * khtml/rendering/render_table.cpp:
            (RenderTable::layout):
            (RenderTableSection::layoutRows):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6542 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 40023a9..26eb0c0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2004-05-05  David Hyatt  <hyatt at apple.com>
+
+	A collection of fixes.
+
+	(1) Fix a regression from the style sharing landing that made visited and unvisited links accidentally share.
+	(2) Make sure 100% height divs fill the <body> in quirks mode, even if the body has no height specified.
+	(3) Make sure table cell percentage heights exclude border/padding.
+	(4) Make sure that before flexing auto height is used for the contents of the cells.
+	
+        Reviewed by darin
+
+        * khtml/css/cssstyleselector.cpp:
+        (khtml::CSSStyleSelector::canShareStyleWithElement):
+        (khtml::CSSStyleSelector::locateSharedStyle):
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::calcPercentageHeight):
+        * khtml/rendering/render_table.cpp:
+        (RenderTable::layout):
+        (RenderTableSection::layoutRows):
+
 2004-05-05  Chris Blumenberg  <cblu at apple.com>
 
 	- DOM Extensions API tweaks
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 8f1116b..b2bbda0 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -67,6 +67,8 @@ using namespace DOM;
 #include <qintcache.h>
 #include <stdlib.h>
 
+// #define STYLE_SHARING_STATS 1
+
 #define HANDLE_INHERIT(prop, Prop) \
 if (isInherit) \
 {\
@@ -576,14 +578,14 @@ bool CSSStyleSelector::canShareStyleWithElement(NodeImpl* n)
                         QColor linkColor = element->getDocument()->linkColor();
                         QColor visitedColor = element->getDocument()->visitedLinkColor();
                         if (pseudoState == PseudoUnknown)
-                            checkPseudoState(s, s->renderer()->style()->pseudoState() != PseudoAnyLink ||
+                            checkPseudoState(element, s->renderer()->style()->pseudoState() != PseudoAnyLink ||
                                              linkColor != visitedColor);
                         anchorsMatch = (pseudoState == s->renderer()->style()->pseudoState());
                     }
                     
                     if (anchorsMatch) {
 #ifdef STYLE_SHARING_STATS
-                        fraction++;
+                        fraction++; total++;
                         printf("Sharing %d out of %d\n", fraction, total);
 #endif
                         return true;
@@ -622,6 +624,7 @@ RenderStyle* CSSStyleSelector::locateSharedStyle()
         }        
     }
 #ifdef STYLE_SHARING_STATS
+    total++;
     printf("Sharing %d out of %d\n", fraction, total);
 #endif
     return 0;
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 43c9c4e..1723f4d 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -982,9 +982,17 @@ int RenderBox::calcPercentageHeight(const Length& height)
     // Table cells violate what the CSS spec says to do with heights.  Basically we
     // don't care if the cell specified a height or not.  We just always make ourselves
     // be a percentage of the cell's current content height.
-    if (cb->isTableCell())
+    if (cb->isTableCell()) {
         result = static_cast<RenderTableCell*>(cb)->getCellPercentageHeight();
-    
+        if (result == 0)
+            return -1;
+        // It is necessary to use the border-box to match WinIE's broken
+        // box model.  This is essential for sizing inside
+        // table cells using percentage heights.
+        result -= (borderTop() + paddingTop() + borderBottom() + paddingBottom());
+        result = kMax(0, result);
+    }
+
     // Otherwise we only use our percentage height if our containing block had a specified
     // height.
     else if (cb->style()->height().isFixed())
@@ -992,12 +1000,12 @@ int RenderBox::calcPercentageHeight(const Length& height)
     else if (cb->style()->height().isPercent())
         // We need to recur and compute the percentage height for our containing block.
         result = cb->calcPercentageHeight(cb->style()->height());
-    else if (cb->isCanvas()) {
+    else if (cb->isCanvas() || (cb->isBody() && style()->htmlHacks())) {
         // Don't allow this to affect the block' m_height member variable, since this
         // can get called while the block is still laying out its kids.
         int oldHeight = cb->height();
         cb->calcHeight();
-        result = cb->height();
+        result = cb->contentHeight();
         cb->setHeight(oldHeight);
     }
     if (result != -1)
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index 0b7a881..618d765 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -276,9 +276,10 @@ void RenderTable::layout()
         m_height += tCaption->height() + tCaption->marginTop() + tCaption->marginBottom();
     }
 
-    m_height += borderTop();
-    if (!collapseBorders())
-        m_height += paddingTop();
+    int bpTop = borderTop() + (collapseBorders() ? 0 : paddingTop());
+    int bpBottom = borderBottom() + (collapseBorders() ? 0 : paddingBottom());
+    
+    m_height += bpTop;
 
     int oldHeight = m_height;
     calcHeight();
@@ -287,11 +288,11 @@ void RenderTable::layout()
 
     // html tables with percent height are relative to view
     Length h = style()->height();
-    int th=0;
+    int th = -(bpTop + bpBottom); // Tables size as though CSS height includes border/padding.
     if (isPositioned())
-        th = newHeight;
+        th = newHeight; // FIXME: Leave this alone for now but investigate later.
     else if (h.isFixed())
-        th = h.value;
+        th += h.value;
     else if (h.isPercent())
     {
         RenderObject* c = containingBlock();
@@ -300,7 +301,7 @@ void RenderTable::layout()
              c = c->containingBlock()) {
             Length ch = c->style()->height();
             if (ch.isFixed()) {
-                th = h.width(ch.value);
+                th += h.width(ch.value);
                 break;
             }
         }
@@ -309,17 +310,19 @@ void RenderTable::layout()
             RenderTableCell* cell = static_cast<RenderTableCell*>(c);
             int cellHeight = cell->getCellPercentageHeight();
             if (cellHeight)
-                th = h.width(cellHeight);
+                th += h.width(cellHeight);
         }
         else  {
             Length ch = c->style()->height();
             if (ch.isFixed())
-                th = h.width(ch.value);
+                th += h.width(ch.value);
             else
-                // we need to substract out the margins of this block. -dwh
-                th = h.width(viewRect().height() - c->marginBottom() - c->marginTop());
+                // FIXME: Investigate this.  Seems wrong to always expand to fill the viewRect.
+                // We need to substract out the margins of this block. -dwh
+                th += h.width(viewRect().height() - c->marginBottom() - c->marginTop());
         }
     }
+    th = kMax(0, th);
 
     // layout rows
     if ( th > calculatedHeight ) {
@@ -355,11 +358,8 @@ void RenderTable::layout()
 	m_height += foot->height();
     }
 
-
-    m_height += borderBottom();
-    if (!collapseBorders())
-        m_height += paddingBottom();
-
+    m_height += bpBottom;
+               
     if(tCaption && tCaption->style()->captionSide()==CAPBOTTOM) {
         tCaption->setPos(tCaption->marginLeft(), m_height);
         m_height += tCaption->height() + tCaption->marginTop() + tCaption->marginBottom();
@@ -1295,7 +1295,9 @@ int RenderTableSection::layoutRows( int toAdd )
                 o = o->nextSibling();
             }
             if (cellChildrenFlex) {
-                cell->setCellPercentageHeight(rHeight);
+                cell->setCellPercentageHeight(kMax(0, 
+                                                   rHeight - cell->borderTop() - cell->paddingTop() - 
+                                                   cell->borderBottom() - cell->paddingBottom()));
                 cell->layoutIfNeeded();
            
                 // Alignment within a cell is based off the calculated

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list