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


The following commit has been merged in the debian/unstable branch:
commit 65b3660af4d7bf53a3612c4ae0524c2109fdccd0
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 29 20:46:39 2003 +0000

    	Fix yet another bug with makeChildrenNonInline that caused the
    	assertion on 3158194.  Rather than trying to work with the
    	function as it was written by the KHTML guys, I've just thrown
    	everything out and re-written it using a helper function to make
    	it more clear what's going on (and less error-prone).
    
            Reviewed by darin
    
            * khtml/rendering/render_flow.cpp:
            (getInlineRun):
            (RenderFlow::makeChildrenNonInline):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3491 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c5bdd1b..83b88e5 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2003-01-28  David Hyatt  <hyatt at apple.com>
+
+	Fix yet another bug with makeChildrenNonInline that caused the
+	assertion on 3158194.  Rather than trying to work with the
+	function as it was written by the KHTML guys, I've just thrown
+	everything out and re-written it using a helper function to make
+	it more clear what's going on (and less error-prone).
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_flow.cpp:
+        (getInlineRun):
+        (RenderFlow::makeChildrenNonInline):
+
 2003-01-29  Darin Adler  <darin at apple.com>
 
         * khtml/rendering/break_lines.cpp: (isBreakable): Fix error that prevented this
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c5bdd1b..83b88e5 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2003-01-28  David Hyatt  <hyatt at apple.com>
+
+	Fix yet another bug with makeChildrenNonInline that caused the
+	assertion on 3158194.  Rather than trying to work with the
+	function as it was written by the KHTML guys, I've just thrown
+	everything out and re-written it using a helper function to make
+	it more clear what's going on (and less error-prone).
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_flow.cpp:
+        (getInlineRun):
+        (RenderFlow::makeChildrenNonInline):
+
 2003-01-29  Darin Adler  <darin at apple.com>
 
         * khtml/rendering/break_lines.cpp: (isBreakable): Fix error that prevented this
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 7f380c0..716ee6e 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -2175,64 +2175,84 @@ void RenderFlow::addChildToFlow(RenderObject* newChild, RenderObject* beforeChil
         removeLeftoverAnonymousBoxes();
 }
 
-void RenderFlow::makeChildrenNonInline(RenderObject *box2Start)
+static void getInlineRun(RenderObject* start, RenderObject* stop,
+                         RenderObject*& inlineRunStart,
+                         RenderObject*& inlineRunEnd)
 {
+    // Beginning at |start| we find the largest contiguous run of inlines that
+    // we can.  We denote the run with start and end points, |inlineRunStart|
+    // and |inlineRunEnd|.  Note that these two values may be the same if
+    // we encounter only one inline.
+    //
+    // We skip any non-inlines we encounter as long as we haven't found any
+    // inlines yet.
+    //
+    // |stop| indicates a non-inclusive stop point.  Regardless of whether |stop|
+    // is inline or not, we will not include it.  It's as though we encountered
+    // a non-inline.
+    inlineRunStart = inlineRunEnd = 0;
+
+    // Start by skipping as many non-inlines as we can.
+    RenderObject * curr = start;
+    while (curr && !curr->isInline())
+        curr = curr->nextSibling();
+
+    if (!curr)
+        return; // No more inline children to be found.
+
+    inlineRunStart = inlineRunEnd = curr;
+    curr = curr->nextSibling();
+    while (curr && curr->isInline() && (curr != stop)) {
+        inlineRunEnd = curr;
+        curr = curr->nextSibling();
+    }
+}
+
+void RenderFlow::makeChildrenNonInline(RenderObject *insertionPoint)
+{
+    // makeChildrenNonInline takes a block whose children are *all* inline and it
+    // makes sure that inline children are coalesced under anonymous
+    // blocks.  If |insertionPoint| is defined, then it represents the insertion point for
+    // the new block child that is causing us to have to wrap all the inlines.  This
+    // means that we cannot coalesce inlines before |insertionPoint| with inlines following
+    // |insertionPoint|, because the new child is going to be inserted in between the inlines,
+    // splitting them.
     KHTMLAssert(!isInline());
-    KHTMLAssert(!box2Start || box2Start->parent() == this);
+    KHTMLAssert(!insertionPoint || insertionPoint->parent() == this);
 
     m_childrenInline = false;
 
     RenderObject *child = firstChild();
-    RenderObject *next;
-    RenderObject *boxFirst = 0;
-    RenderObject *boxLast = 0;
+    
     while (child) {
-        next = child->nextSibling();
+        RenderObject *inlineRunStart, *inlineRunEnd;
+        getInlineRun(child, insertionPoint, inlineRunStart, inlineRunEnd);
 
-        if (child->isInline()) {
-            if ( !boxFirst )
-                boxFirst = child;
-            boxLast = child;
-        }
-
-        if (boxFirst &&
-            (!child->isInline() || !next || child == box2Start)) {
-            // Create a new anonymous box containing all children starting from boxFirst
-            // and up to boxLast, and put it in place of the children
-            RenderStyle *newStyle = new RenderStyle();
-            newStyle->inheritFrom(style());
-            newStyle->setDisplay(BLOCK);
+        if (!inlineRunStart)
+            break;
 
-            RenderFlow *box = new (renderArena()) RenderFlow(0 /* anonymous box */);
-            box->setStyle(newStyle);
-            box->setIsAnonymousBox(true);
-            // ### the children have a wrong style!!!
-            // They get exactly the style of this element, not of the anonymous box
-            // might be important for bg colors!
+        child = inlineRunEnd->nextSibling();
+        
+        RenderStyle *newStyle = new RenderStyle();
+        newStyle->inheritFrom(style());
+        newStyle->setDisplay(BLOCK);
 
-            insertChildNode(box, boxFirst);
-            RenderObject* o = boxFirst;
-            while(o && o != boxLast)
-            {
-                RenderObject* no = o;
-                o = no->nextSibling();
-                box->appendChildNode(removeChildNode(no));
-            }
-            if (child && box2Start == child) {
-                boxFirst = boxLast = (child->isInline() ? box2Start : 0);
-                box2Start = 0;
-                continue;
-            }
-            else {
-                box->appendChildNode(removeChildNode(boxLast));
-                boxFirst = boxLast = 0;
-            }
-            box->close();
-            box->setPos(box->xPos(), -500000);
-            box->setLayouted(false);
+        RenderFlow *box = new (renderArena()) RenderFlow(0 /* anonymous box */);
+        box->setStyle(newStyle);
+        box->setIsAnonymousBox(true);
+       
+        insertChildNode(box, inlineRunStart);
+        RenderObject* o = inlineRunStart;
+        while(o != inlineRunEnd)
+        {
+            RenderObject* no = o;
+            o = no->nextSibling();
+            box->appendChildNode(removeChildNode(no));
         }
-
-        child = next;
+        box->appendChildNode(removeChildNode(inlineRunEnd));
+        box->close();
+        box->setPos(box->xPos(), -500000);
+        box->setLayouted(false);
     }
 
     setLayouted(false);
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index 1e9db9f..412b065 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -456,11 +456,6 @@ RenderLayer::constructZTree(QRect overflowClipRect, QRect posClipRect,
     // This variable stores the result we will hand back.
     RenderZTreeNode* returnNode = 0;
     
-    // If a layer isn't visible, then none of its child layers are visible either.
-    // Don't build this branch of the z-tree, since these layers should not be painted.
-    if (renderer()->style()->visibility() != VISIBLE)
-        return 0;
-    
     // Compute this layer's absolute position, so that we can compare it with our
     // damage rect and avoid repainting the layer if it falls outside that rect.
     // An exception to this rule is the root layer, which always paints (hence the

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list