Title: [225148] trunk/Source/WebCore
Revision
225148
Author
[email protected]
Date
2017-11-26 14:13:08 -0800 (Sun, 26 Nov 2017)

Log Message

Cleanup code for RenderMathMLUnderOver::layoutBlock
https://bugs.webkit.org/show_bug.cgi?id=179681

Patch by Minsheng Liu <[email protected]> on 2017-11-26
Reviewed by Frédéric Wang.

The patch removes some unnecessary calls to layoutIfNeeds() and guards the change
with assertion. Since there is no behavior change, no new tests are required.

* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
(WebCore::RenderMathMLUnderOver::layoutBlock):
(WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Deleted.
* rendering/mathml/RenderMathMLUnderOver.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (225147 => 225148)


--- trunk/Source/WebCore/ChangeLog	2017-11-26 20:03:02 UTC (rev 225147)
+++ trunk/Source/WebCore/ChangeLog	2017-11-26 22:13:08 UTC (rev 225148)
@@ -1,3 +1,19 @@
+2017-11-26  Minsheng Liu  <[email protected]>
+
+        Cleanup code for RenderMathMLUnderOver::layoutBlock
+        https://bugs.webkit.org/show_bug.cgi?id=179681
+
+        Reviewed by Frédéric Wang.
+
+        The patch removes some unnecessary calls to layoutIfNeeds() and guards the change
+        with assertion. Since there is no behavior change, no new tests are required.
+
+        * rendering/mathml/RenderMathMLUnderOver.cpp:
+        (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
+        (WebCore::RenderMathMLUnderOver::layoutBlock):
+        (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Deleted.
+        * rendering/mathml/RenderMathMLUnderOver.h:
+
 2017-11-26  Simon Fraser  <[email protected]>
 
         Use more Uint8ClampedArray& and constness in filter and image buffer code

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp (225147 => 225148)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp	2017-11-26 20:03:02 UTC (rev 225147)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp	2017-11-26 22:13:08 UTC (rev 225148)
@@ -50,7 +50,7 @@
     return static_cast<MathMLUnderOverElement&>(nodeForNonAnonymous());
 }
 
-void RenderMathMLUnderOver::computeOperatorsHorizontalStretch()
+void RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren()
 {
     LayoutUnit stretchWidth = 0;
     Vector<RenderMathMLOperator*, 2> renderOperators;
@@ -261,14 +261,12 @@
 
     recomputeLogicalWidth();
 
-    computeOperatorsHorizontalStretch();
+    stretchHorizontalOperatorsAndLayoutChildren();
 
-    base().layoutIfNeeded();
-    if (m_scriptType == Under || m_scriptType == UnderOver)
-        under().layoutIfNeeded();
-    if (m_scriptType == Over || m_scriptType == UnderOver)
-        over().layoutIfNeeded();
-
+    ASSERT(!base().needsLayout());
+    ASSERT(m_scriptType == Over || !under().needsLayout());
+    ASSERT(m_scriptType == Under || !over().needsLayout());
+    
     LayoutUnit logicalWidth = base().logicalWidth();
     if (m_scriptType == Under || m_scriptType == UnderOver)
         logicalWidth = std::max(logicalWidth, under().logicalWidth());

Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h (225147 => 225148)


--- trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h	2017-11-26 20:03:02 UTC (rev 225147)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h	2017-11-26 22:13:08 UTC (rev 225148)
@@ -48,7 +48,7 @@
     void computePreferredLogicalWidths() final;
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
 
-    void computeOperatorsHorizontalStretch();
+    void stretchHorizontalOperatorsAndLayoutChildren();
     bool isValid() const;
     bool shouldMoveLimits();
     RenderBox& base() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to