Title: [199497] trunk/Source/WebCore
Revision
199497
Author
[email protected]
Date
2016-04-13 09:16:13 -0700 (Wed, 13 Apr 2016)

Log Message

Fix two coding mistakes in MathMLInlineContainerElement::childrenChanged
https://bugs.webkit.org/show_bug.cgi?id=156538

Patch by Frederic Wang <[email protected]> on 2016-04-13
Reviewed by Darin Adler.

We fix the call to updateOperatorProperties inside MathMLInlineContainerElement::childrenChanged
for the <math> and <msqrt> tags.

The <math> tag is already a RenderMathMLRow so the hasTagName(mathTag)
conditional is never executed. The tag does not create any anonymous
wrapper so we do not need a special case for it anyway.

The <msqrt> tag is not a RenderMathMLRow (yet). However, the anonymous
wrapper behaving as a RenderMathMLRow is actually the last child, not
the first one.

No new tests, this is already covered by mathml/presentation/mo-form-dynamic.html
Note that for some reason the coding error for <msqrt> only shows up
after the refactoring of bug 152244.

* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::childrenChanged): Fix the two mistakes and add some FIXME comments.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (199496 => 199497)


--- trunk/Source/WebCore/ChangeLog	2016-04-13 16:10:13 UTC (rev 199496)
+++ trunk/Source/WebCore/ChangeLog	2016-04-13 16:16:13 UTC (rev 199497)
@@ -1,3 +1,28 @@
+2016-04-13  Frederic Wang  <[email protected]>
+
+        Fix two coding mistakes in MathMLInlineContainerElement::childrenChanged
+        https://bugs.webkit.org/show_bug.cgi?id=156538
+
+        Reviewed by Darin Adler.
+
+        We fix the call to updateOperatorProperties inside MathMLInlineContainerElement::childrenChanged
+        for the <math> and <msqrt> tags.
+
+        The <math> tag is already a RenderMathMLRow so the hasTagName(mathTag)
+        conditional is never executed. The tag does not create any anonymous
+        wrapper so we do not need a special case for it anyway.
+
+        The <msqrt> tag is not a RenderMathMLRow (yet). However, the anonymous
+        wrapper behaving as a RenderMathMLRow is actually the last child, not
+        the first one.
+
+        No new tests, this is already covered by mathml/presentation/mo-form-dynamic.html
+        Note that for some reason the coding error for <msqrt> only shows up
+        after the refactoring of bug 152244.
+
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::childrenChanged): Fix the two mistakes and add some FIXME comments.
+
 2016-04-12  Chris Dumez  <[email protected]>
 
         Attr.value should not be nullable

Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (199496 => 199497)


--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp	2016-04-13 16:10:13 UTC (rev 199496)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp	2016-04-13 16:16:13 UTC (rev 199497)
@@ -58,10 +58,15 @@
 void MathMLInlineContainerElement::childrenChanged(const ChildChange& change)
 {
     if (renderer()) {
+        // FIXME: Parsing of operator properties should be done in the element classes rather than in the renderer classes.
+        // See http://webkit.org/b/156537
         if (is<RenderMathMLRow>(*renderer()))
             downcast<RenderMathMLRow>(*renderer()).updateOperatorProperties();
-        else if (hasTagName(mathTag) || hasTagName(msqrtTag)) {
-            auto* childRenderer = renderer()->firstChild();
+        else if (hasTagName(msqrtTag)) {
+            // Update operator properties for the base wrapper.
+            // FIXME: This won't be necessary when RenderMathMLSquareRoot derives from RenderMathMLRow and does not use anonymous wrappers.
+            // See http://webkit.org/b/153987
+            auto* childRenderer = renderer()->lastChild();
             if (is<RenderMathMLRow>(childRenderer))
                 downcast<RenderMathMLRow>(*childRenderer).updateOperatorProperties();
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to