Commit 7f833366 authored by akling@apple.com's avatar akling@apple.com

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161501 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c08a6cbb
2014-01-08 Andreas Kling <akling@apple.com>
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.
2014-01-08 Alberto Garcia <berto@igalia.com>
Fix some compilation warnings
......@@ -172,26 +172,20 @@ void RenderMathMLOperator::updateFromElement()
// Since we share a node with our children, destroying our children may set our node's
// renderer to 0, so we need to restore it.
element().setRenderer(savedRenderer);
auto newStyle = RenderStyle::create();
newStyle.get().inheritFrom(&style());
newStyle.get().setDisplay(FLEX);
RenderMathMLBlock* container = new RenderMathMLBlock(element(), std::move(newStyle));
RenderPtr<RenderMathMLBlock> container = createRenderer<RenderMathMLBlock>(element(), RenderStyle::createAnonymousStyleWithDisplay(&style(), FLEX));
// This container doesn't offer any useful information to accessibility.
container->setIgnoreInAccessibilityTree(true);
container->initializeStyle();
addChild(container);
RenderText* text;
RenderPtr<RenderText> text;
if (m_operator)
text = new RenderText(document(), String(&m_operator, 1));
text = createRenderer<RenderText>(document(), String(&m_operator, 1));
else
text = new RenderText(document(), element().textContent().replace(hyphenMinus, minusSign).impl());
text = createRenderer<RenderText>(document(), element().textContent().replace(hyphenMinus, minusSign).impl());
// If we can't figure out the text, leave it blank.
if (text)
container->addChild(text);
container->addChild(text.leakPtr());
addChild(container.leakPtr());
updateStyle();
setNeedsLayoutAndPrefWidthsRecalc();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment