コード例 #1
0
ファイル: RenderMathMLFenced.cpp プロジェクト: boska/webkit
void RenderMathMLFenced::makeFences()
{
    RenderPtr<RenderMathMLOperator> openFence = createMathMLOperator(m_open, MathMLOperatorDictionary::Prefix, MathMLOperatorDictionary::Fence);
    RenderMathMLOperator* openFencePtr = openFence.get();
    RenderMathMLRow::addChild(openFence.leakPtr(), firstChild());

    RenderPtr<RenderMathMLOperator> closeFence = createMathMLOperator(m_close, MathMLOperatorDictionary::Postfix, MathMLOperatorDictionary::Fence);
    m_closeFenceRenderer = closeFence.get();
    RenderMathMLRow::addChild(closeFence.leakPtr());

    openFencePtr->updateFromElement();
    m_closeFenceRenderer->updateFromElement();
}
コード例 #2
0
ファイル: RenderMathMLFraction.cpp プロジェクト: hnney/webkit
void RenderMathMLFraction::addChild(RenderObject* child, RenderObject* /* beforeChild */)
{
    if (isEmpty()) {
        RenderPtr<RenderMathMLBlock> numeratorWrapper = createAnonymousMathMLBlock();
        fixChildStyle(numeratorWrapper.get());
        RenderMathMLBlock::addChild(numeratorWrapper.leakPtr());
        
        RenderPtr<RenderMathMLBlock> denominatorWrapper = createAnonymousMathMLBlock();
        fixChildStyle(denominatorWrapper.get());
        RenderMathMLBlock::addChild(denominatorWrapper.leakPtr());
    }
    
    if (firstChild()->isEmpty())
        downcast<RenderElement>(*firstChild()).addChild(child);
    else
        downcast<RenderElement>(*lastChild()).addChild(child);
    
    updateFromElement();
}
コード例 #3
0
RenderPtr<RenderElement> SVGMaskElement::createElementRenderer(Ref<RenderStyle>&& style)
{
    RenderPtr<RenderElement> maskRenderer = createRenderer<RenderSVGResourceMasker>(*this, WTF::move(style));
    
    // Pass along existing render layer clients.
    for (auto* clientLayer : m_clientLayers)
        static_cast<RenderSVGResourceMasker*>(maskRenderer.get())->addClientRenderLayer(clientLayer);
    
    return maskRenderer;
}