Title: [132737] trunk/Source/WebCore
Revision
132737
Author
dbar...@mathscribe.com
Date
2012-10-27 11:27:58 -0700 (Sat, 27 Oct 2012)

Log Message

ASSERTION FAILED: m_next in LayoutState.cpp
https://bugs.webkit.org/show_bug.cgi?id=99796

Reviewed by Eric Seidel.

Before RenderMathMLBlock::computeChildrenPreferredLogicalHeights calls child->layoutIfNeeded(),
it must ensure a layoutState exists. We disable it in any case, since we are just calculating
metrics here, and the final layout may well happen again.

No new tests. I don't know how to create an automated test for this. The crashes users are
seeing are flaky.

* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::computeChildrenPreferredLogicalHeights):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (132736 => 132737)


--- trunk/Source/WebCore/ChangeLog	2012-10-27 18:25:56 UTC (rev 132736)
+++ trunk/Source/WebCore/ChangeLog	2012-10-27 18:27:58 UTC (rev 132737)
@@ -1,5 +1,22 @@
 2012-10-27  David Barton  <dbar...@mathscribe.com>
 
+        ASSERTION FAILED: m_next in LayoutState.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=99796
+
+        Reviewed by Eric Seidel.
+
+        Before RenderMathMLBlock::computeChildrenPreferredLogicalHeights calls child->layoutIfNeeded(),
+        it must ensure a layoutState exists. We disable it in any case, since we are just calculating
+        metrics here, and the final layout may well happen again.
+
+        No new tests. I don't know how to create an automated test for this. The crashes users are
+        seeing are flaky.
+
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::computeChildrenPreferredLogicalHeights):
+
+2012-10-27  David Barton  <dbar...@mathscribe.com>
+
         [MathML] Improve some addChild methods
         https://bugs.webkit.org/show_bug.cgi?id=98791
 

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (132736 => 132737)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp	2012-10-27 18:25:56 UTC (rev 132736)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp	2012-10-27 18:27:58 UTC (rev 132737)
@@ -32,6 +32,7 @@
 
 #include "GraphicsContext.h"
 #include "MathMLNames.h"
+#include "RenderView.h"
 
 #if ENABLE(DEBUG_MATH_LAYOUT)
 #include "PaintInfo.h"
@@ -165,25 +166,35 @@
     // Ensure a full repaint will happen after layout finishes.
     setNeedsLayout(true, MarkOnlyThis);
     
-    LayoutUnit oldAvailableLogicalWidth = availableLogicalWidth();
-    setLogicalWidth(cLargeLogicalWidth);
-    
-    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
-        if (!child->isBox())
-            continue;
+    RenderView* renderView = view();
+    bool hadLayoutState = renderView->layoutState();
+    if (!hadLayoutState)
+        renderView->pushLayoutState(this);
+    {
+        LayoutStateDisabler layoutStateDisabler(renderView);
         
-        // Because our width changed, |child| may need layout.
-        if (child->maxPreferredLogicalWidth() > oldAvailableLogicalWidth)
-            child->setNeedsLayout(true, MarkOnlyThis);
+        LayoutUnit oldAvailableLogicalWidth = availableLogicalWidth();
+        setLogicalWidth(cLargeLogicalWidth);
         
-        RenderMathMLBlock* childMathMLBlock = child->isRenderMathMLBlock() ? toRenderMathMLBlock(child) : 0;
-        if (childMathMLBlock && !childMathMLBlock->isPreferredLogicalHeightDirty())
-            continue;
-        // Layout our child to compute its preferred logical height.
-        child->layoutIfNeeded();
-        if (childMathMLBlock)
-            childMathMLBlock->setPreferredLogicalHeight(childMathMLBlock->logicalHeight());
+        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+            if (!child->isBox())
+                continue;
+            
+            // Because our width changed, |child| may need layout.
+            if (child->maxPreferredLogicalWidth() > oldAvailableLogicalWidth)
+                child->setNeedsLayout(true, MarkOnlyThis);
+            
+            RenderMathMLBlock* childMathMLBlock = child->isRenderMathMLBlock() ? toRenderMathMLBlock(child) : 0;
+            if (childMathMLBlock && !childMathMLBlock->isPreferredLogicalHeightDirty())
+                continue;
+            // Layout our child to compute its preferred logical height.
+            child->layoutIfNeeded();
+            if (childMathMLBlock)
+                childMathMLBlock->setPreferredLogicalHeight(childMathMLBlock->logicalHeight());
+        }
     }
+    if (!hadLayoutState)
+        renderView->popLayoutState(this);
 }
 
 LayoutUnit RenderMathMLBlock::preferredLogicalHeightAfterSizing(RenderObject* child)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to