Changeset 199497 in webkit


Ignore:
Timestamp:
Apr 13, 2016 9:16:13 AM (8 years ago)
Author:
fred.wang@free.fr
Message:

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

Patch by Frederic Wang <fwang@igalia.com> 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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r199392 r199497  
     12016-04-13  Frederic Wang  <fwang@igalia.com>
     2
     3        Fix two coding mistakes in MathMLInlineContainerElement::childrenChanged
     4        https://bugs.webkit.org/show_bug.cgi?id=156538
     5
     6        Reviewed by Darin Adler.
     7
     8        We fix the call to updateOperatorProperties inside MathMLInlineContainerElement::childrenChanged
     9        for the <math> and <msqrt> tags.
     10
     11        The <math> tag is already a RenderMathMLRow so the hasTagName(mathTag)
     12        conditional is never executed. The tag does not create any anonymous
     13        wrapper so we do not need a special case for it anyway.
     14
     15        The <msqrt> tag is not a RenderMathMLRow (yet). However, the anonymous
     16        wrapper behaving as a RenderMathMLRow is actually the last child, not
     17        the first one.
     18
     19        No new tests, this is already covered by mathml/presentation/mo-form-dynamic.html
     20        Note that for some reason the coding error for <msqrt> only shows up
     21        after the refactoring of bug 152244.
     22
     23        * mathml/MathMLInlineContainerElement.cpp:
     24        (WebCore::MathMLInlineContainerElement::childrenChanged): Fix the two mistakes and add some FIXME comments.
     25
    1262016-04-12  Chris Dumez  <cdumez@apple.com>
    227
  • trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp

    r194496 r199497  
    5959{
    6060    if (renderer()) {
     61        // FIXME: Parsing of operator properties should be done in the element classes rather than in the renderer classes.
     62        // See http://webkit.org/b/156537
    6163        if (is<RenderMathMLRow>(*renderer()))
    6264            downcast<RenderMathMLRow>(*renderer()).updateOperatorProperties();
    63         else if (hasTagName(mathTag) || hasTagName(msqrtTag)) {
    64             auto* childRenderer = renderer()->firstChild();
     65        else if (hasTagName(msqrtTag)) {
     66            // Update operator properties for the base wrapper.
     67            // FIXME: This won't be necessary when RenderMathMLSquareRoot derives from RenderMathMLRow and does not use anonymous wrappers.
     68            // See http://webkit.org/b/153987
     69            auto* childRenderer = renderer()->lastChild();
    6570            if (is<RenderMathMLRow>(childRenderer))
    6671                downcast<RenderMathMLRow>(*childRenderer).updateOperatorProperties();
Note: See TracChangeset for help on using the changeset viewer.