XML document builder should create render tree asynchronously
https://bugs.webkit.org/show_bug.cgi?id=126285

Source/WebCore: 

Reviewed by Andreas Kling.
        
Stop creating renderers explicitly. 
Fix SVG <use> element to not rely on parse time render tree construction.

* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::svgAttributeChanged):
        
    Remove renderer check, we may not have created the render tree yet.

(WebCore::SVGUseElement::willAttachRenderers):
        
    Switch to willAttachRenderers from willRecalcStyle. The latter is only called as long as style
    recalc doesn't start creating new renderers.

(WebCore::SVGUseElement::invalidateShadowTree):
        
    Remove renderer check, we may not have created the render tree yet. 
    Invalidate with ReconstructRenderTree so willAttachRenderers will always get called.

* svg/SVGUseElement.h:
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::exitText):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs):
(WebCore::XMLDocumentParser::cdataBlock):
        
    Remove explicit call to attachRenderTree. The render tree will be created lazily.

LayoutTests: 

Reviewed by Andreas Kling.

* platform/mac/fast/table/dynamic-caption-add-before-child-expected.png:
* platform/mac/fast/table/dynamic-caption-add-before-child-expected.txt:
        
    This is progression. Captions are now correctly in document order.

* svg/custom/object-no-size-attributes-expected.txt:
        
    Unnecessary text renderer disappears.

* svg/custom/resource-invalidation-crash-expected.txt:
        
    Progression, the dump has the correct fill.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderLayer: Store corner and resizer renderers in RenderPtrs.
<https://webkit.org/b/126274>

Turn RenderLayer::m_scrollCorner and m_resizer into RenderPtrs.
Removed manual destroy() calls as appropriate. Also tweaked some
code to reduce nesting.

Reviewed by Anders Carlsson.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove attachChild
https://bugs.webkit.org/show_bug.cgi?id=126288

Reviewed by Andreas Kling.

* dom/ContainerNode.cpp:
(WebCore::destroyRenderTreeIfNeeded):
        
    Rename detachChild and move the tests here.

(WebCore::ContainerNode::takeAllChildrenFrom):
        
    No need to call attachRenderTree explicitly anymore.

(WebCore::ContainerNode::removeBetween):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161142 268f45cc-cd09-0410-ab3c-d52691b4dbfc