<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[225994] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/225994">225994</a></dd>
<dt>Author</dt> <dd>ryanhaddad@apple.com</dd>
<dt>Date</dt> <dd>2017-12-15 18:05:42 -0800 (Fri, 15 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/225969">r225969</a>.

This change introduced LayoutTest crashes.

Reverted changeset:

"Introduce RenderTreeBuilder"
https://bugs.webkit.org/show_bug.cgi?id=180817
https://trac.webkit.org/changeset/225969</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockh">trunk/Source/WebCore/rendering/RenderBlock.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderButtoncpp">trunk/Source/WebCore/rendering/RenderButton.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderButtonh">trunk/Source/WebCore/rendering/RenderButton.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFullScreencpp">trunk/Source/WebCore/rendering/RenderFullScreen.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFullScreenh">trunk/Source/WebCore/rendering/RenderFullScreen.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridh">trunk/Source/WebCore/rendering/RenderGrid.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlineh">trunk/Source/WebCore/rendering/RenderInline.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListcpp">trunk/Source/WebCore/rendering/RenderMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListh">trunk/Source/WebCore/rendering/RenderMenuList.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMultiColumnFlowcpp">trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderQuotecpp">trunk/Source/WebCore/rendering/RenderQuote.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderQuoteh">trunk/Source/WebCore/rendering/RenderQuote.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubycpp">trunk/Source/WebCore/rendering/RenderRuby.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyh">trunk/Source/WebCore/rendering/RenderRuby.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyBaseh">trunk/Source/WebCore/rendering/RenderRubyBase.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyRuncpp">trunk/Source/WebCore/rendering/RenderRubyRun.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyRunh">trunk/Source/WebCore/rendering/RenderRubyRun.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTablecpp">trunk/Source/WebCore/rendering/RenderTable.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableh">trunk/Source/WebCore/rendering/RenderTable.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableRowcpp">trunk/Source/WebCore/rendering/RenderTableRow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableRowh">trunk/Source/WebCore/rendering/RenderTableRow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableSectioncpp">trunk/Source/WebCore/rendering/RenderTableSection.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableSectionh">trunk/Source/WebCore/rendering/RenderTableSection.h</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutoSizingcpp">trunk/Source/WebCore/rendering/TextAutoSizing.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLFencedcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLFencedh">trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGContainercpp">trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGContainerh">trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGInlinecpp">trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGInlineh">trunk/Source/WebCore/rendering/svg/RenderSVGInline.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGRootcpp">trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGRooth">trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGTexth">trunk/Source/WebCore/rendering/svg/RenderSVGText.h</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreePositioncpp">trunk/Source/WebCore/style/RenderTreePosition.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreePositionh">trunk/Source/WebCore/style/RenderTreePosition.h</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdatercpp">trunk/Source/WebCore/style/RenderTreeUpdater.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdaterh">trunk/Source/WebCore/style/RenderTreeUpdater.h</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdaterFirstLettercpp">trunk/Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdaterGeneratedContentcpp">trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdaterGeneratedContenth">trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.h</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdaterListItemcpp">trunk/Source/WebCore/style/RenderTreeUpdaterListItem.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdaterListItemh">trunk/Source/WebCore/style/RenderTreeUpdaterListItem.h</a></li>
<li><a href="#trunkSourceWebCorestyleRenderTreeUpdaterMultiColumncpp">trunk/Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingRenderTreeBuildercpp">trunk/Source/WebCore/rendering/RenderTreeBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeBuilderh">trunk/Source/WebCore/rendering/RenderTreeBuilder.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/ChangeLog      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-12-15  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r225969.
+
+        This change introduced LayoutTest crashes.
+
+        Reverted changeset:
+
+        "Introduce RenderTreeBuilder"
+        https://bugs.webkit.org/show_bug.cgi?id=180817
+        https://trac.webkit.org/changeset/225969
+
</ins><span class="cx"> 2017-12-15  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Support updating a service worker registration's updateViaCache flag
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/Sources.txt    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -1844,7 +1844,6 @@
</span><span class="cx"> rendering/RenderTextLineBoxes.cpp
</span><span class="cx"> rendering/RenderTheme.cpp
</span><span class="cx"> rendering/RenderTreeAsText.cpp
</span><del>-rendering/RenderTreeBuilder.cpp
</del><span class="cx"> rendering/RenderVTTCue.cpp
</span><span class="cx"> rendering/RenderVideo.cpp
</span><span class="cx"> rendering/RenderView.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -4615,7 +4615,6 @@
</span><span class="cx">          E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E9B1181810916F003ACCDF /* SimpleLineLayoutResolver.h */; };
</span><span class="cx">          E4E9B11D1814569C003ACCDF /* SimpleLineLayoutFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */; };
</span><span class="cx">          E4F9EEF3156DA00700D23E7E /* StyleSheetContents.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               E4FC009B1FE00B90006A073E /* RenderTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = E4FC009A1FE00B8F006A073E /* RenderTreeBuilder.h */; };
</del><span class="cx">           E5BA7D63151437CA00FE1E3F /* LengthFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */; };
</span><span class="cx">          EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF5121B1696496C0056BD25 /* JSTypeConversions.h */; };
</span><span class="lines">@@ -9177,10 +9176,10 @@
</span><span class="cx">          7C7903B01F86F95C00463A70 /* ImageBitmapRenderingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageBitmapRenderingContext.h; sourceTree = "<group>"; };
</span><span class="cx">          7C7903B11F86F95C00463A70 /* ImageBitmapRenderingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBitmapRenderingContext.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7C7903B21F86F95C00463A70 /* ImageBitmapRenderingContext.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ImageBitmapRenderingContext.idl; sourceTree = "<group>"; };
</span><ins>+               7C7903B71F86FDE400463A70 /* JSImageBitmapRenderingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSImageBitmapRenderingContext.cpp; sourceTree = "<group>"; };
+               7C7903B81F86FDE600463A70 /* JSImageBitmapRenderingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSImageBitmapRenderingContext.h; sourceTree = "<group>"; };
</ins><span class="cx">           7C7903B51F86FDE400463A70 /* JSImageBitmapRenderingContextSettings.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSImageBitmapRenderingContextSettings.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7C7903B61F86FDE600463A70 /* JSImageBitmapRenderingContextSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSImageBitmapRenderingContextSettings.h; sourceTree = "<group>"; };
</span><del>-               7C7903B71F86FDE400463A70 /* JSImageBitmapRenderingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSImageBitmapRenderingContext.cpp; sourceTree = "<group>"; };
-               7C7903B81F86FDE600463A70 /* JSImageBitmapRenderingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSImageBitmapRenderingContext.h; sourceTree = "<group>"; };
</del><span class="cx">           7C7903BA1F86FF3300463A70 /* PlaceholderRenderingContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlaceholderRenderingContext.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7C7903BC1F86FF3400463A70 /* PlaceholderRenderingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceholderRenderingContext.h; sourceTree = "<group>"; };
</span><span class="cx">          7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetectorsCoreSoftLink.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -13994,8 +13993,6 @@
</span><span class="cx">          E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutFunctions.h; sourceTree = "<group>"; };
</span><span class="cx">          E4F9EEF0156D84C400D23E7E /* StyleSheetContents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheetContents.cpp; sourceTree = "<group>"; };
</span><span class="cx">          E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetContents.h; sourceTree = "<group>"; };
</span><del>-               E4FC00971FE00B83006A073E /* RenderTreeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilder.cpp; sourceTree = "<group>"; };
-               E4FC009A1FE00B8F006A073E /* RenderTreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilder.h; sourceTree = "<group>"; };
</del><span class="cx">           E51A81DE17298D7700BFCA61 /* JSPerformance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformance.cpp; sourceTree = "<group>"; };
</span><span class="cx">          E526AF3E1727F8F200E41781 /* Performance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Performance.cpp; sourceTree = "<group>"; };
</span><span class="cx">          E55F4979151B888000BB67DB /* LengthFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthFunctions.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -25099,8 +25096,6 @@
</span><span class="cx">                          BCEA4849097D93020094C9E4 /* RenderThemeMac.mm */,
</span><span class="cx">                          93955A4203D72932008635CE /* RenderTreeAsText.cpp */,
</span><span class="cx">                          93955A4103D72932008635CE /* RenderTreeAsText.h */,
</span><del>-                               E4FC00971FE00B83006A073E /* RenderTreeBuilder.cpp */,
-                               E4FC009A1FE00B8F006A073E /* RenderTreeBuilder.h */,
</del><span class="cx">                           E4B41E330CBFB60900AF2ECE /* RenderVideo.cpp */,
</span><span class="cx">                          E4B41E340CBFB60900AF2ECE /* RenderVideo.h */,
</span><span class="cx">                          BCEA4828097D93020094C9E4 /* RenderView.cpp */,
</span><span class="lines">@@ -28744,7 +28739,6 @@
</span><span class="cx">                          416E6FE81BBD12DF000A6043 /* ReadableByteStreamInternalsBuiltins.h in Headers */,
</span><span class="cx">                          416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */,
</span><span class="cx">                          4129C9A91F59C56B009D7403 /* ReadableStreamDefaultController.h in Headers */,
</span><del>-                               E4FC009B1FE00B90006A073E /* RenderTreeBuilder.h in Headers */,
</del><span class="cx">                           416E6FE81BBD12DF000A3F64 /* ReadableStreamInternalsBuiltins.h in Headers */,
</span><span class="cx">                          4129C9AF1F59CF5B009D7403 /* ReadableStreamSink.h in Headers */,
</span><span class="cx">                          4129C9AB1F59C573009D7403 /* ReadableStreamSource.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/dom/Element.cpp        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -2916,7 +2916,8 @@
</span><span class="cx"> {
</span><span class="cx">     if (!pseudoElement)
</span><span class="cx">         return;
</span><del>-    ASSERT(!pseudoElement->renderer());
</del><ins>+    if (pseudoElement->renderer())
+        RenderTreeUpdater::tearDownRenderers(*pseudoElement);
</ins><span class="cx">     ASSERT(pseudoElement->hostElement());
</span><span class="cx">     pseudoElement->clearHostElement();
</span><span class="cx"> }
</span><span class="lines">@@ -3394,6 +3395,12 @@
</span><span class="cx">     elementRareData()->resetStyleRelations();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Element::clearStyleDerivedDataBeforeDetachingRenderer()
+{
+    clearBeforePseudoElement();
+    clearAfterPseudoElement();
+}
+
</ins><span class="cx"> void Element::clearHoverAndActiveStatusBeforeDetachingRenderer()
</span><span class="cx"> {
</span><span class="cx">     if (!isUserActionElement())
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h       2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/dom/Element.h  2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -515,6 +515,7 @@
</span><span class="cx">     void clearAfterPseudoElement();
</span><span class="cx">     void resetComputedStyle();
</span><span class="cx">     void resetStyleRelations();
</span><ins>+    void clearStyleDerivedDataBeforeDetachingRenderer();
</ins><span class="cx">     void clearHoverAndActiveStatusBeforeDetachingRenderer();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT URL absoluteLinkURL() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -61,7 +61,6 @@
</span><span class="cx"> #include "RenderTableCell.h"
</span><span class="cx"> #include "RenderTextFragment.h"
</span><span class="cx"> #include "RenderTheme.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderTreePosition.h"
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -469,7 +468,7 @@
</span><span class="cx">     return last;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBlock::addChildToContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderBlock::addChildToContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     RenderBlock* flow = continuationBefore(beforeChild);
</span><span class="cx">     ASSERT(!beforeChild || is<RenderBlock>(*beforeChild->parent()));
</span><span class="lines">@@ -485,7 +484,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (newChild->isFloatingOrOutOfFlowPositioned()) {
</span><del>-        beforeChildParent->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        beforeChildParent->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -494,7 +493,7 @@
</span><span class="cx">     bool flowIsNormal = flow->isInline() || !flow->style().columnSpan();
</span><span class="cx"> 
</span><span class="cx">     if (flow == beforeChildParent) {
</span><del>-        flow->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        flow->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -501,14 +500,14 @@
</span><span class="cx">     // The goal here is to match up if we can, so that we can coalesce and create the
</span><span class="cx">     // minimal # of continuations needed for the inline.
</span><span class="cx">     if (childIsNormal == bcpIsNormal) {
</span><del>-        beforeChildParent->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        beforeChildParent->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (flowIsNormal == childIsNormal) {
</span><del>-        flow->addChildIgnoringContinuation(builder, WTFMove(newChild), 0); // Just treat like an append.
</del><ins>+        flow->addChildIgnoringContinuation(WTFMove(newChild), 0); // Just treat like an append.
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    beforeChildParent->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+    beforeChildParent->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr<RenderBlock> RenderBlock::clone() const
</span><span class="lines">@@ -531,15 +530,15 @@
</span><span class="cx">     return cloneBlock;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBlock::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderBlock::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     if (continuation() && !isAnonymousBlock())
</span><del>-        addChildToContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        addChildToContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx">     else
</span><del>-        addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBlock::addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderBlock::addChildIgnoringContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     if (beforeChild && beforeChild->parent() != this) {
</span><span class="cx">         RenderElement* beforeChildContainer = beforeChild->parent();
</span><span class="lines">@@ -562,9 +561,9 @@
</span><span class="cx">                 ) {
</span><span class="cx">                 // Insert the child into the anonymous block box instead of here.
</span><span class="cx">                 if (newChild->isInline() || beforeChild->parent()->firstChild() != beforeChild)
</span><del>-                    beforeChild->parent()->addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+                    beforeChild->parent()->addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">                 else
</span><del>-                    addChild(builder, WTFMove(newChild), beforeChild->parent());
</del><ins>+                    addChild(WTFMove(newChild), beforeChild->parent());
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -572,7 +571,7 @@
</span><span class="cx"> 
</span><span class="cx">             if (newChild->isTablePart()) {
</span><span class="cx">                 // Insert into the anonymous table.
</span><del>-                beforeChildAnonymousContainer->addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+                beforeChildAnonymousContainer->addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -604,7 +603,7 @@
</span><span class="cx">         RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : lastChild();
</span><span class="cx"> 
</span><span class="cx">         if (afterChild && afterChild->isAnonymousBlock()) {
</span><del>-            builder.insertChild(downcast<RenderBlock>(*afterChild), WTFMove(newChild));
</del><ins>+            downcast<RenderBlock>(*afterChild).addChild(WTFMove(newChild));
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -612,8 +611,8 @@
</span><span class="cx">             // No suitable existing anonymous box - create a new one.
</span><span class="cx">             auto newBox = createAnonymousBlock();
</span><span class="cx">             auto& box = *newBox;
</span><del>-            RenderBox::addChild(builder, WTFMove(newBox), beforeChild);
-            builder.insertChild(box, WTFMove(newChild));
</del><ins>+            RenderBox::addChild(WTFMove(newBox), beforeChild);
+            box.addChild(WTFMove(newChild));
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -620,7 +619,7 @@
</span><span class="cx"> 
</span><span class="cx">     invalidateLineLayoutPath();
</span><span class="cx"> 
</span><del>-    RenderBox::addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+    RenderBox::addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">  
</span><span class="cx">     if (madeBoxesNonInline && is<RenderBlock>(parent()) && isAnonymousBlock())
</span><span class="cx">         downcast<RenderBlock>(*parent()).removeLeftoverAnonymousBlock(this);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.h     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderBlock.h        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
</span><span class="cx">     virtual void deleteLines();
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0);
</span><span class="lines">@@ -440,8 +440,8 @@
</span><span class="cx">     // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
</span><span class="cx">     virtual void moveAllChildrenIncludingFloatsTo(RenderBlock& toBlock, RenderBoxModelObject::NormalizeAfterInsertion normalizeAfterInsertion) { moveAllChildrenTo(&toBlock, normalizeAfterInsertion); }
</span><span class="cx"> 
</span><del>-    void addChildToContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild);
-    void addChildIgnoringContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild) override;
</del><ins>+    void addChildToContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild);
+    void addChildIgnoringContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild) override;
</ins><span class="cx"> 
</span><span class="cx">     bool isSelfCollapsingBlock() const override;
</span><span class="cx">     virtual bool childrenPreventSelfCollapsing() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp       2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp  2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx"> #include "RenderMultiColumnSet.h"
</span><span class="cx"> #include "RenderTableCell.h"
</span><span class="cx"> #include "RenderText.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "SimpleLineLayoutFunctions.h"
</span><span class="lines">@@ -3829,14 +3828,14 @@
</span><span class="cx">     determineLogicalLeftPositionForChild(*fragmentedFlow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBlockFlow::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderBlockFlow::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     if (multiColumnFlow() && (!isFieldset() || !newChild->isLegend()))
</span><del>-        return builder.insertChild(*multiColumnFlow(), WTFMove(newChild), beforeChild);
</del><ins>+        return multiColumnFlow()->addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">     auto* beforeChildOrPlaceholder = beforeChild;
</span><span class="cx">     if (auto* containingFragmentedFlow = enclosingFragmentedFlow())
</span><span class="cx">         beforeChildOrPlaceholder = containingFragmentedFlow->resolveMovedChild(beforeChild);
</span><del>-    RenderBlock::addChild(builder, WTFMove(newChild), beforeChildOrPlaceholder);
</del><ins>+    RenderBlock::addChild(WTFMove(newChild), beforeChildOrPlaceholder);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr<RenderObject> RenderBlockFlow::takeChild(RenderObject& oldChild)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -378,7 +378,7 @@
</span><span class="cx">     LayoutUnit logicalHeightForChildForFragmentation(const RenderBox& child) const;
</span><span class="cx">     bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) override;
</span><span class="cx"> 
</span><span class="cx">     void updateColumnProgressionFromStyle(RenderStyle&);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx"> #include "RenderTableRow.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderTextFragment.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "ScrollingConstraints.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -2697,7 +2696,7 @@
</span><span class="cx">         // Takes care of adding the new child correctly if toBlock and fromBlock
</span><span class="cx">         // have different kind of children (block vs inline).
</span><span class="cx">         auto childToMove = takeChildInternal(*child);
</span><del>-        RenderTreeBuilder::current()->insertChild(*toBoxModelObject, WTFMove(childToMove), beforeChild);
</del><ins>+        toBoxModelObject->addChild(WTFMove(childToMove), beforeChild);
</ins><span class="cx">     } else {
</span><span class="cx">         auto childToMove = takeChildInternal(*child);
</span><span class="cx">         toBoxModelObject->insertChildInternal(WTFMove(childToMove), beforeChild);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderButtoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderButton.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderButton.cpp  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderButton.cpp     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "RenderTextFragment.h"
</span><span class="cx"> #include "RenderTheme.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="cx"> 
</span><span class="lines">@@ -63,7 +62,7 @@
</span><span class="cx">     return is<HTMLInputElement>(formControlElement());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderButton::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderButton::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_inner) {
</span><span class="cx">         // Create an anonymous block.
</span><span class="lines">@@ -71,9 +70,9 @@
</span><span class="cx">         auto newInner = createAnonymousBlock(style().display());
</span><span class="cx">         updateAnonymousChildStyle(*newInner, newInner->mutableStyle());
</span><span class="cx">         m_inner = makeWeakPtr(*newInner);
</span><del>-        RenderFlexibleBox::addChild(builder, WTFMove(newInner));
</del><ins>+        RenderFlexibleBox::addChild(WTFMove(newInner));
</ins><span class="cx">     }    
</span><del>-    builder.insertChild(*m_inner, WTFMove(newChild), beforeChild);
</del><ins>+    m_inner->addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr<RenderObject> RenderButton::takeChild(RenderObject& oldChild)
</span><span class="lines">@@ -123,7 +122,7 @@
</span><span class="cx">     if (!m_buttonText) {
</span><span class="cx">         auto newButtonText = createRenderer<RenderTextFragment>(document(), str);
</span><span class="cx">         m_buttonText = makeWeakPtr(*newButtonText);
</span><del>-        RenderTreeBuilder::current()->insertChild(*this, WTFMove(newButtonText));
</del><ins>+        addChild(WTFMove(newButtonText));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderButtonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderButton.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderButton.h    2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderButton.h       2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool canBeSelectionLeaf() const override;
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject *beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> newChild, RenderObject *beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) override;
</span><span class="cx">     void removeLeftoverAnonymousBlock(RenderBlock*) override { }
</span><span class="cx">     bool createsAnonymousWrapper() const override { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -66,7 +66,6 @@
</span><span class="cx"> #include "RenderTableRow.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderTheme.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "SVGRenderSupport.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="lines">@@ -476,7 +475,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderElement::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderElement::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto& child = *newChild;
</span><span class="cx">     if (childRequiresTable(child)) {
</span><span class="lines">@@ -485,12 +484,12 @@
</span><span class="cx">         if (afterChild && afterChild->isAnonymous() && is<RenderTable>(*afterChild) && !afterChild->isBeforeContent())
</span><span class="cx">             table = downcast<RenderTable>(afterChild);
</span><span class="cx">         else {
</span><del>-            auto newTable = RenderTable::createAnonymousWithParentRenderer(*this);
</del><ins>+            auto newTable =  RenderTable::createAnonymousWithParentRenderer(*this);
</ins><span class="cx">             table = newTable.get();
</span><del>-            builder.insertChild(*this, WTFMove(newTable), beforeChild);
</del><ins>+            addChild(WTFMove(newTable), beforeChild);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        builder.insertChild(*table, WTFMove(newChild));
</del><ins>+        table->addChild(WTFMove(newChild));
</ins><span class="cx">     } else
</span><span class="cx">         insertChildInternal(WTFMove(newChild), beforeChild);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderElement.h      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> 
</span><span class="cx"> class ControlStates;
</span><span class="cx"> class RenderBlock;
</span><del>-class RenderTreeBuilder;
</del><span class="cx"> 
</span><span class="cx"> class RenderElement : public RenderObject {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(RenderElement);
</span><span class="lines">@@ -87,8 +86,8 @@
</span><span class="cx">     bool isRenderInline() const;
</span><span class="cx"> 
</span><span class="cx">     virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const { return true; }
</span><del>-    virtual void addChild(RenderTreeBuilder&, RenderPtr<RenderObject>, RenderObject* beforeChild);
-    virtual void addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr) { addChild(builder, WTFMove(newChild), beforeChild); }
</del><ins>+    virtual void addChild(RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
+    virtual void addChildIgnoringContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr) { addChild(WTFMove(newChild), beforeChild); }
</ins><span class="cx">     virtual RenderPtr<RenderObject> takeChild(RenderObject&) WARN_UNUSED_RETURN;
</span><span class="cx">     void removeAndDestroyChild(RenderObject&);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFullScreencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFullScreen.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFullScreen.cpp      2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderFullScreen.cpp 2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RenderLayerCompositor.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -94,7 +93,7 @@
</span><span class="cx">     return fullscreenStyle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RenderPtr<RenderFullScreen> RenderFullScreen::wrapNewRenderer(RenderTreeBuilder& builder, RenderPtr<RenderElement> renderer, RenderElement& parent, Document& document)
</del><ins>+RenderPtr<RenderFullScreen> RenderFullScreen::wrapNewRenderer(RenderPtr<RenderElement> renderer, RenderElement& parent, Document& document)
</ins><span class="cx"> {
</span><span class="cx">     auto newFullscreenRenderer = createRenderer<RenderFullScreen>(document, createFullScreenStyle());
</span><span class="cx">     newFullscreenRenderer->initializeStyle();
</span><span class="lines">@@ -103,7 +102,7 @@
</span><span class="cx">     if (!parent.isChildAllowed(fullscreenRenderer, fullscreenRenderer.style()))
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    builder.insertChild(fullscreenRenderer, WTFMove(renderer));
</del><ins>+    fullscreenRenderer.addChild(WTFMove(renderer));
</ins><span class="cx">     fullscreenRenderer.setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> 
</span><span class="cx">     document.setFullScreenRenderer(&fullscreenRenderer);
</span><span class="lines">@@ -113,9 +112,6 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderFullScreen::wrapExistingRenderer(RenderElement& renderer, Document& document)
</span><span class="cx"> {
</span><del>-    // FIXME: This should be done by RenderTreeUpdater.
-    RenderTreeBuilder builder;
-
</del><span class="cx">     auto newFullscreenRenderer = createRenderer<RenderFullScreen>(document, createFullScreenStyle());
</span><span class="cx">     newFullscreenRenderer->initializeStyle();
</span><span class="cx"> 
</span><span class="lines">@@ -130,7 +126,7 @@
</span><span class="cx">     // the line box tree underneath our |containingBlock| is not longer valid.
</span><span class="cx">     containingBlock->deleteLines();
</span><span class="cx"> 
</span><del>-    builder.insertChild(parent, WTFMove(newFullscreenRenderer), &renderer);
</del><ins>+    parent.addChild(WTFMove(newFullscreenRenderer), &renderer);
</ins><span class="cx"> 
</span><span class="cx">     auto toMove = parent.takeChild(renderer);
</span><span class="cx"> 
</span><span class="lines">@@ -140,7 +136,7 @@
</span><span class="cx">     parent.setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">     containingBlock->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> 
</span><del>-    builder.insertChild(fullscreenRenderer, WTFMove(toMove));
</del><ins>+    fullscreenRenderer.addChild(WTFMove(toMove));
</ins><span class="cx">     fullscreenRenderer.setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> 
</span><span class="cx">     document.setFullScreenRenderer(&fullscreenRenderer);
</span><span class="lines">@@ -148,8 +144,6 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderFullScreen::unwrapRenderer(bool& requiresRenderTreeRebuild)
</span><span class="cx"> {
</span><del>-    RenderTreeBuilder builder;
-
</del><span class="cx">     requiresRenderTreeRebuild = false;
</span><span class="cx">     if (parent()) {
</span><span class="cx">         auto* child = firstChild();
</span><span class="lines">@@ -179,7 +173,7 @@
</span><span class="cx">             if (is<RenderBox>(*child))
</span><span class="cx">                 downcast<RenderBox>(*child).clearOverrideSize();
</span><span class="cx">             auto childToMove = child->parent()->takeChild(*child);
</span><del>-            builder.insertChild(*parent(), WTFMove(childToMove), this);
</del><ins>+            parent()->addChild(WTFMove(childToMove), this);
</ins><span class="cx">             parent()->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -210,7 +204,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_placeholder = makeWeakPtr(*newPlaceholder);
</span><span class="cx"> 
</span><del>-    RenderTreeBuilder::current()->insertChild(*parent(), WTFMove(newPlaceholder), this);
</del><ins>+    parent()->addChild(WTFMove(newPlaceholder), this);
</ins><span class="cx">     parent()->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFullScreenh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFullScreen.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFullScreen.h        2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderFullScreen.h   2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     RenderBlock* placeholder() { return m_placeholder.get(); }
</span><span class="cx">     void createPlaceholder(std::unique_ptr<RenderStyle>, const LayoutRect& frameRect);
</span><span class="cx"> 
</span><del>-    static RenderPtr<RenderFullScreen> wrapNewRenderer(RenderTreeBuilder&, RenderPtr<RenderElement>, RenderElement& parent, Document&);
</del><ins>+    static RenderPtr<RenderFullScreen> wrapNewRenderer(RenderPtr<RenderElement>, RenderElement& parent, Document&);
</ins><span class="cx">     static void wrapExistingRenderer(RenderElement&, Document&);
</span><span class="cx">     void unwrapRenderer(bool& requiresRenderTreeRebuild);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp    2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp       2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -69,10 +69,10 @@
</span><span class="cx"> 
</span><span class="cx"> RenderGrid::~RenderGrid() = default;
</span><span class="cx"> 
</span><del>-void RenderGrid::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderGrid::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto& child = *newChild;
</span><del>-    RenderBlock::addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+    RenderBlock::addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx"> 
</span><span class="cx">     // Positioned grid items do not take up space or otherwise participate in the layout of the grid,
</span><span class="cx">     // for that reason we don't need to mark the grid as dirty when they are added.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.h      2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderGrid.h 2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     bool isRenderGrid() const override { return true; }
</span><span class="cx">     void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild) final;
</del><ins>+    void addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild) final;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) final;
</span><span class="cx"> 
</span><span class="cx">     StyleSelfAlignmentData selfAlignmentForChild(GridAxis, const RenderBox&, const RenderStyle* = nullptr) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include "RenderListMarker.h"
</span><span class="cx"> #include "RenderTable.h"
</span><span class="cx"> #include "RenderTheme.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="lines">@@ -255,16 +254,16 @@
</span><span class="cx">     return caretRect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderInline::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderInline::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto* beforeChildOrPlaceholder = beforeChild;
</span><span class="cx">     if (auto* fragmentedFlow = enclosingFragmentedFlow())
</span><span class="cx">         beforeChildOrPlaceholder = fragmentedFlow->resolveMovedChild(beforeChild);
</span><span class="cx">     if (continuation()) {
</span><del>-        addChildToContinuation(builder, WTFMove(newChild), beforeChildOrPlaceholder);
</del><ins>+        addChildToContinuation(WTFMove(newChild), beforeChildOrPlaceholder);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChildOrPlaceholder);
</del><ins>+    addChildIgnoringContinuation(WTFMove(newChild), beforeChildOrPlaceholder);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RenderBoxModelObject* nextContinuation(RenderObject* renderer)
</span><span class="lines">@@ -305,7 +304,7 @@
</span><span class="cx">     return newChild.isInline() | (parent.childRequiresTable(newChild) && parent.style().display() == INLINE);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderInline::addChildIgnoringContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderInline::addChildIgnoringContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     // Make sure we don't append things after :after-generated content if we have it.
</span><span class="cx">     if (!beforeChild && isAfterContent(lastChild()))
</span><span class="lines">@@ -333,12 +332,12 @@
</span><span class="cx">             oldContinuation->removeFromContinuationChain();
</span><span class="cx">         newBox->insertIntoContinuationChainAfter(*this);
</span><span class="cx"> 
</span><del>-        splitFlow(builder, beforeChild, WTFMove(newBox), WTFMove(newChild), oldContinuation);
</del><ins>+        splitFlow(beforeChild, WTFMove(newBox), WTFMove(newChild), oldContinuation);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto& child = *newChild;
</span><del>-    RenderBoxModelObject::addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+    RenderBoxModelObject::addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">     child.setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -352,7 +351,7 @@
</span><span class="cx">     return cloneInline;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderInline::splitInlines(RenderTreeBuilder& builder, RenderBlock* fromBlock, RenderBlock* toBlock,
</del><ins>+void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
</ins><span class="cx">                                 RenderBlock* middleBlock,
</span><span class="cx">                                 RenderObject* beforeChild, RenderBoxModelObject* oldCont)
</span><span class="cx"> {
</span><span class="lines">@@ -400,7 +399,7 @@
</span><span class="cx">             // every time, which is a bit wasteful.
</span><span class="cx">         }
</span><span class="cx">         auto childToMove = rendererToMove->parent()->takeChildInternal(*rendererToMove);
</span><del>-        cloneInline->addChildIgnoringContinuation(builder, WTFMove(childToMove));
</del><ins>+        cloneInline->addChildIgnoringContinuation(WTFMove(childToMove));
</ins><span class="cx">         rendererToMove->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">         rendererToMove = nextSibling;
</span><span class="cx">     }
</span><span class="lines">@@ -428,7 +427,7 @@
</span><span class="cx">             cloneInline = downcast<RenderInline>(*current).cloneAsContinuation();
</span><span class="cx"> 
</span><span class="cx">             // Insert our child clone as the first child.
</span><del>-            cloneInline->addChildIgnoringContinuation(builder, WTFMove(cloneChild));
</del><ins>+            cloneInline->addChildIgnoringContinuation(WTFMove(cloneChild));
</ins><span class="cx"> 
</span><span class="cx">             // Hook the clone up as a continuation of |curr|.
</span><span class="cx">             cloneInline->insertIntoContinuationChainAfter(*current);
</span><span class="lines">@@ -438,7 +437,7 @@
</span><span class="cx">             for (auto* sibling = currentChild->nextSibling(); sibling;) {
</span><span class="cx">                 auto* next = sibling->nextSibling();
</span><span class="cx">                 auto childToMove = current->takeChildInternal(*sibling);
</span><del>-                cloneInline->addChildIgnoringContinuation(builder, WTFMove(childToMove));
</del><ins>+                cloneInline->addChildIgnoringContinuation(WTFMove(childToMove));
</ins><span class="cx">                 sibling->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">                 sibling = next;
</span><span class="cx">             }
</span><span class="lines">@@ -467,7 +466,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderInline::splitFlow(RenderTreeBuilder& builder, RenderObject* beforeChild, RenderPtr<RenderBlock> newBlockBox, RenderPtr<RenderObject> newChild, RenderBoxModelObject* oldCont)
</del><ins>+void RenderInline::splitFlow(RenderObject* beforeChild, RenderPtr<RenderBlock> newBlockBox, RenderPtr<RenderObject> newChild, RenderBoxModelObject* oldCont)
</ins><span class="cx"> {
</span><span class="cx">     auto& addedBlockBox = *newBlockBox;
</span><span class="cx">     RenderBlock* pre = nullptr;
</span><span class="lines">@@ -516,7 +515,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    splitInlines(builder, pre, &post, &addedBlockBox, beforeChild, oldCont);
</del><ins>+    splitInlines(pre, &post, &addedBlockBox, beforeChild, oldCont);
</ins><span class="cx"> 
</span><span class="cx">     // We already know the newBlockBox isn't going to contain inline kids, so avoid wasting
</span><span class="cx">     // time in makeChildrenNonInline by just setting this explicitly up front.
</span><span class="lines">@@ -525,7 +524,7 @@
</span><span class="cx">     // We delayed adding the newChild until now so that the |newBlockBox| would be fully
</span><span class="cx">     // connected, thus allowing newChild access to a renderArena should it need
</span><span class="cx">     // to wrap itself in additional boxes (e.g., table construction).
</span><del>-    builder.insertChild(addedBlockBox, WTFMove(newChild));
</del><ins>+    addedBlockBox.addChild(WTFMove(newChild));
</ins><span class="cx"> 
</span><span class="cx">     // Always just do a full layout in order to ensure that line boxes (especially wrappers for images)
</span><span class="cx">     // get deleted properly.  Because objects moves from the pre block into the post block, we want to
</span><span class="lines">@@ -546,7 +545,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderInline::addChildToContinuation(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderInline::addChildToContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto* flow = continuationBefore(beforeChild);
</span><span class="cx">     // It may or may not be the direct parent of the beforeChild.
</span><span class="lines">@@ -571,10 +570,10 @@
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span><span class="cx">     if (newChild->isFloatingOrOutOfFlowPositioned())
</span><del>-        return beforeChildAncestor->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        return beforeChildAncestor->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx"> 
</span><span class="cx">     if (flow == beforeChildAncestor)
</span><del>-        return flow->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        return flow->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx">     // A continuation always consists of two potential candidates: an inline or an anonymous
</span><span class="cx">     // block box holding block children.
</span><span class="cx">     bool childInline = newChildIsInline(*newChild, *this);
</span><span class="lines">@@ -581,10 +580,10 @@
</span><span class="cx">     // The goal here is to match up if we can, so that we can coalesce and create the
</span><span class="cx">     // minimal # of continuations needed for the inline.
</span><span class="cx">     if (childInline == beforeChildAncestor->isInline())
</span><del>-        return beforeChildAncestor->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        return beforeChildAncestor->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx">     if (flow->isInline() == childInline)
</span><del>-        return flow->addChildIgnoringContinuation(builder, WTFMove(newChild)); // Just treat like an append.
-    return beforeChildAncestor->addChildIgnoringContinuation(builder, WTFMove(newChild), beforeChild);
</del><ins>+        return flow->addChildIgnoringContinuation(WTFMove(newChild)); // Just treat like an append.
+    return beforeChildAncestor->addChildIgnoringContinuation(WTFMove(newChild), beforeChild);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderInline::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
</span><span class="lines">@@ -1369,7 +1368,7 @@
</span><span class="cx">     newBox->insertIntoContinuationChainAfter(*this);
</span><span class="cx">     RenderObject* beforeChild = child.nextSibling();
</span><span class="cx">     auto removedChild = takeChildInternal(child);
</span><del>-    splitFlow(*RenderTreeBuilder::current(), beforeChild, WTFMove(newBox), WTFMove(removedChild), oldContinuation);
</del><ins>+    splitFlow(beforeChild, WTFMove(newBox), WTFMove(removedChild), oldContinuation);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderInline::updateHitTestResult(HitTestResult& result, const LayoutPoint& point)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.h    2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderInline.h       2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">     RenderInline(Element&, RenderStyle&&);
</span><span class="cx">     RenderInline(Document&, RenderStyle&&);
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</ins><span class="cx"> 
</span><span class="cx">     LayoutUnit marginLeft() const final;
</span><span class="cx">     LayoutUnit marginRight() const final;
</span><span class="lines">@@ -116,11 +116,11 @@
</span><span class="cx">     template<typename GeneratorContext>
</span><span class="cx">     void generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline* container) const;
</span><span class="cx"> 
</span><del>-    void addChildToContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild);
-    void addChildIgnoringContinuation(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr) final;
</del><ins>+    void addChildToContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild);
+    void addChildIgnoringContinuation(RenderPtr<RenderObject> newChild, RenderObject* beforeChild = nullptr) final;
</ins><span class="cx"> 
</span><del>-    void splitInlines(RenderTreeBuilder&, RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock, RenderObject* beforeChild, RenderBoxModelObject* oldCont);
-    void splitFlow(RenderTreeBuilder&, RenderObject* beforeChild, RenderPtr<RenderBlock> newBlockBox, RenderPtr<RenderObject> newChild, RenderBoxModelObject* oldCont);
</del><ins>+    void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock, RenderObject* beforeChild, RenderBoxModelObject* oldCont);
+    void splitFlow(RenderObject* beforeChild, RenderPtr<RenderBlock> newBlockBox, RenderPtr<RenderObject> newChild, RenderBoxModelObject* oldCont);
</ins><span class="cx"> 
</span><span class="cx">     void layout() final { ASSERT_NOT_REACHED(); } // Do nothing for layout()
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.cpp        2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp   2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include "RenderScrollbar.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderTheme.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "TextRun.h"
</span><span class="lines">@@ -113,7 +112,7 @@
</span><span class="cx">     auto newInnerBlock = createAnonymousBlock();
</span><span class="cx">     m_innerBlock = makeWeakPtr(*newInnerBlock.get());
</span><span class="cx">     adjustInnerStyle();
</span><del>-    RenderFlexibleBox::addChild(*RenderTreeBuilder::current(), WTFMove(newInnerBlock));
</del><ins>+    RenderFlexibleBox::addChild(WTFMove(newInnerBlock));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderMenuList::adjustInnerStyle()
</span><span class="lines">@@ -175,11 +174,11 @@
</span><span class="cx">     return downcast<HTMLSelectElement>(nodeForNonAnonymous());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMenuList::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderMenuList::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     createInnerBlock();
</span><span class="cx">     auto& child = *newChild;
</span><del>-    builder.insertChild(*m_innerBlock, WTFMove(newChild), beforeChild);
</del><ins>+    m_innerBlock->addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">     ASSERT(m_innerBlock == firstChild());
</span><span class="cx"> 
</span><span class="cx">     if (AXObjectCache* cache = document().existingAXObjectCache())
</span><span class="lines">@@ -299,7 +298,7 @@
</span><span class="cx">     else {
</span><span class="cx">         auto newButtonText = createRenderer<RenderText>(document(), textToUse);
</span><span class="cx">         m_buttonText = makeWeakPtr(*newButtonText);
</span><del>-        RenderTreeBuilder::current()->insertChild(*this, WTFMove(newButtonText));
</del><ins>+        addChild(WTFMove(newButtonText));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     adjustInnerStyle();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.h  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderMenuList.h     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isMenuList() const override { return true; }
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) override;
</span><span class="cx">     bool createsAnonymousWrapper() const override { return true; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMultiColumnFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include "RenderIterator.h"
</span><span class="cx"> #include "RenderMultiColumnSet.h"
</span><span class="cx"> #include "RenderMultiColumnSpannerPlaceholder.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "TransformState.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="lines">@@ -293,12 +292,12 @@
</span><span class="cx">         // end flowing one column set and move to the next one.
</span><span class="cx">         auto newPlaceholder = RenderMultiColumnSpannerPlaceholder::createAnonymous(*this, downcast<RenderBox>(descendant), container->style());
</span><span class="cx">         auto& placeholder = *newPlaceholder;
</span><del>-        RenderTreeBuilder::current()->insertChild(*container, WTFMove(newPlaceholder), descendant.nextSibling());
</del><ins>+        container->addChild(WTFMove(newPlaceholder), descendant.nextSibling());
</ins><span class="cx">         auto takenDescendant = container->takeChild(descendant);
</span><span class="cx">         
</span><span class="cx">         // This is a guard to stop an ancestor flow thread from processing the spanner.
</span><span class="cx">         gShiftingSpanner = true;
</span><del>-        multicolContainer->RenderBlock::addChild(*RenderTreeBuilder::current(), WTFMove(takenDescendant), insertBeforeMulticolChild);
</del><ins>+        multicolContainer->RenderBlock::addChild(WTFMove(takenDescendant), insertBeforeMulticolChild);
</ins><span class="cx">         gShiftingSpanner = false;
</span><span class="cx">         
</span><span class="cx">         // The spanner has now been moved out from the flow thread, but we don't want to
</span><span class="lines">@@ -335,7 +334,7 @@
</span><span class="cx">     auto newSet = createRenderer<RenderMultiColumnSet>(*this, RenderStyle::createAnonymousStyleWithDisplay(multicolContainer->style(), BLOCK));
</span><span class="cx">     newSet->initializeStyle();
</span><span class="cx">     auto& set = *newSet;
</span><del>-    multicolContainer->RenderBlock::addChild(*RenderTreeBuilder::current(), WTFMove(newSet), insertBeforeMulticolChild);
</del><ins>+    multicolContainer->RenderBlock::addChild(WTFMove(newSet), insertBeforeMulticolChild);
</ins><span class="cx">     invalidateFragments();
</span><span class="cx"> 
</span><span class="cx">     // We cannot handle immediate column set siblings at the moment (and there's no need for
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderQuotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderQuote.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderQuote.cpp   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderQuote.cpp      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -25,11 +25,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include "QuotesData.h"
</span><span class="cx"> #include "RenderTextFragment.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> using namespace WTF::Unicode;
</span><span class="cx"> 
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">     return downcast<RenderTextFragment>(lastChild);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderQuote::updateTextRenderer(RenderTreeBuilder& builder)
</del><ins>+void RenderQuote::updateTextRenderer()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(document().inRenderTreeUpdate());
</span><span class="cx">     String text = computeText();
</span><span class="lines">@@ -362,7 +362,7 @@
</span><span class="cx">         renderText->dirtyLineBoxes(false);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    builder.insertChild(*this, createRenderer<RenderTextFragment>(document(), m_text));
</del><ins>+    addChild(createRenderer<RenderTextFragment>(document(), m_text));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String RenderQuote::computeText() const
</span><span class="lines">@@ -403,7 +403,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderQuote::updateRenderer(RenderTreeBuilder& builder, RenderQuote* previousQuote)
</del><ins>+void RenderQuote::updateRenderer(RenderQuote* previousQuote)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(document().inRenderTreeUpdate());
</span><span class="cx">     int depth = -1;
</span><span class="lines">@@ -423,7 +423,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_depth = depth;
</span><span class="cx">     m_needsTextUpdate = false;
</span><del>-    updateTextRenderer(builder);
</del><ins>+    updateTextRenderer();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderQuoteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderQuote.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderQuote.h     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderQuote.h        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     RenderQuote(Document&, RenderStyle&&, QuoteType);
</span><span class="cx">     virtual ~RenderQuote();
</span><span class="cx"> 
</span><del>-    void updateRenderer(RenderTreeBuilder&, RenderQuote* previousQuote);
</del><ins>+    void updateRenderer(RenderQuote* previousQuote);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const char* renderName() const override { return "RenderQuote"; }
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     void willBeRemovedFromTree() override;
</span><span class="cx"> 
</span><span class="cx">     String computeText() const;
</span><del>-    void updateTextRenderer(RenderTreeBuilder&);
</del><ins>+    void updateTextRenderer();
</ins><span class="cx"> 
</span><span class="cx">     const QuoteType m_type;
</span><span class="cx">     int m_depth { -1 };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRuby.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRuby.cpp    2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderRuby.cpp       2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include "RenderIterator.h"
</span><span class="cx"> #include "RenderRubyRun.h"
</span><span class="cx"> #include "RenderStyle.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="lines">@@ -140,13 +139,13 @@
</span><span class="cx">     propagateStyleToAnonymousChildren(PropagateToAllChildren);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderRubyAsInline::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> child, RenderObject* beforeChild)
</del><ins>+void RenderRubyAsInline::addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     // Insert :before and :after content before/after the RenderRubyRun(s)
</span><span class="cx">     if (child->isBeforeContent()) {
</span><span class="cx">         if (child->isInline()) {
</span><span class="cx">             // Add generated inline content normally
</span><del>-            RenderInline::addChild(builder, WTFMove(child), firstChild());
</del><ins>+            RenderInline::addChild(WTFMove(child), firstChild());
</ins><span class="cx">         } else {
</span><span class="cx">             // Wrap non-inline content with an anonymous inline-block.
</span><span class="cx">             RenderBlock* beforeBlock = rubyBeforeBlock(this);
</span><span class="lines">@@ -153,9 +152,9 @@
</span><span class="cx">             if (!beforeBlock) {
</span><span class="cx">                 auto newBlock = createAnonymousRubyInlineBlock(*this);
</span><span class="cx">                 beforeBlock = newBlock.get();
</span><del>-                RenderInline::addChild(builder, WTFMove(newBlock), firstChild());
</del><ins>+                RenderInline::addChild(WTFMove(newBlock), firstChild());
</ins><span class="cx">             }
</span><del>-            builder.insertChild(*beforeBlock, WTFMove(child));
</del><ins>+            beforeBlock->addChild(WTFMove(child));
</ins><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -162,7 +161,7 @@
</span><span class="cx">     if (child->isAfterContent()) {
</span><span class="cx">         if (child->isInline()) {
</span><span class="cx">             // Add generated inline content normally
</span><del>-            RenderInline::addChild(builder, WTFMove(child));
</del><ins>+            RenderInline::addChild(WTFMove(child));
</ins><span class="cx">         } else {
</span><span class="cx">             // Wrap non-inline content with an anonymous inline-block.
</span><span class="cx">             RenderBlock* afterBlock = rubyAfterBlock(this);
</span><span class="lines">@@ -169,9 +168,9 @@
</span><span class="cx">             if (!afterBlock) {
</span><span class="cx">                 auto newBlock = createAnonymousRubyInlineBlock(*this);
</span><span class="cx">                 afterBlock = newBlock.get();
</span><del>-                RenderInline::addChild(builder, WTFMove(newBlock));
</del><ins>+                RenderInline::addChild(WTFMove(newBlock));
</ins><span class="cx">             }
</span><del>-            builder.insertChild(*afterBlock, WTFMove(child));
</del><ins>+            afterBlock->addChild(WTFMove(child));
</ins><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -178,7 +177,7 @@
</span><span class="cx"> 
</span><span class="cx">     // If the child is a ruby run, just add it normally.
</span><span class="cx">     if (child->isRubyRun()) {
</span><del>-        RenderInline::addChild(builder, WTFMove(child), beforeChild);
</del><ins>+        RenderInline::addChild(WTFMove(child), beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -189,7 +188,7 @@
</span><span class="cx">         while (run && !run->isRubyRun())
</span><span class="cx">             run = run->parent();
</span><span class="cx">         if (run) {
</span><del>-            builder.insertChild(*run, WTFMove(child), beforeChild);
</del><ins>+            run->addChild(WTFMove(child), beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         ASSERT_NOT_REACHED(); // beforeChild should always have a run as parent!
</span><span class="lines">@@ -203,9 +202,9 @@
</span><span class="cx">     if (!lastRun || lastRun->hasRubyText()) {
</span><span class="cx">         auto newRun = RenderRubyRun::staticCreateRubyRun(this);
</span><span class="cx">         lastRun = newRun.get();
</span><del>-        RenderInline::addChild(builder, WTFMove(newRun), beforeChild);
</del><ins>+        RenderInline::addChild(WTFMove(newRun), beforeChild);
</ins><span class="cx">     }
</span><del>-    builder.insertChild(*lastRun, WTFMove(child));
</del><ins>+    lastRun->addChild(WTFMove(child));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr<RenderObject> RenderRubyAsInline::takeChild(RenderObject& child)
</span><span class="lines">@@ -247,13 +246,13 @@
</span><span class="cx">     propagateStyleToAnonymousChildren(PropagateToAllChildren);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderRubyAsBlock::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> child, RenderObject* beforeChild)
</del><ins>+void RenderRubyAsBlock::addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     // Insert :before and :after content before/after the RenderRubyRun(s)
</span><span class="cx">     if (child->isBeforeContent()) {
</span><span class="cx">         if (child->isInline()) {
</span><span class="cx">             // Add generated inline content normally
</span><del>-            RenderBlockFlow::addChild(builder, WTFMove(child), firstChild());
</del><ins>+            RenderBlockFlow::addChild(WTFMove(child), firstChild());
</ins><span class="cx">         } else {
</span><span class="cx">             // Wrap non-inline content with an anonymous inline-block.
</span><span class="cx">             RenderBlock* beforeBlock = rubyBeforeBlock(this);
</span><span class="lines">@@ -260,9 +259,9 @@
</span><span class="cx">             if (!beforeBlock) {
</span><span class="cx">                 auto newBlock = createAnonymousRubyInlineBlock(*this);
</span><span class="cx">                 beforeBlock = newBlock.get();
</span><del>-                RenderBlockFlow::addChild(builder, WTFMove(newBlock), firstChild());
</del><ins>+                RenderBlockFlow::addChild(WTFMove(newBlock), firstChild());
</ins><span class="cx">             }
</span><del>-            builder.insertChild(*beforeBlock, WTFMove(child));
</del><ins>+            beforeBlock->addChild(WTFMove(child));
</ins><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -269,7 +268,7 @@
</span><span class="cx">     if (child->isAfterContent()) {
</span><span class="cx">         if (child->isInline()) {
</span><span class="cx">             // Add generated inline content normally
</span><del>-            RenderBlockFlow::addChild(builder, WTFMove(child));
</del><ins>+            RenderBlockFlow::addChild(WTFMove(child));
</ins><span class="cx">         } else {
</span><span class="cx">             // Wrap non-inline content with an anonymous inline-block.
</span><span class="cx">             RenderBlock* afterBlock = rubyAfterBlock(this);
</span><span class="lines">@@ -276,9 +275,9 @@
</span><span class="cx">             if (!afterBlock) {
</span><span class="cx">                 auto newBlock = createAnonymousRubyInlineBlock(*this);
</span><span class="cx">                 afterBlock = newBlock.get();
</span><del>-                RenderBlockFlow::addChild(builder, WTFMove(newBlock));
</del><ins>+                RenderBlockFlow::addChild(WTFMove(newBlock));
</ins><span class="cx">             }
</span><del>-            builder.insertChild(*afterBlock, WTFMove(child));
</del><ins>+            afterBlock->addChild(WTFMove(child));
</ins><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -285,7 +284,7 @@
</span><span class="cx"> 
</span><span class="cx">     // If the child is a ruby run, just add it normally.
</span><span class="cx">     if (child->isRubyRun()) {
</span><del>-        RenderBlockFlow::addChild(builder, WTFMove(child), beforeChild);
</del><ins>+        RenderBlockFlow::addChild(WTFMove(child), beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -296,7 +295,7 @@
</span><span class="cx">         while (run && !run->isRubyRun())
</span><span class="cx">             run = run->parent();
</span><span class="cx">         if (run) {
</span><del>-            builder.insertChild(*run, WTFMove(child), beforeChild);
</del><ins>+            run->addChild(WTFMove(child), beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         ASSERT_NOT_REACHED(); // beforeChild should always have a run as parent!
</span><span class="lines">@@ -310,9 +309,9 @@
</span><span class="cx">     if (!lastRun || lastRun->hasRubyText()) {
</span><span class="cx">         auto newRun = RenderRubyRun::staticCreateRubyRun(this);
</span><span class="cx">         lastRun = newRun.get();
</span><del>-        RenderBlockFlow::addChild(builder, WTFMove(newRun), beforeChild);
</del><ins>+        RenderBlockFlow::addChild(WTFMove(newRun), beforeChild);
</ins><span class="cx">     }
</span><del>-    builder.insertChild(*lastRun, WTFMove(child));
</del><ins>+    lastRun->addChild(WTFMove(child));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr<RenderObject> RenderRubyAsBlock::takeChild(RenderObject& child)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRuby.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRuby.h      2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderRuby.h 2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     RenderRubyAsInline(Element&, RenderStyle&&);
</span><span class="cx">     virtual ~RenderRubyAsInline();
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject& child) override;
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx">     Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject& child) override;
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyBase.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyBase.h  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderRubyBase.h     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -59,8 +59,6 @@
</span><span class="cx">     
</span><span class="cx">     void cachePriorCharactersIfNeeded(const LazyLineBreakIterator&) override;
</span><span class="cx"> 
</span><del>-    void moveChildren(RenderRubyBase* toBase, RenderObject* beforeChild = 0);
-
</del><span class="cx"> private:
</span><span class="cx">     bool isRubyBase() const override { return true; }
</span><span class="cx">     bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
</span><span class="lines">@@ -68,6 +66,7 @@
</span><span class="cx">     void adjustInlineDirectionLineBounds(int expansionOpportunityCount, float& logicalLeft, float& logicalWidth) const override;
</span><span class="cx">     void mergeChildrenWithBase(RenderRubyBase& toBlock);
</span><span class="cx"> 
</span><ins>+    void moveChildren(RenderRubyBase* toBase, RenderObject* beforeChild = 0);
</ins><span class="cx">     void moveInlineChildren(RenderRubyBase* toBase, RenderObject* beforeChild = 0);
</span><span class="cx">     void moveBlockChildren(RenderRubyBase* toBase, RenderObject* beforeChild = 0);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyRuncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyRun.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyRun.cpp 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.cpp    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     if (!base) {
</span><span class="cx">         auto newBase = createRubyBase();
</span><span class="cx">         base = newBase.get();
</span><del>-        RenderBlockFlow::addChild(*RenderTreeBuilder::current(), WTFMove(newBase));
</del><ins>+        RenderBlockFlow::addChild(WTFMove(newBase));
</ins><span class="cx">     }
</span><span class="cx">     return base;
</span><span class="cx"> }
</span><span class="lines">@@ -108,6 +108,51 @@
</span><span class="cx">     return child.isInline() || child.isRubyText();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderRubyRun::addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild)
+{
+    ASSERT(child);
+
+    if (child->isRubyText()) {
+        if (!beforeChild) {
+            // RenderRuby has already ascertained that we can add the child here.
+            ASSERT(!hasRubyText());
+            // prepend ruby texts as first child
+            RenderBlockFlow::addChild(WTFMove(child), firstChild());
+        }  else if (beforeChild->isRubyText()) {
+            // New text is inserted just before another.
+            // In this case the new text takes the place of the old one, and
+            // the old text goes into a new run that is inserted as next sibling.
+            ASSERT(beforeChild->parent() == this);
+            RenderElement* ruby = parent();
+            ASSERT(isRuby(ruby));
+            auto newRun = staticCreateRubyRun(ruby);
+            ruby->addChild(WTFMove(newRun), nextSibling());
+            // Add the new ruby text and move the old one to the new run
+            // Note: Doing it in this order and not using RenderRubyRun's methods,
+            // in order to avoid automatic removal of the ruby run in case there is no
+            // other child besides the old ruby text.
+            RenderBlockFlow::addChild(WTFMove(child), beforeChild);
+            auto takenBeforeChild = RenderBlockFlow::takeChild(*beforeChild);
+            newRun->addChild(WTFMove(takenBeforeChild));
+        } else if (hasRubyBase()) {
+            // Insertion before a ruby base object.
+            // In this case we need insert a new run before the current one and split the base.
+            RenderElement* ruby = parent();
+            auto newRun = staticCreateRubyRun(ruby);
+            auto& run = *newRun;
+            ruby->addChild(WTFMove(newRun), this);
+            run.addChild(WTFMove(child));
+            rubyBaseSafe()->moveChildren(run.rubyBaseSafe(), beforeChild);
+        }
+    } else {
+        // child is not a text -> insert it into the base
+        // (append it instead if beforeChild is the ruby text)
+        if (beforeChild && beforeChild->isRubyText())
+            beforeChild = 0;
+        rubyBaseSafe()->addChild(WTFMove(child), beforeChild);
+    }
+}
+
</ins><span class="cx"> RenderPtr<RenderObject> RenderRubyRun::takeChild(RenderObject& child)
</span><span class="cx"> {
</span><span class="cx">     // If the child is a ruby text, then merge the ruby base with the base of
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyRunh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyRun.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyRun.h   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.h      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">     void layoutBlock(bool relayoutChildren, LayoutUnit pageHeight = 0) override;
</span><span class="cx"> 
</span><span class="cx">     bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
</span><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) override;
</span><span class="cx"> 
</span><span class="cx">     RenderBlock* firstLineBlock() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTable.cpp   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> #include "RenderTableCell.h"
</span><span class="cx"> #include "RenderTableCol.h"
</span><span class="cx"> #include "RenderTableSection.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="lines">@@ -133,7 +132,7 @@
</span><span class="cx">         section.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTable::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> child, RenderObject* beforeChild)
</del><ins>+void RenderTable::addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     bool wrapInAnonymousSection = !child->isOutOfFlowPositioned();
</span><span class="cx"> 
</span><span class="lines">@@ -184,12 +183,12 @@
</span><span class="cx">         if (beforeChild && beforeChild->parent() != this)
</span><span class="cx">             beforeChild = splitAnonymousBoxesAroundChild(beforeChild);
</span><span class="cx"> 
</span><del>-        RenderBox::addChild(builder, WTFMove(child), beforeChild);
</del><ins>+        RenderBox::addChild(WTFMove(child), beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!beforeChild && is<RenderTableSection>(lastChild()) && lastChild()->isAnonymous() && !lastChild()->isBeforeContent()) {
</span><del>-        builder.insertChild(downcast<RenderTableSection>(*lastChild()), WTFMove(child));
</del><ins>+        downcast<RenderTableSection>(*lastChild()).addChild(WTFMove(child));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -196,7 +195,7 @@
</span><span class="cx">     if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
</span><span class="cx">         RenderObject* section = beforeChild->previousSibling();
</span><span class="cx">         if (is<RenderTableSection>(section) && section->isAnonymous()) {
</span><del>-            builder.insertChild(downcast<RenderTableSection>(*section), WTFMove(child));
</del><ins>+            downcast<RenderTableSection>(*section).addChild(WTFMove(child));
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -208,7 +207,7 @@
</span><span class="cx">         RenderTableSection& section = downcast<RenderTableSection>(*lastBox);
</span><span class="cx">         if (beforeChild == &section)
</span><span class="cx">             beforeChild = section.firstRow();
</span><del>-        builder.insertChild(section, WTFMove(child), beforeChild);
</del><ins>+        section.addChild(WTFMove(child), beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -217,8 +216,8 @@
</span><span class="cx"> 
</span><span class="cx">     auto newSection = RenderTableSection::createAnonymousWithParentRenderer(*this);
</span><span class="cx">     auto& section = *newSection;
</span><del>-    builder.insertChild(*this, WTFMove(newSection), beforeChild);
-    builder.insertChild(section, WTFMove(child));
</del><ins>+    addChild(WTFMove(newSection), beforeChild);
+    section.addChild(WTFMove(child));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderTable::addCaption(RenderTableCaption& caption)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTable.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTable.h     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTable.h        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">     LayoutUnit calcBorderEnd() const;
</span><span class="cx">     void recalcBordersInRowDirection();
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) final;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) final;
</ins><span class="cx"> 
</span><span class="cx">     struct ColumnStruct {
</span><span class="cx">         explicit ColumnStruct(unsigned initialSpan = 1)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableRow.cpp        2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp   2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include "LayoutState.h"
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "RenderTableCell.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="lines">@@ -111,7 +110,7 @@
</span><span class="cx">     return style().borderEnd();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTableRow::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> child, RenderObject* beforeChild)
</del><ins>+void RenderTableRow::addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     if (!is<RenderTableCell>(*child)) {
</span><span class="cx">         RenderObject* last = beforeChild;
</span><span class="lines">@@ -121,7 +120,7 @@
</span><span class="cx">             RenderTableCell& cell = downcast<RenderTableCell>(*last);
</span><span class="cx">             if (beforeChild == &cell)
</span><span class="cx">                 beforeChild = cell.firstChild();
</span><del>-            builder.insertChild(cell, WTFMove(child), beforeChild);
</del><ins>+            cell.addChild(WTFMove(child), beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -128,7 +127,7 @@
</span><span class="cx">         if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
</span><span class="cx">             RenderObject* cell = beforeChild->previousSibling();
</span><span class="cx">             if (is<RenderTableCell>(cell) && cell->isAnonymous()) {
</span><del>-                builder.insertChild(downcast<RenderTableCell>(*cell), WTFMove(child));
</del><ins>+                downcast<RenderTableCell>(*cell).addChild(WTFMove(child));
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -137,7 +136,7 @@
</span><span class="cx">         if (last && last->parent() && last->parent()->isAnonymous() && !last->parent()->isBeforeOrAfterContent()) {
</span><span class="cx">             // If beforeChild is inside an anonymous cell, insert into the cell.
</span><span class="cx">             if (!is<RenderTableCell>(*last)) {
</span><del>-                builder.insertChild(*last->parent(), WTFMove(child), beforeChild);
</del><ins>+                last->parent()->addChild(WTFMove(child), beforeChild);
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">             // If beforeChild is inside an anonymous row, insert into the row.
</span><span class="lines">@@ -145,15 +144,15 @@
</span><span class="cx">             if (is<RenderTableRow>(parent)) {
</span><span class="cx">                 auto newCell = RenderTableCell::createAnonymousWithParentRenderer(*this);
</span><span class="cx">                 auto& cell = *newCell;
</span><del>-                builder.insertChild(parent, WTFMove(newCell), beforeChild);
-                builder.insertChild(cell, WTFMove(child));
</del><ins>+                parent.addChild(WTFMove(newCell), beforeChild);
+                cell.addChild(WTFMove(child));
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         auto newCell = RenderTableCell::createAnonymousWithParentRenderer(*this);
</span><span class="cx">         auto& cell = *newCell;
</span><del>-        builder.insertChild(*this, WTFMove(newCell), beforeChild);
-        builder.insertChild(cell, WTFMove(child));
</del><ins>+        addChild(WTFMove(newCell), beforeChild);
+        cell.addChild(WTFMove(child));
</ins><span class="cx">         return;
</span><span class="cx">     } 
</span><span class="cx"> 
</span><span class="lines">@@ -167,7 +166,7 @@
</span><span class="cx">         section->addCell(&cell, this);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!beforeChild || is<RenderTableCell>(*beforeChild));
</span><del>-    RenderBox::addChild(builder, WTFMove(child), beforeChild);
</del><ins>+    RenderBox::addChild(WTFMove(child), beforeChild);
</ins><span class="cx"> 
</span><span class="cx">     if (beforeChild || nextRow())
</span><span class="cx">         section()->setNeedsCellRecalc();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableRowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableRow.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableRow.h  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTableRow.h     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     const BorderValue& borderAdjoiningStartCell(const RenderTableCell&) const;
</span><span class="cx">     const BorderValue& borderAdjoiningEndCell(const RenderTableCell&) const;
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</ins><span class="cx"> 
</span><span class="cx">     bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableSectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableSection.cpp    2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp       2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include "RenderTableCol.h"
</span><span class="cx"> #include "RenderTableRow.h"
</span><span class="cx"> #include "RenderTextControl.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include <limits>
</span><span class="lines">@@ -121,7 +120,7 @@
</span><span class="cx">     setNeedsCellRecalc();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTableSection::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> child, RenderObject* beforeChild)
</del><ins>+void RenderTableSection::addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     if (!is<RenderTableRow>(*child)) {
</span><span class="cx">         RenderObject* last = beforeChild;
</span><span class="lines">@@ -131,7 +130,7 @@
</span><span class="cx">             RenderTableRow& row = downcast<RenderTableRow>(*last);
</span><span class="cx">             if (beforeChild == &row)
</span><span class="cx">                 beforeChild = row.firstCell();
</span><del>-            builder.insertChild(row, WTFMove(child), beforeChild);
</del><ins>+            row.addChild(WTFMove(child), beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -138,7 +137,7 @@
</span><span class="cx">         if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
</span><span class="cx">             RenderObject* row = beforeChild->previousSibling();
</span><span class="cx">             if (is<RenderTableRow>(row) && row->isAnonymous()) {
</span><del>-                builder.insertChild(downcast<RenderTableRow>(*row), WTFMove(child));
</del><ins>+                downcast<RenderTableRow>(*row).addChild(WTFMove(child));
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -149,14 +148,14 @@
</span><span class="cx">         while (lastBox && lastBox->parent()->isAnonymous() && !is<RenderTableRow>(*lastBox))
</span><span class="cx">             lastBox = lastBox->parent();
</span><span class="cx">         if (is<RenderTableRow>(lastBox) && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterContent()) {
</span><del>-            builder.insertChild(downcast<RenderTableRow>(*lastBox), WTFMove(child), beforeChild);
</del><ins>+            downcast<RenderTableRow>(*lastBox).addChild(WTFMove(child), beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         auto newRow = RenderTableRow::createAnonymousWithParentRenderer(*this);
</span><span class="cx">         auto& row = *newRow;
</span><del>-        builder.insertChild(*this, WTFMove(newRow), beforeChild);
-        builder.insertChild(row, WTFMove(child));
</del><ins>+        addChild(WTFMove(newRow), beforeChild);
+        row.addChild(WTFMove(child));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -180,7 +179,7 @@
</span><span class="cx">         beforeChild = splitAnonymousBoxesAroundChild(beforeChild);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!beforeChild || is<RenderTableRow>(*beforeChild));
</span><del>-    RenderBox::addChild(builder, WTFMove(child), beforeChild);
</del><ins>+    RenderBox::addChild(WTFMove(child), beforeChild);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderTableSection::ensureRows(unsigned numRows)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableSectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableSection.h      2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h 2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     RenderTableRow* firstRow() const;
</span><span class="cx">     RenderTableRow* lastRow() const;
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</ins><span class="cx"> 
</span><span class="cx">     std::optional<int> firstLineBaseline() const override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeBuildercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/RenderTreeBuilder.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeBuilder.cpp     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTreeBuilder.cpp        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -1,121 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "RenderTreeBuilder.h"
-
-#include "RenderElement.h"
-#include "RenderRuby.h"
-#include "RenderRubyBase.h"
-#include "RenderRubyRun.h"
-#include "RenderText.h"
-#include "RenderTreeUpdater.h"
-
-namespace WebCore {
-
-RenderTreeBuilder* RenderTreeBuilder::m_current;
-
-RenderTreeBuilder::RenderTreeBuilder()
-{
-    RELEASE_ASSERT(!m_current);
-    m_current = this;
-}
-
-RenderTreeBuilder::~RenderTreeBuilder()
-{
-    m_current = nullptr;
-}
-
-void RenderTreeBuilder::insertChild(RenderElement& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
-    // We don't yet have any local access, ensure we are still called with non-null this ptr.
-    ASSERT(this);
-
-    if (is<RenderText>(beforeChild)) {
-        if (auto* wrapperInline = downcast<RenderText>(*beforeChild).inlineWrapperForDisplayContents())
-            beforeChild = wrapperInline;
-    }
-
-    if (is<RenderRubyRun>(parent)) {
-        rubyRunInsertChild(downcast<RenderRubyRun>(parent), WTFMove(child), beforeChild);
-        return;
-    }
-
-    parent.addChild(*this, WTFMove(child), beforeChild);
-}
-
-void RenderTreeBuilder::insertChild(RenderTreePosition& position, RenderPtr<RenderObject> child)
-{
-    insertChild(position.parent(), WTFMove(child), position.nextSibling());
-}
-
-void RenderTreeBuilder::rubyRunInsertChild(RenderRubyRun& parent, RenderPtr<RenderObject> child, RenderObject* beforeChild)
-{
-    if (child->isRubyText()) {
-        if (!beforeChild) {
-            // RenderRuby has already ascertained that we can add the child here.
-            ASSERT(!parent.hasRubyText());
-            // prepend ruby texts as first child
-            parent.addChild(*this, WTFMove(child), parent.firstChild());
-            return;
-        }
-        if (beforeChild->isRubyText()) {
-            // New text is inserted just before another.
-            // In this case the new text takes the place of the old one, and
-            // the old text goes into a new run that is inserted as next sibling.
-            ASSERT(beforeChild->parent() == &parent);
-            RenderElement* ruby = parent.parent();
-            ASSERT(isRuby(ruby));
-            auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
-            insertChild(*ruby, WTFMove(newRun), parent.nextSibling());
-            // Add the new ruby text and move the old one to the new run
-            // Note: Doing it in this order and not using RenderRubyRun's methods,
-            // in order to avoid automatic removal of the ruby run in case there is no
-            // other child besides the old ruby text.
-            parent.addChild(*this, WTFMove(child), beforeChild);
-            auto takenBeforeChild = parent.RenderBlockFlow::takeChild(*beforeChild);
-            insertChild(*newRun, WTFMove(takenBeforeChild));
-            return;
-        }
-        if (parent.hasRubyBase()) {
-            // Insertion before a ruby base object.
-            // In this case we need insert a new run before the current one and split the base.
-            RenderElement* ruby = parent.parent();
-            auto newRun = RenderRubyRun::staticCreateRubyRun(ruby);
-            auto& run = *newRun;
-            insertChild(*ruby, WTFMove(newRun), &parent);
-            insertChild(run, WTFMove(child));
-            parent.rubyBaseSafe()->moveChildren(run.rubyBaseSafe(), beforeChild);
-        }
-        return;
-    }
-    // child is not a text -> insert it into the base
-    // (append it instead if beforeChild is the ruby text)
-    if (beforeChild && beforeChild->isRubyText())
-        beforeChild = nullptr;
-    insertChild(*parent.rubyBaseSafe(), WTFMove(child), beforeChild);
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeBuilderh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/rendering/RenderTreeBuilder.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeBuilder.h       2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/RenderTreeBuilder.h  2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "RenderTreePosition.h"
-
-namespace WebCore {
-
-class RenderRubyRun;
-class RenderTreeUpdater;
-
-class RenderTreeBuilder {
-public:
-    RenderTreeBuilder();
-    ~RenderTreeBuilder();
-
-    void insertChild(RenderElement& parent, RenderPtr<RenderObject>, RenderObject* beforeChild = nullptr);
-    void insertChild(RenderTreePosition&, RenderPtr<RenderObject>);
-
-    // This avoids having to convert all sites that need RenderTreeBuilder in one go.
-    // FIXME: Remove.
-    static RenderTreeBuilder* current() { return m_current; }
-
-private:
-    void rubyRunInsertChild(RenderRubyRun&, RenderPtr<RenderObject> child, RenderObject* beforeChild);
-
-    static RenderTreeBuilder* m_current;
-};
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutoSizingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutoSizing.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutoSizing.cpp        2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/TextAutoSizing.cpp   2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include "RenderListMarker.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderTextFragment.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderTreeUpdaterFirstLetter.h"
</span><span class="cx"> #include "RenderTreeUpdaterListItem.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="lines">@@ -99,9 +98,6 @@
</span><span class="cx"> 
</span><span class="cx">     float averageSize = std::round(cumulativeSize / m_autoSizedNodes.size());
</span><span class="cx"> 
</span><del>-    // FIXME: Figure out how to make this code use RenderTreeUpdater/Builder properly.
-    RenderTreeBuilder builder;
-
</del><span class="cx">     // Adjust sizes.
</span><span class="cx">     bool firstPass = true;
</span><span class="cx">     for (auto& node : m_autoSizedNodes) {
</span><span class="lines">@@ -163,7 +159,7 @@
</span><span class="cx">         parentRenderer->setStyle(WTFMove(newParentStyle));
</span><span class="cx"> 
</span><span class="cx">         if (is<RenderListItem>(*parentRenderer))
</span><del>-            RenderTreeUpdater::ListItem::updateMarker(builder, downcast<RenderListItem>(*parentRenderer));
</del><ins>+            RenderTreeUpdater::ListItem::updateMarker(downcast<RenderListItem>(*parentRenderer));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto& node : m_autoSizedNodes) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLFencedcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -76,7 +76,9 @@
</span><span class="cx">         m_separators = StringImpl::create(",");
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (firstChild()) {
</del><ins>+    if (!firstChild())
+        makeFences();
+    else {
</ins><span class="cx">         // FIXME: The mfenced element fails to update dynamically when its open, close and separators attributes are changed (https://bugs.webkit.org/show_bug.cgi?id=57696).
</span><span class="cx">         if (is<RenderMathMLFencedOperator>(*firstChild()))
</span><span class="cx">             downcast<RenderMathMLFencedOperator>(*firstChild()).updateOperatorContent(m_open);
</span><span class="lines">@@ -91,23 +93,21 @@
</span><span class="cx">     return newOperator;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLFenced::makeFences(RenderTreeBuilder& builder)
</del><ins>+void RenderMathMLFenced::makeFences()
</ins><span class="cx"> {
</span><span class="cx">     auto openFence = createMathMLOperator(m_open, MathMLOperatorDictionary::Prefix, MathMLOperatorDictionary::Fence);
</span><del>-    RenderMathMLRow::addChild(builder, WTFMove(openFence), firstChild());
</del><ins>+    RenderMathMLRow::addChild(WTFMove(openFence), firstChild());
</ins><span class="cx"> 
</span><span class="cx">     auto closeFence = createMathMLOperator(m_close, MathMLOperatorDictionary::Postfix, MathMLOperatorDictionary::Fence);
</span><span class="cx">     m_closeFenceRenderer = makeWeakPtr(*closeFence);
</span><del>-    RenderMathMLRow::addChild(builder, WTFMove(closeFence));
</del><ins>+    RenderMathMLRow::addChild(WTFMove(closeFence));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderMathMLFenced::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> child, RenderObject* beforeChild)
</del><ins>+void RenderMathMLFenced::addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     // make the fences if the render object is empty
</span><del>-    if (!firstChild()) {
</del><ins>+    if (!firstChild())
</ins><span class="cx">         updateFromElement();
</span><del>-        makeFences(builder);
-    }
</del><span class="cx"> 
</span><span class="cx">     // FIXME: Adding or removing a child should possibly cause all later separators to shift places if they're different, as later child positions change by +1 or -1. This should also handle surrogate pairs. See https://bugs.webkit.org/show_bug.cgi?id=125938.
</span><span class="cx"> 
</span><span class="lines">@@ -133,22 +133,22 @@
</span><span class="cx">             else
</span><span class="cx">                 separator = (*m_separators.get())[count - 1];
</span><span class="cx"> 
</span><del>-            StringBuilder stringBuilder;
-            stringBuilder.append(separator);
-            separatorRenderer = createMathMLOperator(stringBuilder.toString(), MathMLOperatorDictionary::Infix, MathMLOperatorDictionary::Separator);
</del><ins>+            StringBuilder builder;
+            builder.append(separator);
+            separatorRenderer = createMathMLOperator(builder.toString(), MathMLOperatorDictionary::Infix, MathMLOperatorDictionary::Separator);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (beforeChild) {
</span><span class="cx">         // Adding |x| before an existing |y| e.g. in element (y) - first insert our new child |x|, then its separator, to get (x, y).
</span><del>-        RenderMathMLRow::addChild(builder, WTFMove(child), beforeChild);
</del><ins>+        RenderMathMLRow::addChild(WTFMove(child), beforeChild);
</ins><span class="cx">         if (separatorRenderer)
</span><del>-            RenderMathMLRow::addChild(builder, WTFMove(separatorRenderer), beforeChild);
</del><ins>+            RenderMathMLRow::addChild(WTFMove(separatorRenderer), beforeChild);
</ins><span class="cx">     } else {
</span><span class="cx">         // Adding |y| at the end of an existing element e.g. (x) - insert the separator first before the closing fence, then |y|, to get (x, y).
</span><span class="cx">         if (separatorRenderer)
</span><del>-            RenderMathMLRow::addChild(builder, WTFMove(separatorRenderer), m_closeFenceRenderer.get());
-        RenderMathMLRow::addChild(builder, WTFMove(child), m_closeFenceRenderer.get());
</del><ins>+            RenderMathMLRow::addChild(WTFMove(separatorRenderer), m_closeFenceRenderer.get());
+        RenderMathMLRow::addChild(WTFMove(child), m_closeFenceRenderer.get());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLFencedh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h       2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h  2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -42,11 +42,11 @@
</span><span class="cx"> private:
</span><span class="cx">     bool isRenderMathMLFenced() const final { return true; }
</span><span class="cx">     const char* renderName() const final { return "RenderMathMLFenced"; }
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild) final;
-    void updateFromElement();
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild) final;
+    void updateFromElement() final;
</ins><span class="cx"> 
</span><span class="cx">     RenderPtr<RenderMathMLFencedOperator> createMathMLOperator(const String& operatorString, MathMLOperatorDictionary::Form, MathMLOperatorDictionary::Flag);
</span><del>-    void makeFences(RenderTreeBuilder&);
</del><ins>+    void makeFences();
</ins><span class="cx"> 
</span><span class="cx">     String m_open;
</span><span class="cx">     String m_close;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGContainercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp        2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp   2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -89,10 +89,10 @@
</span><span class="cx">     clearNeedsLayout();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderSVGContainer::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderSVGContainer::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto& child = *newChild;
</span><del>-    RenderSVGModelObject::addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+    RenderSVGModelObject::addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">     SVGResourcesCache::clientWasAddedToTree(child);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGContainerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx">     void layout() override;
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) final;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) final;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) final;
</span><span class="cx">     void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -123,10 +123,10 @@
</span><span class="cx">     setInline(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderSVGInline::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderSVGInline::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto& child = *newChild;
</span><del>-    RenderInline::addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+    RenderInline::addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">     SVGResourcesCache::clientWasAddedToTree(child);
</span><span class="cx"> 
</span><span class="cx">     if (auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(*this))
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGInlineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInline.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGInline.h     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInline.h        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     void willBeDestroyed() final;
</span><span class="cx">     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
</span><span class="cx"> 
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr) final;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr) final;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) final;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -302,10 +302,10 @@
</span><span class="cx">     SVGResourcesCache::clientStyleChanged(*this, diff, style());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderSVGRoot::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderSVGRoot::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto& child = *newChild;
</span><del>-    RenderReplaced::addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+    RenderReplaced::addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx">     SVGResourcesCache::clientWasAddedToTree(child);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h       2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h  2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">     void willBeRemovedFromTree() override;
</span><span class="cx"> 
</span><span class="cx">     void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = 0) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) override;
</span><span class="cx"> 
</span><span class="cx">     const AffineTransform& localToParentTransform() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp     2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -520,10 +520,10 @@
</span><span class="cx">     return repaintRect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderSVGText::addChild(RenderTreeBuilder& builder, RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</del><ins>+void RenderSVGText::addChild(RenderPtr<RenderObject> newChild, RenderObject* beforeChild)
</ins><span class="cx"> {
</span><span class="cx">     auto& child = *newChild;
</span><del>-    RenderSVGBlock::addChild(builder, WTFMove(newChild), beforeChild);
</del><ins>+    RenderSVGBlock::addChild(WTFMove(newChild), beforeChild);
</ins><span class="cx"> 
</span><span class="cx">     SVGResourcesCache::clientWasAddedToTree(child);
</span><span class="cx">     subtreeChildWasAdded(&child);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGText.h       2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.h  2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> 
</span><span class="cx">     void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override;
</span><span class="cx">     const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
</span><del>-    void addChild(RenderTreeBuilder&, RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr) override;
</del><ins>+    void addChild(RenderPtr<RenderObject> child, RenderObject* beforeChild = nullptr) override;
</ins><span class="cx">     RenderPtr<RenderObject> takeChild(RenderObject&) override;
</span><span class="cx">     void willBeDestroyed() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreePositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreePosition.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreePosition.cpp        2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreePosition.cpp   2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -34,6 +34,17 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+void RenderTreePosition::insert(RenderPtr<RenderObject> renderer)
+{
+    ASSERT(m_hasValidNextSibling);
+    auto* insertBefore = m_nextSibling;
+    if (is<RenderText>(insertBefore)) {
+        if (auto* wrapperInline = downcast<RenderText>(*insertBefore).inlineWrapperForDisplayContents())
+            insertBefore = wrapperInline;
+    }
+    m_parent.addChild(WTFMove(renderer), insertBefore);
+}
+
</ins><span class="cx"> void RenderTreePosition::computeNextSibling(const Node& node)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!node.renderer());
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreePositionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreePosition.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreePosition.h  2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreePosition.h     2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -38,15 +38,11 @@
</span><span class="cx">         : m_parent(parent)
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    RenderTreePosition(RenderElement& parent, RenderObject* nextSibling)
-        : m_parent(parent)
-        , m_nextSibling(nextSibling)
-        , m_hasValidNextSibling(true)
-    {
-    }
</del><span class="cx"> 
</span><span class="cx">     RenderElement& parent() const { return m_parent; }
</span><del>-    RenderObject* nextSibling() const { ASSERT(m_hasValidNextSibling); return m_nextSibling; }
</del><ins>+    void insert(RenderPtr<RenderObject>);
+    bool canInsert(RenderElement&) const;
+    bool canInsert(RenderText&) const;
</ins><span class="cx"> 
</span><span class="cx">     void computeNextSibling(const Node&);
</span><span class="cx">     void moveToLastChild();
</span><span class="lines">@@ -70,4 +66,16 @@
</span><span class="cx">     m_hasValidNextSibling = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline bool RenderTreePosition::canInsert(RenderElement& renderer) const
+{
+    ASSERT(!renderer.parent());
+    return m_parent.isChildAllowed(renderer, renderer.style());
+}
+
+inline bool RenderTreePosition::canInsert(RenderText& renderer) const
+{
+    ASSERT(!renderer.parent());
+    return m_parent.isChildAllowed(renderer, m_parent.style());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdatercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdater.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdater.cpp 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdater.cpp    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -274,7 +274,7 @@
</span><span class="cx">     if (is<RenderBlock>(*renderer))
</span><span class="cx">         FirstLetter::update(downcast<RenderBlock>(*renderer));
</span><span class="cx">     if (is<RenderListItem>(*renderer))
</span><del>-        ListItem::updateMarker(m_builder, downcast<RenderListItem>(*renderer));
</del><ins>+        ListItem::updateMarker(downcast<RenderListItem>(*renderer));
</ins><span class="cx">     if (is<RenderBlockFlow>(*renderer))
</span><span class="cx">         MultiColumn::update(downcast<RenderBlockFlow>(*renderer));
</span><span class="cx"> 
</span><span class="lines">@@ -376,8 +376,7 @@
</span><span class="cx">     auto newRenderer = element.createElementRenderer(WTFMove(style), insertionPosition);
</span><span class="cx">     if (!newRenderer)
</span><span class="cx">         return;
</span><del>-
-    if (!insertionPosition.parent().isChildAllowed(*newRenderer, newRenderer->style()))
</del><ins>+    if (!insertionPosition.canInsert(*newRenderer))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     element.setRenderer(newRenderer.get());
</span><span class="lines">@@ -386,13 +385,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     if (m_document.webkitIsFullScreen() && m_document.webkitCurrentFullScreenElement() == &element) {
</span><del>-        newRenderer = RenderFullScreen::wrapNewRenderer(m_builder, WTFMove(newRenderer), insertionPosition.parent(), m_document);
</del><ins>+        newRenderer = RenderFullScreen::wrapNewRenderer(WTFMove(newRenderer), insertionPosition.parent(), m_document);
</ins><span class="cx">         if (!newRenderer)
</span><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    m_builder.insertChild(insertionPosition, WTFMove(newRenderer));
</del><ins>+    insertionPosition.insert(WTFMove(newRenderer));
</ins><span class="cx"> 
</span><span class="cx">     if (AXObjectCache* cache = m_document.axObjectCache())
</span><span class="cx">         cache->updateCacheAfterNodeIsAttached(&element);
</span><span class="lines">@@ -446,16 +445,15 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTreeUpdater::createTextRenderer(Text& textNode, const Style::TextUpdate* textUpdate)
</del><ins>+static void createTextRenderer(Text& textNode, RenderTreePosition& renderTreePosition, const Style::TextUpdate* textUpdate)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!textNode.renderer());
</span><span class="cx"> 
</span><del>-    auto& renderTreePosition = this->renderTreePosition();
</del><span class="cx">     auto textRenderer = textNode.createTextRenderer(renderTreePosition.parent().style());
</span><span class="cx"> 
</span><span class="cx">     renderTreePosition.computeNextSibling(textNode);
</span><span class="cx"> 
</span><del>-    if (!renderTreePosition.parent().isChildAllowed(*textRenderer, renderTreePosition.parent().style()))
</del><ins>+    if (!renderTreePosition.canInsert(*textRenderer))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     textNode.setRenderer(textRenderer.get());
</span><span class="lines">@@ -463,17 +461,17 @@
</span><span class="cx">     if (textUpdate && textUpdate->inheritedDisplayContentsStyle && *textUpdate->inheritedDisplayContentsStyle) {
</span><span class="cx">         // Wrap text renderer into anonymous inline so we can give it a style.
</span><span class="cx">         // This is to support "<div style='display:contents;color:green'>text</div>" type cases
</span><del>-        auto newDisplayContentsAnonymousWrapper = WebCore::createRenderer<RenderInline>(textNode.document(), RenderStyle::clone(**textUpdate->inheritedDisplayContentsStyle));
</del><ins>+        auto newDisplayContentsAnonymousWrapper = createRenderer<RenderInline>(textNode.document(), RenderStyle::clone(**textUpdate->inheritedDisplayContentsStyle));
</ins><span class="cx">         newDisplayContentsAnonymousWrapper->initializeStyle();
</span><span class="cx">         auto& displayContentsAnonymousWrapper = *newDisplayContentsAnonymousWrapper;
</span><del>-        m_builder.insertChild(renderTreePosition, WTFMove(newDisplayContentsAnonymousWrapper));
</del><ins>+        renderTreePosition.insert(WTFMove(newDisplayContentsAnonymousWrapper));
</ins><span class="cx"> 
</span><span class="cx">         textRenderer->setInlineWrapperForDisplayContents(&displayContentsAnonymousWrapper);
</span><del>-        m_builder.insertChild(displayContentsAnonymousWrapper, WTFMove(textRenderer));
</del><ins>+        displayContentsAnonymousWrapper.addChild(WTFMove(textRenderer));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_builder.insertChild(renderTreePosition, WTFMove(textRenderer));
</del><ins>+    renderTreePosition.insert(WTFMove(textRenderer));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderTreeUpdater::updateTextRenderer(Text& text, const Style::TextUpdate* textUpdate)
</span><span class="lines">@@ -484,7 +482,7 @@
</span><span class="cx">     if (existingRenderer && textUpdate && textUpdate->inheritedDisplayContentsStyle) {
</span><span class="cx">         if (existingRenderer->inlineWrapperForDisplayContents() || *textUpdate->inheritedDisplayContentsStyle) {
</span><span class="cx">             // FIXME: We could update without teardown.
</span><del>-            tearDownTextRenderer(text);
</del><ins>+            tearDownRenderer(text);
</ins><span class="cx">             existingRenderer = nullptr;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -495,13 +493,13 @@
</span><span class="cx">                 existingRenderer->setTextWithOffset(text.data(), textUpdate->offset, textUpdate->length);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        tearDownTextRenderer(text);
</del><ins>+        tearDownRenderer(text);
</ins><span class="cx">         renderingParent().didCreateOrDestroyChildRenderer = true;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (!needsRenderer)
</span><span class="cx">         return;
</span><del>-    createTextRenderer(text, textUpdate);
</del><ins>+    createTextRenderer(text, renderTreePosition(), textUpdate);
</ins><span class="cx">     renderingParent().didCreateOrDestroyChildRenderer = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -516,16 +514,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderTreeUpdater::tearDownRenderers(Element& root)
</span><span class="cx"> {
</span><del>-    RenderTreeBuilder builder;
</del><span class="cx">     tearDownRenderers(root, TeardownType::Full);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTreeUpdater::tearDownRenderer(Text& text)
-{
-    RenderTreeBuilder builder;
-    tearDownTextRenderer(text);
-}
-
</del><span class="cx"> void RenderTreeUpdater::tearDownRenderers(Element& root, TeardownType teardownType)
</span><span class="cx"> {
</span><span class="cx">     WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
</span><span class="lines">@@ -550,8 +541,7 @@
</span><span class="cx">             if (teardownType == TeardownType::Full)
</span><span class="cx">                 element.clearHoverAndActiveStatusBeforeDetachingRenderer();
</span><span class="cx"> 
</span><del>-            GeneratedContent::removeBeforePseudoElement(element);
-            GeneratedContent::removeAfterPseudoElement(element);
</del><ins>+            element.clearStyleDerivedDataBeforeDetachingRenderer();
</ins><span class="cx"> 
</span><span class="cx">             if (auto* renderer = element.renderer()) {
</span><span class="cx">                 renderer->removeFromParentAndDestroyCleaningUpAnonymousWrappers();
</span><span class="lines">@@ -569,7 +559,7 @@
</span><span class="cx">         pop(it.depth());
</span><span class="cx"> 
</span><span class="cx">         if (is<Text>(*it)) {
</span><del>-            tearDownTextRenderer(downcast<Text>(*it));
</del><ins>+            tearDownRenderer(downcast<Text>(*it));
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -579,7 +569,7 @@
</span><span class="cx">     pop(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTreeUpdater::tearDownTextRenderer(Text& text)
</del><ins>+void RenderTreeUpdater::tearDownRenderer(Text& text)
</ins><span class="cx"> {
</span><span class="cx">     auto* renderer = text.renderer();
</span><span class="cx">     if (!renderer)
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdaterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdater.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdater.h   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdater.h      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> #include "RenderTreePosition.h"
</span><span class="cx"> #include "StyleChange.h"
</span><span class="cx"> #include "StyleUpdate.h"
</span><span class="lines">@@ -60,7 +59,6 @@
</span><span class="cx"> 
</span><span class="cx">     void updateRenderTree(ContainerNode& root);
</span><span class="cx">     void updateTextRenderer(Text&, const Style::TextUpdate*);
</span><del>-    void createTextRenderer(Text&, const Style::TextUpdate*);
</del><span class="cx">     void updateElementRenderer(Element&, const Style::ElementUpdate&);
</span><span class="cx">     void createRenderer(Element&, RenderStyle&&);
</span><span class="cx">     void updateBeforeDescendants(Element&, const Style::ElementUpdates*);
</span><span class="lines">@@ -91,7 +89,6 @@
</span><span class="cx"> 
</span><span class="cx">     enum class TeardownType { Full, RendererUpdate, RendererUpdateCancelingAnimations };
</span><span class="cx">     static void tearDownRenderers(Element&, TeardownType);
</span><del>-    static void tearDownTextRenderer(Text&);
</del><span class="cx"> 
</span><span class="cx">     RenderView& renderView();
</span><span class="cx"> 
</span><span class="lines">@@ -101,8 +98,6 @@
</span><span class="cx">     Vector<Parent> m_parentStack;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr<GeneratedContent> m_generatedContent;
</span><del>-
-    RenderTreeBuilder m_builder;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdaterFirstLettercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp      2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp 2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "RenderTable.h"
</span><span class="cx"> #include "RenderTextFragment.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -125,7 +124,7 @@
</span><span class="cx">             if (is<RenderText>(*child))
</span><span class="cx">                 downcast<RenderText>(*child).removeAndDestroyTextBoxes();
</span><span class="cx">             auto toMove = firstLetter->takeChild(*child);
</span><del>-            RenderTreeBuilder::current()->insertChild(*newFirstLetter, WTFMove(toMove));
</del><ins>+            newFirstLetter->addChild(WTFMove(toMove));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         RenderObject* nextSibling = firstLetter->nextSibling();
</span><span class="lines">@@ -136,7 +135,7 @@
</span><span class="cx">             newFirstLetter->setFirstLetterRemainingText(*remainingText);
</span><span class="cx">         }
</span><span class="cx">         firstLetterContainer->removeAndDestroyChild(*firstLetter);
</span><del>-        RenderTreeBuilder::current()->insertChild(*firstLetterContainer, WTFMove(newFirstLetter), nextSibling);
</del><ins>+        firstLetterContainer->addChild(WTFMove(newFirstLetter), nextSibling);
</ins><span class="cx">     } else
</span><span class="cx">         firstLetter->setStyle(WTFMove(pseudoStyle));
</span><span class="cx"> }
</span><span class="lines">@@ -154,7 +153,7 @@
</span><span class="cx">     newFirstLetter->setIsFirstLetter();
</span><span class="cx"> 
</span><span class="cx">     auto& firstLetter = *newFirstLetter;
</span><del>-    RenderTreeBuilder::current()->insertChild(*firstLetterContainer, WTFMove(newFirstLetter), &currentTextChild);
</del><ins>+    firstLetterContainer->addChild(WTFMove(newFirstLetter), &currentTextChild);
</ins><span class="cx"> 
</span><span class="cx">     // The original string is going to be either a generated content string or a DOM node's
</span><span class="cx">     // string. We want the original string before it got transformed in case first-letter has
</span><span class="lines">@@ -198,7 +197,7 @@
</span><span class="cx">             newRemainingText = createRenderer<RenderTextFragment>(firstLetterBlock.document(), oldText, length, oldText.length() - length);
</span><span class="cx"> 
</span><span class="cx">         RenderTextFragment& remainingText = *newRemainingText;
</span><del>-        RenderTreeBuilder::current()->insertChild(*firstLetterContainer, WTFMove(newRemainingText), beforeChild);
</del><ins>+        firstLetterContainer->addChild(WTFMove(newRemainingText), beforeChild);
</ins><span class="cx">         remainingText.setFirstLetter(firstLetter);
</span><span class="cx">         firstLetter.setFirstLetterRemainingText(remainingText);
</span><span class="cx"> 
</span><span class="lines">@@ -205,7 +204,7 @@
</span><span class="cx">         // construct text fragment for the first letter
</span><span class="cx">         auto letter = createRenderer<RenderTextFragment>(firstLetterBlock.document(), oldText, 0, length);
</span><span class="cx"> 
</span><del>-        RenderTreeBuilder::current()->insertChild(firstLetter, WTFMove(letter));
</del><ins>+        firstLetter.addChild(WTFMove(letter));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdaterGeneratedContentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.cpp 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.cpp    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     for (; it != end; ++it) {
</span><span class="cx">         auto& quote = *it;
</span><span class="cx">         // Quote character depends on quote depth so we chain the updates.
</span><del>-        quote.updateRenderer(m_updater.m_builder, m_previousUpdatedQuote);
</del><ins>+        quote.updateRenderer(m_previousUpdatedQuote);
</ins><span class="cx">         m_previousUpdatedQuote = &quote;
</span><span class="cx">         if (&quote == lastQuote)
</span><span class="cx">             return;
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     ASSERT(!lastQuote);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void createContentRenderers(RenderTreeBuilder& builder, RenderElement& pseudoRenderer, const RenderStyle& style)
</del><ins>+static void createContentRenderers(RenderElement& pseudoRenderer, const RenderStyle& style)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(style.contentData());
</span><span class="cx"> 
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     for (const ContentData* content = style.contentData(); content; content = content->next()) {
</span><span class="cx">         auto child = content->createContentRenderer(pseudoRenderer.document(), style);
</span><span class="cx">         if (pseudoRenderer.isChildAllowed(*child, style))
</span><del>-            builder.insertChild(pseudoRenderer, WTFMove(child));
</del><ins>+            pseudoRenderer.addChild(WTFMove(child));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -100,9 +100,9 @@
</span><span class="cx">     if (!needsPseudoElement(update)) {
</span><span class="cx">         if (pseudoElement) {
</span><span class="cx">             if (pseudoId == BEFORE)
</span><del>-                removeBeforePseudoElement(current);
</del><ins>+                current.clearBeforePseudoElement();
</ins><span class="cx">             else
</span><del>-                removeAfterPseudoElement(current);
</del><ins>+                current.clearAfterPseudoElement();
</ins><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (update->change == Style::Detach)
</span><del>-        createContentRenderers(m_updater.m_builder, *pseudoElementRenderer, *update->style);
</del><ins>+        createContentRenderers(*pseudoElementRenderer, *update->style);
</ins><span class="cx">     else
</span><span class="cx">         updateStyleForContentRenderers(*pseudoElementRenderer, *update->style);
</span><span class="cx"> 
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx">             updateQuotesUpTo(&child);
</span><span class="cx">     }
</span><span class="cx">     if (is<RenderListItem>(*pseudoElementRenderer))
</span><del>-        ListItem::updateMarker(m_updater.m_builder, downcast<RenderListItem>(*pseudoElementRenderer));
</del><ins>+        ListItem::updateMarker(downcast<RenderListItem>(*pseudoElementRenderer));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderTreeUpdater::GeneratedContent::needsPseudoElement(const std::optional<Style::ElementUpdate>& update)
</span><span class="lines">@@ -167,22 +167,4 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTreeUpdater::GeneratedContent::removeBeforePseudoElement(Element& element)
-{
-    auto* pseudoElement = element.beforePseudoElement();
-    if (!pseudoElement)
-        return;
-    tearDownRenderers(*pseudoElement, TeardownType::Full);
-    element.clearBeforePseudoElement();
</del><span class="cx"> }
</span><del>-
-void RenderTreeUpdater::GeneratedContent::removeAfterPseudoElement(Element& element)
-{
-    auto* pseudoElement = element.afterPseudoElement();
-    if (!pseudoElement)
-        return;
-    tearDownRenderers(*pseudoElement, TeardownType::Full);
-    element.clearAfterPseudoElement();
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdaterGeneratedContenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.h   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdaterGeneratedContent.h      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -40,9 +40,6 @@
</span><span class="cx">     void updatePseudoElement(Element&, const std::optional<Style::ElementUpdate>&, PseudoId);
</span><span class="cx">     void updateRemainingQuotes();
</span><span class="cx"> 
</span><del>-    static void removeBeforePseudoElement(Element&);
-    static void removeAfterPseudoElement(Element&);
-
</del><span class="cx"> private:
</span><span class="cx">     void updateQuotesUpTo(RenderQuote*);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdaterListItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdaterListItem.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdaterListItem.cpp 2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdaterListItem.cpp    2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     return child;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderTreeUpdater::ListItem::updateMarker(RenderTreeBuilder& builder, RenderListItem& listItemRenderer)
</del><ins>+void RenderTreeUpdater::ListItem::updateMarker(RenderListItem& listItemRenderer)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(!listItemRenderer.view().frameView().layoutContext().layoutState());
</span><span class="cx"> 
</span><span class="lines">@@ -110,9 +110,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (newParent != currentParent) {
</span><span class="cx">         if (currentParent)
</span><del>-            builder.insertChild(*newParent, currentParent->takeChild(*markerRenderer), firstNonMarkerChild(*newParent));
</del><ins>+            newParent->addChild(currentParent->takeChild(*markerRenderer), firstNonMarkerChild(*newParent));
</ins><span class="cx">         else
</span><del>-            builder.insertChild(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent));
</del><ins>+            newParent->addChild(WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent));
</ins><span class="cx"> 
</span><span class="cx">         // If current parent is an anonymous block that has lost all its children, destroy it.
</span><span class="cx">         if (currentParent && currentParent->isAnonymousBlock() && !currentParent->firstChild() && !downcast<RenderBlock>(*currentParent).continuation())
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdaterListItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdaterListItem.h (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdaterListItem.h   2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdaterListItem.h      2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> class RenderTreeUpdater::ListItem {
</span><span class="cx"> public:
</span><del>-    static void updateMarker(RenderTreeBuilder&, RenderListItem&);
</del><ins>+    static void updateMarker(RenderListItem&);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleRenderTreeUpdaterMultiColumncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp (225993 => 225994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp      2017-12-16 00:51:53 UTC (rev 225993)
+++ trunk/Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp 2017-12-16 02:05:42 UTC (rev 225994)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include "RenderMultiColumnFlow.h"
</span><span class="cx"> #include "RenderMultiColumnSet.h"
</span><span class="cx"> #include "RenderMultiColumnSpannerPlaceholder.h"
</span><del>-#include "RenderTreeBuilder.h"
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -74,7 +73,7 @@
</span><span class="cx">             auto& spannerOriginalParent = *placeholder->parent();
</span><span class="cx">             // Detaching the spanner takes care of removing the placeholder (and merges the RenderMultiColumnSets).
</span><span class="cx">             auto spannerToReInsert = spanner->parent()->takeChild(*spanner);
</span><del>-            RenderTreeBuilder::current()->insertChild(spannerOriginalParent, WTFMove(spannerToReInsert));
</del><ins>+            spannerOriginalParent.addChild(WTFMove(spannerToReInsert));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -81,7 +80,7 @@
</span><span class="cx">     auto newFragmentedFlow = WebCore::createRenderer<RenderMultiColumnFlow>(flow.document(), RenderStyle::createAnonymousStyleWithDisplay(flow.style(), BLOCK));
</span><span class="cx">     newFragmentedFlow->initializeStyle();
</span><span class="cx">     auto& fragmentedFlow = *newFragmentedFlow;
</span><del>-    flow.RenderBlock::addChild(*RenderTreeBuilder::current(), WTFMove(newFragmentedFlow));
</del><ins>+    flow.RenderBlock::addChild(WTFMove(newFragmentedFlow));
</ins><span class="cx"> 
</span><span class="cx">     // Reparent children preceding the fragmented flow into the fragmented flow.
</span><span class="cx">     flow.moveChildrenTo(&fragmentedFlow, flow.firstChild(), &fragmentedFlow, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
</span><span class="lines">@@ -122,7 +121,7 @@
</span><span class="cx">     multiColumnFlow.moveAllChildrenTo(&flow, RenderBoxModelObject::NormalizeAfterInsertion::Yes);
</span><span class="cx">     multiColumnFlow.removeFromParentAndDestroy();
</span><span class="cx">     for (auto& parentAndSpanner : parentAndSpannerList)
</span><del>-        RenderTreeBuilder::current()->insertChild(*parentAndSpanner.first, WTFMove(parentAndSpanner.second));
</del><ins>+        parentAndSpanner.first->addChild(WTFMove(parentAndSpanner.second));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>