Changeset 161501 in webkit


Ignore:
Timestamp:
Jan 8, 2014 7:43:52 AM (10 years ago)
Author:
akling@apple.com
Message:

Deploy RenderPtr in RenderMathMLOperator::updateFromElement().
<https://webkit.org/b/126628>

Reviewed by Antti Koivisto.

  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::updateFromElement):

Use RenderPtr/createRenderer for renderer creation.
Removed an unnecessary null check (text is always created.)
Also use RenderStyle::createAnonymousStyleWithDisplay()
helper to shorten down the code a bit.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r161500 r161501  
     12014-01-08  Andreas Kling  <akling@apple.com>
     2
     3        Deploy RenderPtr in RenderMathMLOperator::updateFromElement().
     4        <https://webkit.org/b/126628>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * rendering/mathml/RenderMathMLOperator.cpp:
     9        (WebCore::RenderMathMLOperator::updateFromElement):
     10
     11            Use RenderPtr/createRenderer for renderer creation.
     12            Removed an unnecessary null check (text is always created.)
     13            Also use RenderStyle::createAnonymousStyleWithDisplay()
     14            helper to shorten down the code a bit.
     15
    1162014-01-08  Alberto Garcia  <berto@igalia.com>
    217
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r160711 r161501  
    173173    // renderer to 0, so we need to restore it.
    174174    element().setRenderer(savedRenderer);
    175    
    176     auto newStyle = RenderStyle::create();
    177     newStyle.get().inheritFrom(&style());
    178     newStyle.get().setDisplay(FLEX);
    179 
    180     RenderMathMLBlock* container = new RenderMathMLBlock(element(), std::move(newStyle));
     175
     176    RenderPtr<RenderMathMLBlock> container = createRenderer<RenderMathMLBlock>(element(), RenderStyle::createAnonymousStyleWithDisplay(&style(), FLEX));
    181177    // This container doesn't offer any useful information to accessibility.
    182178    container->setIgnoreInAccessibilityTree(true);
    183179    container->initializeStyle();
    184180
    185     addChild(container);
    186     RenderText* text;
     181    RenderPtr<RenderText> text;
    187182    if (m_operator)
    188         text = new RenderText(document(), String(&m_operator, 1));
     183        text = createRenderer<RenderText>(document(), String(&m_operator, 1));
    189184    else
    190         text = new RenderText(document(), element().textContent().replace(hyphenMinus, minusSign).impl());
    191 
    192     // If we can't figure out the text, leave it blank.
    193     if (text)
    194         container->addChild(text);
     185        text = createRenderer<RenderText>(document(), element().textContent().replace(hyphenMinus, minusSign).impl());
     186
     187    container->addChild(text.leakPtr());
     188    addChild(container.leakPtr());
    195189
    196190    updateStyle();
Note: See TracChangeset for help on using the changeset viewer.