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


The following commit has been merged in the debian/unstable branch:
commit 7f3f4ea2fdf15b82ca64eaef4506509c6c21a077
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 20 01:50:10 2002 +0000

    	Fix for 3129393, crasher on sundancecatalog.com.  There
    	are two elements to this fix.  The basic problem was that
    	sundancecatalog was saying:
    
    	<table style="display: inline">
    
    	In WinIE, this turns into an inline-table and not an inline.
    	In Gecko this does not happen.  Like Gecko, we treated this
    	as an inline, so we triggered a problem in my inline splitting
    	code.
    
    	The first fix was to bulletproof my inline splitting code to
    	ensure all new render objects are fully connected before children
    	are added, so that you can get to renderArenas at all times.
    
    	The second fix implements the WinIE quirk and turns the table
    	into an inline-table so that you avoid a complete garbage
    	render tree.
    
            Reviewed by trey
    
            * khtml/css/html4.css:
            * khtml/rendering/render_flow.cpp:
            (RenderFlow::layout):
            (RenderFlow::splitFlow):
            (RenderFlow::addChildToFlow):
            * khtml/rendering/render_flow.h:
            * khtml/rendering/render_list.cpp:
            (RenderListMarker::lineHeight):
            * khtml/rendering/render_list.h:
            * khtml/rendering/render_object.cpp:
            (RenderObject::createObject):
            * khtml/rendering/render_table.cpp:
            (RenderTable::lineHeight):
            (RenderTable::baselinePosition):
            (RenderTable::setStyle):
            * khtml/rendering/render_table.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3143 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 9fd7d7b..a344941 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,43 @@
+2002-12-19  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3129393, crasher on sundancecatalog.com.  There
+	are two elements to this fix.  The basic problem was that
+	sundancecatalog was saying:
+
+	<table style="display: inline">
+
+	In WinIE, this turns into an inline-table and not an inline.
+	In Gecko this does not happen.  Like Gecko, we treated this
+	as an inline, so we triggered a problem in my inline splitting
+	code.  
+
+	The first fix was to bulletproof my inline splitting code to
+	ensure all new render objects are fully connected before children
+	are added, so that you can get to renderArenas at all times.
+
+	The second fix implements the WinIE quirk and turns the table
+	into an inline-table so that you avoid a complete garbage
+	render tree.
+	
+        Reviewed by trey
+
+        * khtml/css/html4.css:
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::layout):
+        (RenderFlow::splitFlow):
+        (RenderFlow::addChildToFlow):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_list.cpp:
+        (RenderListMarker::lineHeight):
+        * khtml/rendering/render_list.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::createObject):
+        * khtml/rendering/render_table.cpp:
+        (RenderTable::lineHeight):
+        (RenderTable::baselinePosition):
+        (RenderTable::setStyle):
+        * khtml/rendering/render_table.h:
+
 2002-12-19  Darin Adler  <darin at apple.com>
 
         Reviewed by John.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9fd7d7b..a344941 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,43 @@
+2002-12-19  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3129393, crasher on sundancecatalog.com.  There
+	are two elements to this fix.  The basic problem was that
+	sundancecatalog was saying:
+
+	<table style="display: inline">
+
+	In WinIE, this turns into an inline-table and not an inline.
+	In Gecko this does not happen.  Like Gecko, we treated this
+	as an inline, so we triggered a problem in my inline splitting
+	code.  
+
+	The first fix was to bulletproof my inline splitting code to
+	ensure all new render objects are fully connected before children
+	are added, so that you can get to renderArenas at all times.
+
+	The second fix implements the WinIE quirk and turns the table
+	into an inline-table so that you avoid a complete garbage
+	render tree.
+	
+        Reviewed by trey
+
+        * khtml/css/html4.css:
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::layout):
+        (RenderFlow::splitFlow):
+        (RenderFlow::addChildToFlow):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_list.cpp:
+        (RenderListMarker::lineHeight):
+        * khtml/rendering/render_list.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::createObject):
+        * khtml/rendering/render_table.cpp:
+        (RenderTable::lineHeight):
+        (RenderTable::baselinePosition):
+        (RenderTable::setStyle):
+        * khtml/rendering/render_table.h:
+
 2002-12-19  Darin Adler  <darin at apple.com>
 
         Reviewed by John.
diff --git a/WebCore/khtml/css/html4.css b/WebCore/khtml/css/html4.css
index 4815439..cc3efc4 100644
--- a/WebCore/khtml/css/html4.css
+++ b/WebCore/khtml/css/html4.css
@@ -184,7 +184,6 @@ H6 {
 TABLE { 
 	display: table;
 	border-collapse: separate;
-	vertical-align: middle;
 	text-align: -konq-auto;
 	border-spacing: 2px;
 	border-color: gray;
@@ -207,17 +206,19 @@ TABLE[align="center"] {
 
 THEAD { 
 	display: table-header-group; 
+    vertical-align: middle;
 	border: inherit;
 }
       
 TBODY { 
 	display: table-row-group;
-	vertical-align: inherit; 
+    vertical-align: middle; 
     border: inherit;
 }
       
 TFOOT { 
 	display: table-footer-group; 
+    vertical-align: middle;
 	border: inherit; 
 }
 
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 07a83d7..f6d647d 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -312,9 +312,8 @@ void RenderFlow::layout()
     bool canCollapseOwnMargins = !isPositioned() && !isFloating() && !isTableCell();
                                        
 //    kdDebug( 6040 ) << "childrenInline()=" << childrenInline() << endl;
-    if(childrenInline()) {
-	layoutInlineChildren( relayoutChildren );
-    }
+    if(childrenInline())
+        layoutInlineChildren( relayoutChildren );
     else
         layoutBlockChildren( relayoutChildren );
 
@@ -1872,7 +1871,8 @@ void RenderFlow::splitInlines(RenderFlow* fromBlock, RenderFlow* toBlock,
     }
 }
 
-void RenderFlow::splitFlow(RenderObject* beforeChild, RenderFlow* newBlockBox, RenderFlow* oldCont)
+void RenderFlow::splitFlow(RenderObject* beforeChild, RenderFlow* newBlockBox, 
+                           RenderObject* newChild, RenderFlow* oldCont)
 {
     RenderObject* block = containingBlock();
     RenderFlow* pre = 0;
@@ -1912,6 +1912,17 @@ void RenderFlow::splitFlow(RenderObject* beforeChild, RenderFlow* newBlockBox, R
     
     splitInlines(pre, post, newBlockBox, beforeChild, oldCont);
     
+    // We already know the newBlockBox isn't going to contain inline kids, so avoid wasting
+    // time in makeChildrenNonInline by just setting this explicitly up front.
+    newBlockBox->setChildrenInline(false);
+    
+    // We don't just call addChild, since it would pass things off to the
+    // continuation, so we call addChildToFlow explicitly instead.  We delayed
+    // adding the newChild until now so that the |newBlockBox| would be fully
+    // connected, thus allowing newChild access to a renderArena should it need
+    // to wrap itself in additional boxes (e.g., table construction).
+    newBlockBox->addChildToFlow(newChild, 0);
+
     // XXXdwh is any of this even necessary? I don't think it is.
     pre->close();
     pre->setPos(0, -500000);
@@ -2059,10 +2070,9 @@ void RenderFlow::addChildToFlow(RenderObject* newChild, RenderObject* beforeChil
             RenderFlow *newBox = new (renderArena()) RenderFlow(0 /* anonymous box */);
             newBox->setStyle(newStyle);
             newBox->setIsAnonymousBox(true);
-            newBox->addChild(newChild);
             RenderFlow* oldContinuation = continuation();
             setContinuation(newBox);
-            splitFlow(beforeChild, newBox, oldContinuation);
+            splitFlow(beforeChild, newBox, newChild, oldContinuation);
             return;
         }
         else {
diff --git a/WebCore/khtml/rendering/render_flow.h b/WebCore/khtml/rendering/render_flow.h
index c02936f..d5b1e15 100644
--- a/WebCore/khtml/rendering/render_flow.h
+++ b/WebCore/khtml/rendering/render_flow.h
@@ -80,7 +80,8 @@ public:
     
     void splitInlines(RenderFlow* fromBlock, RenderFlow* toBlock, RenderFlow* middleBlock,
                       RenderObject* beforeChild, RenderFlow* oldCont);
-    void splitFlow(RenderObject* beforeChild, RenderFlow* newBlockBox, RenderFlow* oldCont);
+    void splitFlow(RenderObject* beforeChild, RenderFlow* newBlockBox, 
+                   RenderObject* newChild, RenderFlow* oldCont);
     void addChildWithContinuation(RenderObject* newChild, RenderObject* beforeChild);
     void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild);
     void removeChild(RenderObject *oldChild);
diff --git a/WebCore/khtml/rendering/render_list.cpp b/WebCore/khtml/rendering/render_list.cpp
index 107bf32..a4451c0 100644
--- a/WebCore/khtml/rendering/render_list.cpp
+++ b/WebCore/khtml/rendering/render_list.cpp
@@ -606,6 +606,13 @@ void RenderListMarker::calcWidth()
     RenderBox::calcWidth();
 }
 
+short RenderListMarker::lineHeight(bool b) const
+{
+    if (m_listImage)
+        return height()+marginTop()+marginBottom();
+    return RenderBox::lineHeight(b);
+}
+
 short RenderListMarker::baselinePosition(bool b) const
 {
     if (m_listImage)
diff --git a/WebCore/khtml/rendering/render_list.h b/WebCore/khtml/rendering/render_list.h
index 1d6b487..88ead3e 100644
--- a/WebCore/khtml/rendering/render_list.h
+++ b/WebCore/khtml/rendering/render_list.h
@@ -59,6 +59,7 @@ public:
 
     virtual void calcWidth();
 
+    virtual short lineHeight(bool b) const;
     virtual short baselinePosition(bool b) const;
     
     virtual bool isListMarker() const { return true; }
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 55a84b1..090f229 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -66,6 +66,10 @@ RenderObject *RenderObject::createObject(DOM::NodeImpl* node,  RenderStyle* styl
         if (style->display() == BLOCK && node->id() == ID_TD &&
             node->getDocument()->parseMode() != DocumentImpl::Strict)
             o = new (arena) RenderTableCell(node);
+        // In quirks mode if <table> has a display of block, make a table. If it has 
+        // a display of inline, make an inline-table.
+        else if (node->id() == ID_TABLE && node->getDocument()->parseMode() != DocumentImpl::Strict)
+            o = new (arena) RenderTable(node);
         else
             o = new (arena) RenderFlow(node);
         break;
@@ -78,7 +82,6 @@ RenderObject *RenderObject::createObject(DOM::NodeImpl* node,  RenderStyle* styl
         break;
     case TABLE:
     case INLINE_TABLE:
-        // ### set inline/block right
         //kdDebug( 6040 ) << "creating RenderTable" << endl;
         o = new (arena) RenderTable(node);
         break;
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index 52ed7f5..f7bace8 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -133,14 +133,38 @@ RenderTable::~RenderTable()
     delete [] cells;
 }
 
+short RenderTable::lineHeight(bool b) const
+{
+    // Inline tables are replaced elements. Otherwise, just pass off to
+    // the base class.
+    if (isReplaced())
+        return height()+marginTop()+marginBottom();
+    return RenderFlow::lineHeight(b);
+}
+
+short RenderTable::baselinePosition(bool b) const
+{
+    // Inline tables are replaced elements. Otherwise, just pass off to
+    // the base class.
+    if (isReplaced())
+        return height()+marginTop()+marginBottom();
+    return RenderFlow::baselinePosition(b);
+}
+
 void RenderTable::setStyle(RenderStyle *_style)
 {
     RenderFlow::setStyle(_style);
 
     // init RenderObject attributes
-    setInline(style()->display()==INLINE_TABLE && !isPositioned());
-    setReplaced(style()->display()==INLINE_TABLE);
-
+    // In quirks mode, we will accept display: inline and block as valid
+    // display types for a table object (see www.sundancecatalog.com).
+    // A table therefore should go ahead and check if it's inline as well
+    // as inline-table.
+    bool isTableInline = style()->display() == INLINE_TABLE ||
+                         style()->display() == INLINE;
+    setInline(isTableInline && !isPositioned());
+    setReplaced(isTableInline);
+   
     spacing = style()->borderSpacing();
     collapseBorders = style()->borderCollapse();
 }
diff --git a/WebCore/khtml/rendering/render_table.h b/WebCore/khtml/rendering/render_table.h
index 04f98ed..fd8cf74 100644
--- a/WebCore/khtml/rendering/render_table.h
+++ b/WebCore/khtml/rendering/render_table.h
@@ -115,6 +115,9 @@ public:
     virtual void calcMinMaxWidth();
     virtual void close();
 
+    virtual short lineHeight(bool b) const;
+    virtual short baselinePosition(bool b) const;
+    
     virtual void setCellWidths( );
 
     int cellPadding() { return m_cellPadding; }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list