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


The following commit has been merged in the debian/unstable branch:
commit ca7e51ee6bab91d7fb36b985e52a05ee27c5fc21
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 24 23:39:41 2003 +0000

    	Fix for crash on www.lnt.com.  3199929 is the bug number.
    
    	Blocks must have all their kids as inlines or all theirs kids
    	as blocks.  Floats and positioned elements are special and
    	disregarded when this check occurs.
    
    	If a float or positioned element suddenly becomes a normal flow
    	element again, then the parent block might have to make its kids
    	all be non-inline or it might have to wrap a normal flow inline
    	with an anonymous block.
    
    	This patch fixed RenderObject's setStyle method to check for
    	this situation and to make the parent block fix itself up
    	appropriately.
    
            Reviewed by darin
    
            * khtml/rendering/render_object.cpp:
            (RenderObject::setStyle):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3909 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c9f59f0..ac0381e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,27 @@
 2003-03-24  David Hyatt  <hyatt at apple.com>
 
+	Fix for crash on www.lnt.com.  3199929 is the bug number.  
+
+	Blocks must have all their kids as inlines or all theirs kids
+	as blocks.  Floats and positioned elements are special and
+	disregarded when this check occurs.  
+
+	If a float or positioned element suddenly becomes a normal flow
+	element again, then the parent block might have to make its kids
+	all be non-inline or it might have to wrap a normal flow inline
+	with an anonymous block.
+
+	This patch fixed RenderObject's setStyle method to check for
+	this situation and to make the parent block fix itself up
+	appropriately.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::setStyle):
+
+2003-03-24  David Hyatt  <hyatt at apple.com>
+
 	ignore the float property on first-letter styles.
 	The bug # is 3186044.
 	
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c9f59f0..ac0381e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,27 @@
 2003-03-24  David Hyatt  <hyatt at apple.com>
 
+	Fix for crash on www.lnt.com.  3199929 is the bug number.  
+
+	Blocks must have all their kids as inlines or all theirs kids
+	as blocks.  Floats and positioned elements are special and
+	disregarded when this check occurs.  
+
+	If a float or positioned element suddenly becomes a normal flow
+	element again, then the parent block might have to make its kids
+	all be non-inline or it might have to wrap a normal flow inline
+	with an anonymous block.
+
+	This patch fixed RenderObject's setStyle method to check for
+	this situation and to make the parent block fix itself up
+	appropriately.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::setStyle):
+
+2003-03-24  David Hyatt  <hyatt at apple.com>
+
 	ignore the float property on first-letter styles.
 	The bug # is 3186044.
 	
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 93048c2..5f556cb 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -1460,7 +1460,7 @@ RenderBlock::lowestPosition() const
     RenderObject *last = 0;
     if ( !m_childrenInline ) {
         last = lastChild();
-        while( last && (last->isPositioned() || last->isFloating()) )
+        while (last && last->isFloatingOrPositioned())
             last = last->previousSibling();
         if( last )
             lp = last->yPos() + last->lowestPosition();
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 954fd33..5b3ec8a 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -875,7 +875,7 @@ void RenderObject::setStyle(RenderStyle *style)
         // Do a repaint with the old style first, e.g., for example if we go from
         // having an outline to not having an outline.
         repaint();
-        
+
     if (isFloating() && !style->isFloating())
         // For changes in float styles, we need to conceivably remove ourselves
         // from the floating objects list.
@@ -884,6 +884,10 @@ void RenderObject::setStyle(RenderStyle *style)
         // For changes in positioning styles, we need to conceivably remove ourselves
         // from the positioned objects list.
         removeFromObjectLists();
+
+    bool affectsParentBlock = (m_style && isFloatingOrPositioned() &&
+        (!style->isFloating() && style->position() != ABSOLUTE && style->position() != FIXED)
+        && parent() && !parent()->isInline() && parent()->isRenderBlock() && !parent()->isTable());
     
     //qDebug("new style, diff=%d", d);
     // reset style flags
@@ -921,6 +925,30 @@ void RenderObject::setStyle(RenderStyle *style)
                                      m_style->hasBorder() || nb );
     m_hasFirstLine = (style->getPseudoStyle(RenderStyle::FIRST_LINE) != 0);
 
+    if (affectsParentBlock) {
+        // We have gone from not affecting the inline status of the parent block to suddenly
+        // having an impact.  See if there is a mismatch between the parent block's
+        // childrenInline() state and our state.
+        setInline(style->display() == INLINE || // style->display() == INLINE_BLOCK ||
+                  style->display() == INLINE_TABLE);
+        if (isInline() != parent()->childrenInline()) {
+            if (!isInline())
+                static_cast<RenderBlock*>(parent())->makeChildrenNonInline();
+            else {
+                // An anonymous block must be made to wrap this inline.
+                RenderStyle *newStyle = new RenderStyle();
+                newStyle->inheritFrom(m_style);
+                newStyle->setDisplay(BLOCK);
+
+                RenderBlock *box = new (renderArena()) RenderBlock(0 /* anonymous box */);
+                box->setStyle(newStyle);
+                box->setIsAnonymousBox(true);
+                parent()->insertChildNode(box, this);
+                box->appendChildNode(parent()->removeChildNode(this));
+            }
+        }
+    }
+        
     if ( d >= RenderStyle::Position && m_parent ) {
         //qDebug("triggering relayout");
         setMinMaxKnown(false);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list