<!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>[186803] trunk</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/186803">186803</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2015-07-14 08:58:05 -0700 (Tue, 14 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>DOM4: prepend, append, before, after &amp; replace
https://bugs.webkit.org/show_bug.cgi?id=74648

Reviewed by Darin Adler.

Source/WebCore:

- Adds support for ChildNode.before/after/replaceWith and ParentNode.prepend/append
  which are new functions in https://dom.spec.whatwg.org
- Uses custom bindings rather than implementing support for union types in the code
  generator as their uses seems isolated to just this spec at the moment. If more
  uses come along, we should implement proper support for them in the generator and
  remove the custom bindings added here.

Tests: fast/dom/ChildNode-after.html
       fast/dom/ChildNode-before.html
       fast/dom/ChildNode-replaceWith.html
       fast/dom/ParentNode-append.html
       fast/dom/ParentNode-prepend.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Add new files.

* bindings/js/JSCharacterDataCustom.cpp: Added.
(WebCore::JSCharacterData::before):
(WebCore::JSCharacterData::after):
(WebCore::JSCharacterData::replaceWith):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::prepend):
(WebCore::JSDocument::append):
(WebCore::JSDocument::createTouchList):
* bindings/js/JSDocumentFragmentCustom.cpp: Added.
(WebCore::JSDocumentFragment::prepend):
(WebCore::JSDocumentFragment::append):
* bindings/js/JSDocumentTypeCustom.cpp: Added.
(WebCore::JSDocumentType::before):
(WebCore::JSDocumentType::after):
(WebCore::JSDocumentType::replaceWith):
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):
(WebCore::JSElement::before):
(WebCore::JSElement::after):
(WebCore::JSElement::replaceWith):
(WebCore::JSElement::prepend):
(WebCore::JSElement::append):
Add custom bindings to implement the use of variadic union types.

* bindings/js/JSNodeOrString.cpp: Added.
(WebCore::toNodeOrStringVector):
* bindings/js/JSNodeOrString.h: Added.
Adds a help function for converting an JS argument list into a Vector
of NodeOrString objects.

* dom/ChildNode.idl:
Expose before/after/replaceWith to JavaScript.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::append):
(WebCore::ContainerNode::prepend):
* dom/ContainerNode.h:
Add implementations of append and prepend.

* dom/Node.h:
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::firstPrecedingSiblingNotInNodeSet):
(WebCore::firstFollowingSiblingNotInNodeSet):
Helper functions for before, after and removeWith.

(WebCore::Node::before):
(WebCore::Node::after):
(WebCore::Node::replaceWith):
Add implementations of before, after and removeWith.

* dom/NodeOrString.cpp: Added.
(WebCore::convertNodesOrStringsIntoNode):
* dom/NodeOrString.h: Added.
(WebCore::NodeOrString::NodeOrString):
(WebCore::NodeOrString::~NodeOrString):
(WebCore::NodeOrString::type):
(WebCore::NodeOrString::node):
(WebCore::NodeOrString::string):
Custom union type representing the (Node or DOMString) IDL type.

* dom/ParentNode.idl:
Expose append/prepend to JavaScript.

LayoutTests:

* fast/dom/ChildNode-after-expected.txt: Added.
* fast/dom/ChildNode-after.html: Added.
* fast/dom/ChildNode-before-expected.txt: Added.
* fast/dom/ChildNode-before.html: Added.
* fast/dom/ChildNode-replaceWith-expected.txt: Added.
* fast/dom/ChildNode-replaceWith.html: Added.
* fast/dom/ParentNode-append-expected.txt: Added.
* fast/dom/ParentNode-append.html: Added.
* fast/dom/ParentNode-prepend-expected.txt: Added.
* fast/dom/ParentNode-prepend.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSElementCustomcpp">trunk/Source/WebCore/bindings/js/JSElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomChildNodeidl">trunk/Source/WebCore/dom/ChildNode.idl</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomDOMAllInOnecpp">trunk/Source/WebCore/dom/DOMAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCoredomParentNodeidl">trunk/Source/WebCore/dom/ParentNode.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomChildNodeafterexpectedtxt">trunk/LayoutTests/fast/dom/ChildNode-after-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomChildNodeafterhtml">trunk/LayoutTests/fast/dom/ChildNode-after.html</a></li>
<li><a href="#trunkLayoutTestsfastdomChildNodebeforeexpectedtxt">trunk/LayoutTests/fast/dom/ChildNode-before-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomChildNodebeforehtml">trunk/LayoutTests/fast/dom/ChildNode-before.html</a></li>
<li><a href="#trunkLayoutTestsfastdomChildNodereplaceWithexpectedtxt">trunk/LayoutTests/fast/dom/ChildNode-replaceWith-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomChildNodereplaceWithhtml">trunk/LayoutTests/fast/dom/ChildNode-replaceWith.html</a></li>
<li><a href="#trunkLayoutTestsfastdomParentNodeappendexpectedtxt">trunk/LayoutTests/fast/dom/ParentNode-append-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomParentNodeappendhtml">trunk/LayoutTests/fast/dom/ParentNode-append.html</a></li>
<li><a href="#trunkLayoutTestsfastdomParentNodeprependexpectedtxt">trunk/LayoutTests/fast/dom/ParentNode-prepend-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomParentNodeprependhtml">trunk/LayoutTests/fast/dom/ParentNode-prepend.html</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCharacterDataCustomcpp">trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentFragmentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentTypeCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeOrStringcpp">trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeOrStringh">trunk/Source/WebCore/bindings/js/JSNodeOrString.h</a></li>
<li><a href="#trunkSourceWebCoredomNodeOrStringcpp">trunk/Source/WebCore/dom/NodeOrString.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeOrStringh">trunk/Source/WebCore/dom/NodeOrString.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/LayoutTests/ChangeLog        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-07-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        DOM4: prepend, append, before, after &amp; replace
+        https://bugs.webkit.org/show_bug.cgi?id=74648
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/ChildNode-after-expected.txt: Added.
+        * fast/dom/ChildNode-after.html: Added.
+        * fast/dom/ChildNode-before-expected.txt: Added.
+        * fast/dom/ChildNode-before.html: Added.
+        * fast/dom/ChildNode-replaceWith-expected.txt: Added.
+        * fast/dom/ChildNode-replaceWith.html: Added.
+        * fast/dom/ParentNode-append-expected.txt: Added.
+        * fast/dom/ParentNode-append.html: Added.
+        * fast/dom/ParentNode-prepend-expected.txt: Added.
+        * fast/dom/ParentNode-prepend.html: Added.
+
</ins><span class="cx"> 2015-07-13  Basile Clement  &lt;basile_clement@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Object cycles should not prevent allocation elimination/sinking
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomChildNodeafterexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ChildNode-after-expected.txt (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ChildNode-after-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ChildNode-after-expected.txt        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,189 @@
</span><ins>+Tests ChildNode.after((Node or DOMString)...)
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test Element.after((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 2
+PASS child.nextSibling is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 2
+PASS child.nextSibling.data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 3
+PASS child.nextSibling.data is 'hello'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 4
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'null'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is 'undefined'
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is '7'
+
+Test a child without a parent.
+PASS child.nextSibling is null
+
+Test when there the next sibling is not a viable next sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is d2
+
+Test when there is no viable next sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is d2
+
+Test Text.after((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 2
+PASS child.nextSibling is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 2
+PASS child.nextSibling.data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 3
+PASS child.nextSibling.data is 'hello'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 4
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'null'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is 'undefined'
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is '7'
+
+Test a child without a parent.
+PASS child.nextSibling is null
+
+Test when there the next sibling is not a viable next sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is d2
+
+Test when there is no viable next sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is d2
+
+Test Comment.after((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 2
+PASS child.nextSibling is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 2
+PASS child.nextSibling.data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 3
+PASS child.nextSibling.data is 'hello'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 4
+PASS parent.childNodes[0] is an instance of Comment
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'null'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is 'undefined'
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is '7'
+
+Test a child without a parent.
+PASS child.nextSibling is null
+
+Test when there the next sibling is not a viable next sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Comment
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is d2
+
+Test when there is no viable next sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Comment
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d1
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is d2
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomChildNodeafterhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ChildNode-after.html (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ChildNode-after.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ChildNode-after.html        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Tests ChildNode.after((Node or DOMString)...)&quot;);
+function test(t, createChild)
+{
+    type = t;
+    debug(&quot;&lt;b&gt;Test &quot; + type + &quot;.after((Node or DOMString)...).&lt;/b&gt;&quot;);
+    
+    debug(&quot;Test with no arguments.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.after();
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test with a single element.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    child.after(d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBe(&quot;child.nextSibling&quot;, &quot;d1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test with a single string.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.after('hello');
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBe(&quot;child.nextSibling.data&quot;, &quot;'hello'&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test with a both strings and elements.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    child.after('hello', d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;3&quot;);
+    shouldBe(&quot;child.nextSibling.data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[1].data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[2]&quot;, &quot;d1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test conversion to string&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.after(null, undefined, 7);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;4&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, type);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;child&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[1].data&quot;, &quot;'null'&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[2].data&quot;, &quot;'undefined'&quot;);
+    shouldBeType(&quot;parent.childNodes[3]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[3].data&quot;, &quot;'7'&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test a child without a parent.&quot;);
+    child = createChild();
+    d1 = document.createElement(&quot;div&quot;);
+    child.after(d1);
+    shouldBeNull(&quot;child.nextSibling&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test when there the next sibling is not a viable next sibling.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d1);
+    d2 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d2);
+    child.after(&quot;hello&quot;, d1, &quot;world&quot;);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;5&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, type);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;child&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[1].data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[2]&quot;, &quot;d1&quot;);
+    shouldBeType(&quot;parent.childNodes[3]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[3].data&quot;, &quot;'world'&quot;);
+    shouldBeType(&quot;parent.childNodes[4]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[4]&quot;, &quot;d2&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test when there is no viable next sibling.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d1);
+    d2 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d2);
+    child.after(&quot;hello&quot;, d1, &quot;world&quot;, d2);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;5&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, type);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;child&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[1].data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[2]&quot;, &quot;d1&quot;);
+    shouldBeType(&quot;parent.childNodes[3]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[3].data&quot;, &quot;'world'&quot;);
+    shouldBeType(&quot;parent.childNodes[4]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[4]&quot;, &quot;d2&quot;);
+
+    debug(&quot;&quot;);
+}
+
+test(&quot;Element&quot;, function() { return document.createElement(&quot;div&quot;); });
+test(&quot;Text&quot;, function() { return document.createTextNode(&quot;text node text&quot;); });
+test(&quot;Comment&quot;, function() { return document.createComment(&quot;comment text&quot;); });
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomChildNodebeforeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ChildNode-before-expected.txt (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ChildNode-before-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ChildNode-before-expected.txt        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,189 @@
</span><ins>+Tests ChildNode.before((Node or DOMString)...)
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test Element.before((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 2
+PASS child.previousSibling is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 2
+PASS child.previousSibling.data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 3
+PASS child.previousSibling is d1
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 4
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'null'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'undefined'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is '7'
+PASS parent.childNodes[3] is an instance of Element
+PASS parent.childNodes[3] is child
+
+Test a child without a parent.
+PASS child.previousSibling is null
+
+Test when there the previous sibling is not a viable previous sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d2
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is child
+
+Test when there is no viable previous sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is 'world'
+PASS parent.childNodes[3] is an instance of Element
+PASS parent.childNodes[3] is d2
+PASS parent.childNodes[4] is an instance of Element
+PASS parent.childNodes[4] is child
+
+Test Text.before((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 2
+PASS child.previousSibling is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 2
+PASS child.previousSibling.data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 3
+PASS child.previousSibling is d1
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 4
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'null'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'undefined'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is '7'
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3] is child
+
+Test a child without a parent.
+PASS child.previousSibling is null
+
+Test when there the previous sibling is not a viable previous sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d2
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Text
+PASS parent.childNodes[4] is child
+
+Test when there is no viable previous sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is 'world'
+PASS parent.childNodes[3] is an instance of Element
+PASS parent.childNodes[3] is d2
+PASS parent.childNodes[4] is an instance of Text
+PASS parent.childNodes[4] is child
+
+Test Comment.before((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 2
+PASS child.previousSibling is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 2
+PASS child.previousSibling.data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 3
+PASS child.previousSibling is d1
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 4
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'null'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'undefined'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is '7'
+PASS parent.childNodes[3] is an instance of Comment
+PASS parent.childNodes[3] is child
+
+Test a child without a parent.
+PASS child.previousSibling is null
+
+Test when there the previous sibling is not a viable previous sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'hello'
+PASS parent.childNodes[2] is an instance of Element
+PASS parent.childNodes[2] is d2
+PASS parent.childNodes[3] is an instance of Text
+PASS parent.childNodes[3].data is 'world'
+PASS parent.childNodes[4] is an instance of Comment
+PASS parent.childNodes[4] is child
+
+Test when there is no viable previous sibling.
+PASS parent.childNodes.length is 5
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is 'world'
+PASS parent.childNodes[3] is an instance of Element
+PASS parent.childNodes[3] is d2
+PASS parent.childNodes[4] is an instance of Comment
+PASS parent.childNodes[4] is child
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomChildNodebeforehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ChildNode-before.html (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ChildNode-before.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ChildNode-before.html        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Tests ChildNode.before((Node or DOMString)...)&quot;);
+function test(t, createChild)
+{
+    type = t;
+    debug(&quot;&lt;b&gt;Test &quot; + type + &quot;.before((Node or DOMString)...).&lt;/b&gt;&quot;);
+    
+    debug(&quot;Test with no arguments.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.before();
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test with a single element.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    child.before(d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBe(&quot;child.previousSibling&quot;, &quot;d1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test with a single string.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.before('hello');
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBe(&quot;child.previousSibling.data&quot;, &quot;'hello'&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test with a both strings and elements.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    child.before('hello', d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;3&quot;);
+    shouldBe(&quot;child.previousSibling&quot;, &quot;d1&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[0].data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[1]&quot;, &quot;d1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test conversion to string&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.before(null, undefined, 7);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;4&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[0].data&quot;, &quot;'null'&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[1].data&quot;, &quot;'undefined'&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[2].data&quot;, &quot;'7'&quot;);
+    shouldBeType(&quot;parent.childNodes[3]&quot;, type);
+    shouldBe(&quot;parent.childNodes[3]&quot;, &quot;child&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test a child without a parent.&quot;);
+    child = createChild();
+    d1 = document.createElement(&quot;div&quot;);
+    child.before(d1);
+    shouldBeNull(&quot;child.previousSibling&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test when there the previous sibling is not a viable previous sibling.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    d1 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d1);
+    d2 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d2);
+    parent.appendChild(child);
+    child.before(&quot;hello&quot;, d2, &quot;world&quot;);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;5&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;d1&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[1].data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[2]&quot;, &quot;d2&quot;);
+    shouldBeType(&quot;parent.childNodes[3]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[3].data&quot;, &quot;'world'&quot;);
+    shouldBeType(&quot;parent.childNodes[4]&quot;, type);
+    shouldBe(&quot;parent.childNodes[4]&quot;, &quot;child&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test when there is no viable previous sibling.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    d1 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d1);
+    d2 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d2);
+    parent.appendChild(child);
+    child.before(&quot;hello&quot;, d1, &quot;world&quot;, d2);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;5&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[0].data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[1]&quot;, &quot;d1&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[2].data&quot;, &quot;'world'&quot;);
+    shouldBeType(&quot;parent.childNodes[3]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[3]&quot;, &quot;d2&quot;);
+    shouldBeType(&quot;parent.childNodes[4]&quot;, type);
+    shouldBe(&quot;parent.childNodes[4]&quot;, &quot;child&quot;);
+
+    debug(&quot;&quot;);
+}
+
+test(&quot;Element&quot;, function() { return document.createElement(&quot;div&quot;); });
+test(&quot;Text&quot;, function() { return document.createTextNode(&quot;text node text&quot;); });
+test(&quot;Comment&quot;, function() { return document.createComment(&quot;comment text&quot;); });
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomChildNodereplaceWithexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ChildNode-replaceWith-expected.txt (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ChildNode-replaceWith-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ChildNode-replaceWith-expected.txt        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,183 @@
</span><ins>+Tests ChildNode.replaceWith((Node or DOMString)...)
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test Element.replaceWith((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0] is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0].data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 3
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'null'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'undefined'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is '7'
+
+Test a child without a parent.
+PASS child.replaceWith(d1) did not throw exception.
+
+Test replacing with an existing sibling.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d2
+
+Test replacing a child with itself.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is child
+
+Test replacing a child with itself and another node.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test replacing a child with itself and a sibling.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is child
+
+
+Test Text.replaceWith((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0] is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0].data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 3
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'null'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'undefined'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is '7'
+
+Test a child without a parent.
+PASS child.replaceWith(d1) did not throw exception.
+
+Test replacing with an existing sibling.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d2
+
+Test replacing a child with itself.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0] is child
+
+Test replacing a child with itself and another node.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test replacing a child with itself and a sibling.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1] is child
+
+
+Test Comment.replaceWith((Node or DOMString)...).
+Test with no arguments.
+PASS parent.childNodes.length is 1
+
+Test with a single element.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0] is d1
+
+Test with a single string.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0].data is 'hello'
+
+Test with a both strings and elements.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'hello'
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test conversion to string
+PASS parent.childNodes.length is 3
+PASS parent.childNodes[0] is an instance of Text
+PASS parent.childNodes[0].data is 'null'
+PASS parent.childNodes[1] is an instance of Text
+PASS parent.childNodes[1].data is 'undefined'
+PASS parent.childNodes[2] is an instance of Text
+PASS parent.childNodes[2].data is '7'
+
+Test a child without a parent.
+PASS child.replaceWith(d1) did not throw exception.
+
+Test replacing with an existing sibling.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d2
+
+Test replacing a child with itself.
+PASS parent.childNodes.length is 1
+PASS parent.childNodes[0] is an instance of Comment
+PASS parent.childNodes[0] is child
+
+Test replacing a child with itself and another node.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Comment
+PASS parent.childNodes[0] is child
+PASS parent.childNodes[1] is an instance of Element
+PASS parent.childNodes[1] is d1
+
+Test replacing a child with itself and a sibling.
+PASS parent.childNodes.length is 2
+PASS parent.childNodes[0] is an instance of Element
+PASS parent.childNodes[0] is d1
+PASS parent.childNodes[1] is an instance of Comment
+PASS parent.childNodes[1] is child
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomChildNodereplaceWithhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ChildNode-replaceWith.html (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ChildNode-replaceWith.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ChildNode-replaceWith.html        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,139 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Tests ChildNode.replaceWith((Node or DOMString)...)&quot;);
+function test(t, createChild)
+{
+    type = t;
+    debug(&quot;&lt;b&gt;Test &quot; + type + &quot;.replaceWith((Node or DOMString)...).&lt;/b&gt;&quot;);
+    
+    debug(&quot;Test with no arguments.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.replaceWith();
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test with a single element.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    child.replaceWith(d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;1&quot;);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;d1&quot;);
+    debug(&quot;&quot;);
+    
+    debug(&quot;Test with a single string.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.replaceWith('hello');
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;1&quot;);
+    shouldBe(&quot;parent.childNodes[0].data&quot;, &quot;'hello'&quot;);
+    debug(&quot;&quot;);
+    
+    debug(&quot;Test with a both strings and elements.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    child.replaceWith('hello', d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[0].data&quot;, &quot;'hello'&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[1]&quot;, &quot;d1&quot;);
+    debug(&quot;&quot;);
+    
+    debug(&quot;Test conversion to string&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.replaceWith(null, undefined, 7);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;3&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[0].data&quot;, &quot;'null'&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[1].data&quot;, &quot;'undefined'&quot;);
+    shouldBeType(&quot;parent.childNodes[2]&quot;, &quot;Text&quot;);
+    shouldBe(&quot;parent.childNodes[2].data&quot;, &quot;'7'&quot;);
+    debug(&quot;&quot;);
+    
+    debug(&quot;Test a child without a parent.&quot;);
+    child = createChild();
+    d1 = document.createElement(&quot;div&quot;);
+    shouldNotThrow(&quot;child.replaceWith(d1)&quot;);
+    debug(&quot;&quot;);
+    
+    debug(&quot;Test replacing with an existing sibling.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d1);
+    d2 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d2);
+    child.replaceWith(d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;d1&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[1]&quot;, &quot;d2&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test replacing a child with itself.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    child.replaceWith(child);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;1&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, type);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;child&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test replacing a child with itself and another node.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    child.replaceWith(child, d1);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, type);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;child&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[1]&quot;, &quot;d1&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;Test replacing a child with itself and a sibling.&quot;);
+    parent = document.createElement('div');
+    child = createChild();
+    parent.appendChild(child);
+    d1 = document.createElement(&quot;div&quot;);
+    parent.appendChild(d1);
+    child.replaceWith(d1, child);
+    shouldBe(&quot;parent.childNodes.length&quot;, &quot;2&quot;);
+    shouldBeType(&quot;parent.childNodes[0]&quot;, &quot;Element&quot;);
+    shouldBe(&quot;parent.childNodes[0]&quot;, &quot;d1&quot;);
+    shouldBeType(&quot;parent.childNodes[1]&quot;, type);
+    shouldBe(&quot;parent.childNodes[1]&quot;, &quot;child&quot;);
+    debug(&quot;&quot;);
+
+    debug(&quot;&quot;);
+}
+
+test(&quot;Element&quot;, function() { return document.createElement(&quot;div&quot;); });
+test(&quot;Text&quot;, function() { return document.createTextNode(&quot;text node text&quot;); });
+test(&quot;Comment&quot;, function() { return document.createComment(&quot;comment text&quot;); });
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomParentNodeappendexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ParentNode-append-expected.txt (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ParentNode-append-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ParentNode-append-expected.txt        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+Tests ParentNode.append((Node or DOMString)...)
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test Element.append((Node or DOMString)...).
+
+Test single node.
+PASS d1.parentNode is container
+
+Test multiple nodes.
+PASS d1.parentNode is container
+PASS d2.parentNode is container
+PASS d1.nextSibling is d2
+PASS d2.previousSibling is d1
+
+Test a single string.
+PASS container.firstChild is an instance of Text
+PASS container.firstChild.data is 'hello'
+
+Test multiple strings.
+PASS container.childNodes[0] is an instance of Text
+PASS container.childNodes[0].data is 'hello'
+PASS container.childNodes[1] is an instance of Text
+PASS container.childNodes[1].data is 'world'
+
+Test nodes and strings.
+PASS container.childNodes[0] is an instance of Text
+PASS container.childNodes[1] is an instance of Element
+PASS container.childNodes[2] is an instance of Text
+
+Test when container already has children.
+PASS container.childNodes[0] is an instance of Element
+PASS container.childNodes[0] is d1
+PASS container.childNodes[1] is an instance of Element
+PASS container.childNodes[1] is d2
+PASS container.childNodes[2] is an instance of Text
+PASS container.childNodes[2].data is 'hello'
+
+Test conversion to string
+PASS container.childNodes[0] is an instance of Text
+PASS container.childNodes[0].data is 'null'
+PASS container.childNodes[1] is an instance of Text
+PASS container.childNodes[1].data is 'undefined'
+PASS container.childNodes[2] is an instance of Text
+PASS container.childNodes[2].data is '7'
+
+Test no parameters
+PASS container.append() did not throw exception.
+PASS container.childNodes.length is 0
+
+Test error condition of self-appending.
+PASS container.append(container) threw exception Error: HierarchyRequestError: DOM Exception 3.
+
+Test DocumentFragment.append((Node or DOMString)...).
+PASS d1.parentNode is fragment
+
+Test Document.append((Node or DOMString)...).
+
+Test simple case of single child append.
+PASS d1.parentNode is doc
+
+Test case appending a root element and a comment.
+PASS d1.parentNode is doc
+PASS c1.parentNode is doc
+
+Test error condition appending a second root element.
+PASS doc.append(d2) threw exception Error: HierarchyRequestError: DOM Exception 3.
+
+Test error condition appending Text node as the root element.
+PASS doc.append('hello') threw exception Error: HierarchyRequestError: DOM Exception 3.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomParentNodeappendhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ParentNode-append.html (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ParentNode-append.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ParentNode-append.html        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Tests ParentNode.append((Node or DOMString)...)&quot;);
+
+debug(&quot;Test Element.append((Node or DOMString)...).&quot;);
+debug(&quot;&quot;);
+debug(&quot;Test single node.&quot;);
+var container = document.createElement(&quot;div&quot;);
+var d1 = document.createElement(&quot;div&quot;);
+container.append(d1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;container&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test multiple nodes.&quot;);
+container = document.createElement(&quot;div&quot;);
+d1 = document.createElement(&quot;div&quot;);
+var d2 = document.createElement(&quot;div&quot;);
+container.append(d1, d2);
+shouldBe(&quot;d1.parentNode&quot;, &quot;container&quot;);
+shouldBe(&quot;d2.parentNode&quot;, &quot;container&quot;);
+shouldBe(&quot;d1.nextSibling&quot;, &quot;d2&quot;);
+shouldBe(&quot;d2.previousSibling&quot;, &quot;d1&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test a single string.&quot;);
+container = document.createElement(&quot;div&quot;);
+container.append(&quot;hello&quot;);
+shouldBeType(&quot;container.firstChild&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.firstChild.data&quot;, &quot;'hello'&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test multiple strings.&quot;);
+container = document.createElement(&quot;div&quot;);
+container.append(&quot;hello&quot;, &quot;world&quot;);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[0].data&quot;, &quot;'hello'&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[1].data&quot;, &quot;'world'&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test nodes and strings.&quot;);
+container = document.createElement(&quot;div&quot;);
+d1 = document.createElement(&quot;div&quot;);
+container.append(&quot;hello&quot;, d1, &quot;world&quot;);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Text&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Element&quot;);
+shouldBeType(&quot;container.childNodes[2]&quot;, &quot;Text&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test when container already has children.&quot;);
+container = document.createElement(&quot;div&quot;);
+d1 = document.createElement(&quot;div&quot;);
+d2 = document.createElement(&quot;div&quot;);
+container.appendChild(d1);
+container.append(d2, &quot;hello&quot;);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Element&quot;);
+shouldBe(&quot;container.childNodes[0]&quot;, &quot;d1&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Element&quot;);
+shouldBe(&quot;container.childNodes[1]&quot;, &quot;d2&quot;);
+shouldBeType(&quot;container.childNodes[2]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[2].data&quot;, &quot;'hello'&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test conversion to string&quot;);
+container = document.createElement(&quot;div&quot;);
+container.append(null, undefined, 7);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[0].data&quot;, &quot;'null'&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[1].data&quot;, &quot;'undefined'&quot;);
+shouldBeType(&quot;container.childNodes[2]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[2].data&quot;, &quot;'7'&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test no parameters&quot;);
+container = document.createElement(&quot;div&quot;);
+shouldNotThrow(&quot;container.append()&quot;);
+shouldBe(&quot;container.childNodes.length&quot;, &quot;0&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test error condition of self-appending.&quot;);
+container = document.createElement(&quot;div&quot;);
+shouldThrow(&quot;container.append(container)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test DocumentFragment.append((Node or DOMString)...).&quot;);
+var fragment = document.createDocumentFragment();
+d1 = document.createElement(&quot;div&quot;);
+fragment.append(d1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;fragment&quot;);
+debug(&quot;&quot;);
+
+
+debug(&quot;Test Document.append((Node or DOMString)...).&quot;);
+debug(&quot;&quot;)
+debug(&quot;Test simple case of single child append.&quot;)
+var doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+d1 = doc.createElement(&quot;div&quot;);
+doc.append(d1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;doc&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test case appending a root element and a comment.&quot;)
+var doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+d1 = doc.createElement(&quot;div&quot;);
+c1 = doc.createComment(&quot;comment text&quot;);
+doc.append(d1, c1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;doc&quot;);
+shouldBe(&quot;c1.parentNode&quot;, &quot;doc&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test error condition appending a second root element.&quot;)
+doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+d1 = doc.createElement(&quot;div&quot;);
+d2 = doc.createElement(&quot;div&quot;);
+doc.appendChild(d1);
+shouldThrow(&quot;doc.append(d2)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test error condition appending Text node as the root element.&quot;)
+doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+shouldThrow(&quot;doc.append('hello')&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomParentNodeprependexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ParentNode-prepend-expected.txt (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ParentNode-prepend-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ParentNode-prepend-expected.txt        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+Tests ParentNode.prepend((Node or DOMString)...)
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test Element.prepend((Node or DOMString)...).
+
+Test single node.
+PASS d1.parentNode is container
+
+Test multiple nodes.
+PASS d1.parentNode is container
+PASS d2.parentNode is container
+PASS d1.nextSibling is d2
+PASS d2.previousSibling is d1
+
+Test a single string.
+PASS container.firstChild is an instance of Text
+PASS container.firstChild.data is 'hello'
+
+Test multiple strings.
+PASS container.childNodes[0] is an instance of Text
+PASS container.childNodes[0].data is 'hello'
+PASS container.childNodes[1] is an instance of Text
+PASS container.childNodes[1].data is 'world'
+
+Test nodes and strings.
+PASS container.childNodes[0] is an instance of Text
+PASS container.childNodes[1] is an instance of Element
+PASS container.childNodes[2] is an instance of Text
+
+Test when container already has children.
+PASS container.childNodes[0] is an instance of Element
+PASS container.childNodes[0] is d2
+PASS container.childNodes[1] is an instance of Text
+PASS container.childNodes[1].data is 'hello'
+PASS container.childNodes[2] is an instance of Element
+PASS container.childNodes[2] is d1
+
+Test conversion to string
+PASS container.childNodes[0] is an instance of Text
+PASS container.childNodes[0].data is 'null'
+PASS container.childNodes[1] is an instance of Text
+PASS container.childNodes[1].data is 'undefined'
+PASS container.childNodes[2] is an instance of Text
+PASS container.childNodes[2].data is '7'
+
+Test no parameters
+PASS container.prepend() did not throw exception.
+PASS container.childNodes.length is 0
+
+Test error condition of self-prepending.
+PASS container.prepend(container) threw exception Error: HierarchyRequestError: DOM Exception 3.
+
+Test DocumentFragment.prepend((Node or DOMString)...).
+PASS d1.parentNode is fragment
+
+Test Document.prepend((Node or DOMString)...).
+
+Test simple case of single child prepend.
+PASS d1.parentNode is doc
+
+Test case prepending a root element and a comment.
+PASS d1.parentNode is doc
+PASS c1.parentNode is doc
+
+Test error condition prepending a second root element.
+PASS doc.prepend(d2) threw exception Error: HierarchyRequestError: DOM Exception 3.
+
+Test error condition prepending Text node as the root element.
+PASS doc.prepend('hello') threw exception Error: HierarchyRequestError: DOM Exception 3.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomParentNodeprependhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/ParentNode-prepend.html (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/ParentNode-prepend.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/ParentNode-prepend.html        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Tests ParentNode.prepend((Node or DOMString)...)&quot;);
+
+debug(&quot;Test Element.prepend((Node or DOMString)...).&quot;);
+debug(&quot;&quot;);
+debug(&quot;Test single node.&quot;);
+var container = document.createElement(&quot;div&quot;);
+var d1 = document.createElement(&quot;div&quot;);
+container.prepend(d1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;container&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test multiple nodes.&quot;);
+container = document.createElement(&quot;div&quot;);
+d1 = document.createElement(&quot;div&quot;);
+var d2 = document.createElement(&quot;div&quot;);
+container.prepend(d1, d2);
+shouldBe(&quot;d1.parentNode&quot;, &quot;container&quot;);
+shouldBe(&quot;d2.parentNode&quot;, &quot;container&quot;);
+shouldBe(&quot;d1.nextSibling&quot;, &quot;d2&quot;);
+shouldBe(&quot;d2.previousSibling&quot;, &quot;d1&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test a single string.&quot;);
+container = document.createElement(&quot;div&quot;);
+container.prepend(&quot;hello&quot;);
+shouldBeType(&quot;container.firstChild&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.firstChild.data&quot;, &quot;'hello'&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test multiple strings.&quot;);
+container = document.createElement(&quot;div&quot;);
+container.prepend(&quot;hello&quot;, &quot;world&quot;);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[0].data&quot;, &quot;'hello'&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[1].data&quot;, &quot;'world'&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test nodes and strings.&quot;);
+container = document.createElement(&quot;div&quot;);
+d1 = document.createElement(&quot;div&quot;);
+container.prepend(&quot;hello&quot;, d1, &quot;world&quot;);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Text&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Element&quot;);
+shouldBeType(&quot;container.childNodes[2]&quot;, &quot;Text&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test when container already has children.&quot;);
+container = document.createElement(&quot;div&quot;);
+d1 = document.createElement(&quot;div&quot;);
+d2 = document.createElement(&quot;div&quot;);
+container.appendChild(d1);
+container.prepend(d2, &quot;hello&quot;);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Element&quot;);
+shouldBe(&quot;container.childNodes[0]&quot;, &quot;d2&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[1].data&quot;, &quot;'hello'&quot;);
+shouldBeType(&quot;container.childNodes[2]&quot;, &quot;Element&quot;);
+shouldBe(&quot;container.childNodes[2]&quot;, &quot;d1&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test conversion to string&quot;);
+container = document.createElement(&quot;div&quot;);
+container.prepend(null, undefined, 7);
+shouldBeType(&quot;container.childNodes[0]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[0].data&quot;, &quot;'null'&quot;);
+shouldBeType(&quot;container.childNodes[1]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[1].data&quot;, &quot;'undefined'&quot;);
+shouldBeType(&quot;container.childNodes[2]&quot;, &quot;Text&quot;);
+shouldBe(&quot;container.childNodes[2].data&quot;, &quot;'7'&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test no parameters&quot;);
+container = document.createElement(&quot;div&quot;);
+shouldNotThrow(&quot;container.prepend()&quot;);
+shouldBe(&quot;container.childNodes.length&quot;, &quot;0&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test error condition of self-prepending.&quot;);
+container = document.createElement(&quot;div&quot;);
+shouldThrow(&quot;container.prepend(container)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test DocumentFragment.prepend((Node or DOMString)...).&quot;);
+var fragment = document.createDocumentFragment();
+d1 = document.createElement(&quot;div&quot;);
+fragment.prepend(d1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;fragment&quot;);
+debug(&quot;&quot;);
+
+
+debug(&quot;Test Document.prepend((Node or DOMString)...).&quot;);
+debug(&quot;&quot;)
+debug(&quot;Test simple case of single child prepend.&quot;)
+var doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+d1 = doc.createElement(&quot;div&quot;);
+doc.prepend(d1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;doc&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test case prepending a root element and a comment.&quot;)
+var doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+d1 = doc.createElement(&quot;div&quot;);
+c1 = doc.createComment(&quot;comment text&quot;);
+doc.prepend(d1, c1);
+shouldBe(&quot;d1.parentNode&quot;, &quot;doc&quot;);
+shouldBe(&quot;c1.parentNode&quot;, &quot;doc&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test error condition prepending a second root element.&quot;)
+doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+d1 = doc.createElement(&quot;div&quot;);
+d2 = doc.createElement(&quot;div&quot;);
+doc.appendChild(d1);
+shouldThrow(&quot;doc.prepend(d2)&quot;);
+debug(&quot;&quot;);
+
+debug(&quot;Test error condition prepending Text node as the root element.&quot;)
+doc = document.implementation.createHTMLDocument();
+while (doc.firstChild)
+    doc.firstChild.remove();
+shouldThrow(&quot;doc.prepend('hello')&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -1088,6 +1088,7 @@
</span><span class="cx">     bindings/js/JSCallbackData.cpp
</span><span class="cx">     bindings/js/JSCanvasRenderingContext2DCustom.cpp
</span><span class="cx">     bindings/js/JSCanvasRenderingContextCustom.cpp
</span><ins>+    bindings/js/JSCharacterDataCustom.cpp
</ins><span class="cx">     bindings/js/JSCommandLineAPIHostCustom.cpp
</span><span class="cx">     bindings/js/JSCryptoAlgorithmBuilder.cpp
</span><span class="cx">     bindings/js/JSCryptoAlgorithmDictionary.cpp
</span><span class="lines">@@ -1119,6 +1120,8 @@
</span><span class="cx">     bindings/js/JSDeviceOrientationEventCustom.cpp
</span><span class="cx">     bindings/js/JSDictionary.cpp
</span><span class="cx">     bindings/js/JSDocumentCustom.cpp
</span><ins>+    bindings/js/JSDocumentFragmentCustom.cpp
+    bindings/js/JSDocumentTypeCustom.cpp
</ins><span class="cx">     bindings/js/JSElementCustom.cpp
</span><span class="cx">     bindings/js/JSErrorHandler.cpp
</span><span class="cx">     bindings/js/JSEventCustom.cpp
</span><span class="lines">@@ -1168,6 +1171,7 @@
</span><span class="cx">     bindings/js/JSNodeFilterCondition.cpp
</span><span class="cx">     bindings/js/JSNodeFilterCustom.cpp
</span><span class="cx">     bindings/js/JSNodeIteratorCustom.cpp
</span><ins>+    bindings/js/JSNodeOrString.cpp
</ins><span class="cx">     bindings/js/JSNodeListCustom.cpp
</span><span class="cx">     bindings/js/JSOscillatorNodeCustom.cpp
</span><span class="cx">     bindings/js/JSPannerNodeCustom.cpp
</span><span class="lines">@@ -1444,6 +1448,7 @@
</span><span class="cx">     dom/NodeFilter.cpp
</span><span class="cx">     dom/NodeFilterCondition.cpp
</span><span class="cx">     dom/NodeIterator.cpp
</span><ins>+    dom/NodeOrString.cpp
</ins><span class="cx">     dom/NodeRareData.cpp
</span><span class="cx">     dom/NodeRenderingTraversal.cpp
</span><span class="cx">     dom/NodeTraversal.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/ChangeLog        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -1,3 +1,93 @@
</span><ins>+2015-07-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        DOM4: prepend, append, before, after &amp; replace
+        https://bugs.webkit.org/show_bug.cgi?id=74648
+
+        Reviewed by Darin Adler.
+
+        - Adds support for ChildNode.before/after/replaceWith and ParentNode.prepend/append
+          which are new functions in https://dom.spec.whatwg.org
+        - Uses custom bindings rather than implementing support for union types in the code
+          generator as their uses seems isolated to just this spec at the moment. If more
+          uses come along, we should implement proper support for them in the generator and
+          remove the custom bindings added here.
+
+        Tests: fast/dom/ChildNode-after.html
+               fast/dom/ChildNode-before.html
+               fast/dom/ChildNode-replaceWith.html
+               fast/dom/ParentNode-append.html
+               fast/dom/ParentNode-prepend.html
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        Add new files.
+
+        * bindings/js/JSCharacterDataCustom.cpp: Added.
+        (WebCore::JSCharacterData::before):
+        (WebCore::JSCharacterData::after):
+        (WebCore::JSCharacterData::replaceWith):
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::JSDocument::prepend):
+        (WebCore::JSDocument::append):
+        (WebCore::JSDocument::createTouchList):
+        * bindings/js/JSDocumentFragmentCustom.cpp: Added.
+        (WebCore::JSDocumentFragment::prepend):
+        (WebCore::JSDocumentFragment::append):
+        * bindings/js/JSDocumentTypeCustom.cpp: Added.
+        (WebCore::JSDocumentType::before):
+        (WebCore::JSDocumentType::after):
+        (WebCore::JSDocumentType::replaceWith):
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        (WebCore::JSElement::before):
+        (WebCore::JSElement::after):
+        (WebCore::JSElement::replaceWith):
+        (WebCore::JSElement::prepend):
+        (WebCore::JSElement::append):
+        Add custom bindings to implement the use of variadic union types.
+
+        * bindings/js/JSNodeOrString.cpp: Added.
+        (WebCore::toNodeOrStringVector):
+        * bindings/js/JSNodeOrString.h: Added.
+        Adds a help function for converting an JS argument list into a Vector
+        of NodeOrString objects.
+
+        * dom/ChildNode.idl:
+        Expose before/after/replaceWith to JavaScript.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::append):
+        (WebCore::ContainerNode::prepend):
+        * dom/ContainerNode.h:
+        Add implementations of append and prepend.
+
+        * dom/Node.h:
+        * dom/Node.cpp:
+        (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
+        (WebCore::firstPrecedingSiblingNotInNodeSet):
+        (WebCore::firstFollowingSiblingNotInNodeSet):
+        Helper functions for before, after and removeWith.
+
+        (WebCore::Node::before):
+        (WebCore::Node::after):
+        (WebCore::Node::replaceWith):
+        Add implementations of before, after and removeWith.
+
+        * dom/NodeOrString.cpp: Added.
+        (WebCore::convertNodesOrStringsIntoNode):
+        * dom/NodeOrString.h: Added.
+        (WebCore::NodeOrString::NodeOrString):
+        (WebCore::NodeOrString::~NodeOrString):
+        (WebCore::NodeOrString::type):
+        (WebCore::NodeOrString::node):
+        (WebCore::NodeOrString::string):
+        Custom union type representing the (Node or DOMString) IDL type.
+
+        * dom/ParentNode.idl:
+        Expose append/prepend to JavaScript.
+
</ins><span class="cx"> 2015-07-13  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Unreviewed build fix.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -13835,6 +13835,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\dom\NodeOrString.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\dom\NodeRareData.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -16679,6 +16693,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\bindings\js\JSCharacterDataCustom.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\bindings\js\JSCDATASectionCustom.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -16875,6 +16903,34 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\bindings\js\JSDocumentFragmentCustom.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\bindings\js\JSDocumentTypeCustom.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\bindings\js\JSDOMBinding.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -17590,6 +17646,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\bindings\js\JSNodeOrString.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\bindings\js\JSNodeFilterCondition.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -21205,6 +21275,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\NodeFilter.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\NodeFilterCondition.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\NodeIterator.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\dom\NodeOrString.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\dom\NodeTraversal.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\OverflowEvent.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\PageTransitionEvent.h&quot; /&gt;
</span><span class="lines">@@ -21600,6 +21671,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bindings\js\JSMessagePortCustom.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bindings\js\JSMutationCallback.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bindings\js\JSNodeCustom.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\bindings\js\JSNodeOrString.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\bindings\js\JSNodeFilterCondition.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bindings\js\JSPluginElementFunctions.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bindings\js\JSWorkerGlobalScopeBase.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -2533,6 +2533,9 @@
</span><span class="cx">                 7C1E97281A9F9834007BF0FB /* AutoFillButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */; };
</span><span class="cx">                 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
</span><span class="cx">                 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; };
</span><ins>+                7C33F35A1B4A044800502CAF /* JSCharacterDataCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */; };
+                7C33F35E1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C33F35C1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp */; };
+                7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */; };
</ins><span class="cx">                 7C3B79711908757B00B47A2D /* UserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */; };
</span><span class="cx">                 7C3B79721908757B00B47A2D /* UserMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3B79701908757B00B47A2D /* UserMessageHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C3E510A18DF8F3500C112F7 /* HTMLConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3E510818DF8F3500C112F7 /* HTMLConverter.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2564,6 +2567,8 @@
</span><span class="cx">                 7C74D43818823B1900E5ED57 /* UTextProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43618823B1900E5ED57 /* UTextProvider.h */; };
</span><span class="cx">                 7C74D43B1882400400E5ED57 /* UTextProviderUTF16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */; };
</span><span class="cx">                 7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */; };
</span><ins>+                7C91A38F1B498ABE003F9EFA /* JSNodeOrString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */; };
+                7C91A3901B498ABE003F9EFA /* JSNodeOrString.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */; };
</ins><span class="cx">                 7C93F3491AA6BA5E00A98BAB /* CompiledContentExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C93F3471AA6BA5E00A98BAB /* CompiledContentExtension.cpp */; };
</span><span class="cx">                 7C93F34A1AA6BA5E00A98BAB /* CompiledContentExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C93F3481AA6BA5E00A98BAB /* CompiledContentExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C93F34D1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C93F34B1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp */; };
</span><span class="lines">@@ -2584,6 +2589,8 @@
</span><span class="cx">                 7CE683471921821500F4D928 /* UserMessageHandlerDescriptorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE683461921821500F4D928 /* UserMessageHandlerDescriptorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7CE6CBFB187F370700D46BF5 /* FormatConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE6CBFA187F370700D46BF5 /* FormatConverter.h */; };
</span><span class="cx">                 7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE6CBFC187F394900D46BF5 /* FormatConverter.cpp */; };
</span><ins>+                7CEAC1071B483D1D00334482 /* NodeOrString.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CEAC1061B483D1D00334482 /* NodeOrString.h */; };
+                7CEAC1091B483D7F00334482 /* NodeOrString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CEAC1081B483D7F00334482 /* NodeOrString.cpp */; };
</ins><span class="cx">                 7CFDC57C1AC1D80500E24A57 /* ContentExtensionError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFDC57A1AC1D80500E24A57 /* ContentExtensionError.cpp */; };
</span><span class="cx">                 7CFDC57D1AC1D80500E24A57 /* ContentExtensionError.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CFDC57B1AC1D80500E24A57 /* ContentExtensionError.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7D741BDA177226AA00859170 /* CSSValueKeywords.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 6565814809D13043000E61D7 /* CSSValueKeywords.h */; };
</span><span class="lines">@@ -9843,6 +9850,9 @@
</span><span class="cx">                 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoFillButtonElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCharacterDataCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C33F35C1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentTypeCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C3B79701908757B00B47A2D /* UserMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C3E510818DF8F3500C112F7 /* HTMLConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLConverter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9885,6 +9895,8 @@
</span><span class="cx">                 7C74D43618823B1900E5ED57 /* UTextProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderUTF16.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderUTF16.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeOrString.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeOrString.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C93F3471AA6BA5E00A98BAB /* CompiledContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompiledContentExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C93F3481AA6BA5E00A98BAB /* CompiledContentExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompiledContentExtension.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C93F34B1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionCompiler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9905,6 +9917,8 @@
</span><span class="cx">                 7CE683461921821500F4D928 /* UserMessageHandlerDescriptorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandlerDescriptorTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CE6CBFA187F370700D46BF5 /* FormatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormatConverter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CE6CBFC187F394900D46BF5 /* FormatConverter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormatConverter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7CEAC1061B483D1D00334482 /* NodeOrString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeOrString.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7CEAC1081B483D7F00334482 /* NodeOrString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodeOrString.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7CFDC57A1AC1D80500E24A57 /* ContentExtensionError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionError.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CFDC57B1AC1D80500E24A57 /* ContentExtensionError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubresourceLoaderCF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -21282,6 +21296,8 @@
</span><span class="cx">                                 BCBFB53A0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp */,
</span><span class="cx">                                 BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowShell.h */,
</span><span class="cx">                                 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
</span><ins>+                                7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */,
+                                7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */,
</ins><span class="cx">                                 F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */,
</span><span class="cx">                                 F3D461471161D53200CA0D09 /* JSErrorHandler.h */,
</span><span class="cx">                                 BC60901E0E91B8EC000C68B5 /* JSEventTargetCustom.cpp */,
</span><span class="lines">@@ -21388,6 +21404,9 @@
</span><span class="cx">                                 49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */,
</span><span class="cx">                                 49EED14D1051971A00099FAB /* JSCanvasRenderingContextCustom.cpp */,
</span><span class="cx">                                 93BA59B10F2AA5FE008E8E99 /* JSCDATASectionCustom.cpp */,
</span><ins>+                                7C33F3581B4A044800502CAF /* JSCharacterDataCustom.cpp */,
+                                7C33F35C1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp */,
+                                7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */,
</ins><span class="cx">                                 A584FE371864DAC100843B10 /* JSCommandLineAPIHostCustom.cpp */,
</span><span class="cx">                                 209B456A16796A7E00E54E4E /* JSCryptoCustom.cpp */,
</span><span class="cx">                                 E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */,
</span><span class="lines">@@ -23278,6 +23297,8 @@
</span><span class="cx">                                 1A750D870A90E394000FF215 /* NodeIterator.idl */,
</span><span class="cx">                                 A81872100977D3C0005826D9 /* NodeList.h */,
</span><span class="cx">                                 85ACA9FA0A9B631000671E90 /* NodeList.idl */,
</span><ins>+                                7CEAC1081B483D7F00334482 /* NodeOrString.cpp */,
+                                7CEAC1061B483D1D00334482 /* NodeOrString.h */,
</ins><span class="cx">                                 4FAB48661643A67E00F70C07 /* NodeRareData.cpp */,
</span><span class="cx">                                 63189AE20E83A33300012E41 /* NodeRareData.h */,
</span><span class="cx">                                 A7211F231678A54200957444 /* NodeRenderingTraversal.cpp */,
</span><span class="lines">@@ -24787,6 +24808,7 @@
</span><span class="cx">                                 A74BB76B13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h in Headers */,
</span><span class="cx">                                 148AFDA50AF58360008CC700 /* ExceptionHandlers.h in Headers */,
</span><span class="cx">                                 9767CE0B145ABC13005E64DB /* ExceptionHeaders.h in Headers */,
</span><ins>+                                7C91A3901B498ABE003F9EFA /* JSNodeOrString.h in Headers */,
</ins><span class="cx">                                 46F3E3FA1B2109100087ED13 /* VNodeTracker.h in Headers */,
</span><span class="cx">                                 9767CE0C145ABC13005E64DB /* ExceptionInterfaces.h in Headers */,
</span><span class="cx">                                 6E67D2A91280E8BD008758F7 /* Extensions3D.h in Headers */,
</span><span class="lines">@@ -24957,6 +24979,7 @@
</span><span class="cx">                                 FD31609D12B026F700C1A359 /* HRTFElevation.h in Headers */,
</span><span class="cx">                                 FD31609F12B026F700C1A359 /* HRTFKernel.h in Headers */,
</span><span class="cx">                                 FD3160A112B026F700C1A359 /* HRTFPanner.h in Headers */,
</span><ins>+                                7CEAC1071B483D1D00334482 /* NodeOrString.h in Headers */,
</ins><span class="cx">                                 BC97E23A109144950010D361 /* HTMLAllCollection.h in Headers */,
</span><span class="cx">                                 A8CFF7AB0A156978000A4234 /* HTMLAnchorElement.h in Headers */,
</span><span class="cx">                                 A871D45D0A127CBC00B12A68 /* HTMLAppletElement.h in Headers */,
</span><span class="lines">@@ -27749,6 +27772,7 @@
</span><span class="cx">                                 070363E7181A1CDC00C074A5 /* AVVideoCaptureSource.mm in Sources */,
</span><span class="cx">                                 F45C231D1995B73B00A6E2E3 /* AxisScrollSnapOffsets.cpp in Sources */,
</span><span class="cx">                                 37F57ACF1A5072DD00876F98 /* AXObjectCache.cpp in Sources */,
</span><ins>+                                7C33F35E1B4A04CE00502CAF /* JSDocumentTypeCustom.cpp in Sources */,
</ins><span class="cx">                                 AAA728F916D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm in Sources */,
</span><span class="cx">                                 29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
</span><span class="cx">                                 BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
</span><span class="lines">@@ -27851,6 +27875,7 @@
</span><span class="cx">                                 BCC0657D0F3CE1B700CD2D87 /* ClientRect.cpp in Sources */,
</span><span class="cx">                                 BCC065800F3CE1B700CD2D87 /* ClientRectList.cpp in Sources */,
</span><span class="cx">                                 85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */,
</span><ins>+                                7CEAC1091B483D7F00334482 /* NodeOrString.cpp in Sources */,
</ins><span class="cx">                                 580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */,
</span><span class="cx">                                 CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
</span><span class="cx">                                 CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */,
</span><span class="lines">@@ -28198,6 +28223,7 @@
</span><span class="cx">                                 85DF2F9C0AA3CAE500AD64C5 /* DOMHTMLOptionsCollection.mm in Sources */,
</span><span class="cx">                                 85183B470AA6926100F19FA3 /* DOMHTMLParagraphElement.mm in Sources */,
</span><span class="cx">                                 85ECBEF80AA7626900544F0B /* DOMHTMLParamElement.mm in Sources */,
</span><ins>+                                7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */,
</ins><span class="cx">                                 85183B490AA6926100F19FA3 /* DOMHTMLPreElement.mm in Sources */,
</span><span class="cx">                                 A4226E961163D73A008B8397 /* DOMHTMLProgressElement.mm in Sources */,
</span><span class="cx">                                 85183B4B0AA6926100F19FA3 /* DOMHTMLQuoteElement.mm in Sources */,
</span><span class="lines">@@ -28268,6 +28294,7 @@
</span><span class="cx">                                 8AD0A59714C88358000D83C5 /* DOMWebKitCSSRegionRule.mm in Sources */,
</span><span class="cx">                                 31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */,
</span><span class="cx">                                 3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */,
</span><ins>+                                7C91A38F1B498ABE003F9EFA /* JSNodeOrString.cpp in Sources */,
</ins><span class="cx">                                 8A195933147EA16E00D1EA61 /* DOMWebKitNamedFlow.mm in Sources */,
</span><span class="cx">                                 31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
</span><span class="cx">                                 85C7F5E80AAFBAFB004014DD /* DOMWheelEvent.mm in Sources */,
</span><span class="lines">@@ -29475,6 +29502,7 @@
</span><span class="cx">                                 BCE1C41C0D982981003B02F2 /* Location.cpp in Sources */,
</span><span class="cx">                                 A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */,
</span><span class="cx">                                 1402645E0AFDC19B005919E2 /* LoggingMac.mm in Sources */,
</span><ins>+                                7C33F35A1B4A044800502CAF /* JSCharacterDataCustom.cpp in Sources */,
</ins><span class="cx">                                 1A0409F31A43675C009E47F3 /* MachSendRight.cpp in Sources */,
</span><span class="cx">                                 932AD70517EFA2C30038F8FF /* MainFrame.cpp in Sources */,
</span><span class="cx">                                 1A8F6BC50DB55CDC001DB794 /* ManifestParser.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;JSCallbackData.cpp&quot;
</span><span class="cx"> #include &quot;JSCanvasRenderingContext2DCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSCanvasRenderingContextCustom.cpp&quot;
</span><ins>+#include &quot;JSCharacterDataCustom.cpp&quot;
</ins><span class="cx"> #include &quot;JSCommandLineAPIHostCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSCryptoCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSCustomSQLStatementErrorCallback.cpp&quot;
</span><span class="lines">@@ -66,6 +67,8 @@
</span><span class="cx"> #include &quot;JSDeviceOrientationEventCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSDictionary.cpp&quot;
</span><span class="cx"> #include &quot;JSDocumentCustom.cpp&quot;
</span><ins>+#include &quot;JSDocumentFragmentCustom.cpp&quot;
+#include &quot;JSDocumentTypeCustom.cpp&quot;
</ins><span class="cx"> #include &quot;JSElementCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSErrorHandler.cpp&quot;
</span><span class="cx"> #include &quot;JSEventCustom.cpp&quot;
</span><span class="lines">@@ -109,6 +112,7 @@
</span><span class="cx"> #include &quot;JSNodeFilterCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSNodeIteratorCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSNodeListCustom.cpp&quot;
</span><ins>+#include &quot;JSNodeOrString.cpp&quot;
</ins><span class="cx"> #include &quot;JSPluginElementFunctions.cpp&quot;
</span><span class="cx"> #include &quot;JSPopStateEventCustom.cpp&quot;
</span><span class="cx"> #if ENABLE(STREAMS_API)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCharacterDataCustomcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSCharacterDataCustom.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+#include &quot;JSCharacterData.h&quot;
+
+#include &quot;ExceptionCode.h&quot;
+#include &quot;JSNodeOrString.h&quot;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSCharacterData::before(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().before(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSCharacterData::after(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().after(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSCharacterData::replaceWith(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().replaceWith(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -28,11 +28,12 @@
</span><span class="cx"> #include &quot;JSDOMWindowCustom.h&quot;
</span><span class="cx"> #include &quot;JSHTMLDocument.h&quot;
</span><span class="cx"> #include &quot;JSLocation.h&quot;
</span><ins>+#include &quot;JSNodeOrString.h&quot;
</ins><span class="cx"> #include &quot;JSSVGDocument.h&quot;
</span><span class="cx"> #include &quot;Location.h&quot;
</span><span class="cx"> #include &quot;NodeTraversal.h&quot;
</span><ins>+#include &quot;SVGDocument.h&quot;
</ins><span class="cx"> #include &quot;ScriptController.h&quot;
</span><del>-#include &quot;SVGDocument.h&quot;
</del><span class="cx"> #include &quot;TouchList.h&quot;
</span><span class="cx"> #include &lt;wtf/GetPtr.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -117,6 +118,24 @@
</span><span class="cx">     return wrapper;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue JSDocument::prepend(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().prepend(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSDocument::append(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().append(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> JSValue JSDocument::createTouchList(ExecState* exec)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentFragmentCustomcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+#include &quot;JSDocumentFragment.h&quot;
+
+#include &quot;ExceptionCode.h&quot;
+#include &quot;JSNodeOrString.h&quot;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSDocumentFragment::prepend(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().prepend(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSDocumentFragment::append(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().append(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentTypeCustomcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDocumentTypeCustom.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+#include &quot;JSDocumentType.h&quot;
+
+#include &quot;ExceptionCode.h&quot;
+#include &quot;JSNodeOrString.h&quot;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSDocumentType::before(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().before(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSDocumentType::after(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().after(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSDocumentType::replaceWith(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().replaceWith(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSElementCustom.cpp (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSElementCustom.cpp        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/bindings/js/JSElementCustom.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSHTMLElementWrapperFactory.h&quot;
</span><span class="cx"> #include &quot;JSNodeList.h&quot;
</span><ins>+#include &quot;JSNodeOrString.h&quot;
</ins><span class="cx"> #include &quot;JSSVGElementWrapperFactory.h&quot;
</span><span class="cx"> #include &quot;NodeList.h&quot;
</span><span class="cx"> #include &quot;SVGElement.h&quot;
</span><span class="lines">@@ -66,4 +67,49 @@
</span><span class="cx">     return wrapper;    
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue JSElement::before(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().before(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSElement::after(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().after(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSElement::replaceWith(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().replaceWith(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSElement::prepend(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().prepend(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
+JSValue JSElement::append(ExecState* state)
+{
+    ExceptionCode ec = 0;
+    impl().append(toNodeOrStringVector(*state), ec);
+    setDOMException(state, ec);
+
+    return jsUndefined();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeOrStringcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+#include &quot;JSNodeOrString.h&quot;
+
+#include &quot;JSNode.h&quot;
+#include &lt;JavaScriptCore/JSString.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+Vector&lt;NodeOrString&gt; toNodeOrStringVector(ExecState&amp; state)
+{
+    size_t argumentCount = state.argumentCount();
+
+    Vector&lt;NodeOrString&gt; result;
+    result.reserveInitialCapacity(argumentCount);
+
+    for (size_t i = 0; i &lt; argumentCount; ++i) {
+        JSValue value = state.uncheckedArgument(i);
+        if (auto* node = jsDynamicCast&lt;JSNode*&gt;(value))
+            result.uncheckedAppend(&amp;node-&gt;impl());
+        else {
+            String string = value.toWTFString(&amp;state);
+            if (state.hadException())
+                return { };
+            result.uncheckedAppend(string);
+        }
+    }
+
+    return result;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeOrStringh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/JSNodeOrString.h (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeOrString.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSNodeOrString.h        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef JSNodeOrString_h
+#define JSNodeOrString_h
+
+#include &quot;NodeOrString.h&quot;
+#include &lt;wtf/Vector.h&gt;
+
+namespace JSC {
+class ExecState;
+}
+
+namespace WebCore {
+
+Vector&lt;NodeOrString&gt; toNodeOrStringVector(JSC::ExecState&amp;);
+
+} // namespace WebCore
+
+#endif // JSNodeOrStringVector_h
</ins></span></pre></div>
<a id="trunkSourceWebCoredomChildNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ChildNode.idl (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ChildNode.idl        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/dom/ChildNode.idl        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -18,16 +18,14 @@
</span><span class="cx">  * Boston, MA 02110-1301, USA.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-// DOM 4
</del><ins>+// https://dom.spec.whatwg.org/#childnode
</ins><span class="cx"> [
</span><span class="cx">     NoInterfaceObject,
</span><span class="cx"> ] interface ChildNode {
</span><del>-    // readonly attribute Element? previousElementSibling;
-    // readonly attribute Element? nextElementSibling;
-
-    // void before((Node or DOMString)... nodes);
-    // void after((Node or DOMString)... nodes);
-    // void replace((Node or DOMString)... nodes);
-    [RaisesException] void remove();
</del><ins>+#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
+    [Unscopeable, RaisesException, Custom] void before((Node or DOMString)... nodes);
+    [Unscopeable, RaisesException, Custom] void after((Node or DOMString)... nodes);
+    [Unscopeable, RaisesException, Custom] void replaceWith((Node or DOMString)... nodes);
+#endif
+    [Unscopeable, RaisesException] void remove();
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;LabelsNodeList.h&quot;
</span><span class="cx"> #include &quot;MutationEvent.h&quot;
</span><span class="cx"> #include &quot;NameNodeList.h&quot;
</span><ins>+#include &quot;NodeOrString.h&quot;
</ins><span class="cx"> #include &quot;NodeRareData.h&quot;
</span><span class="cx"> #include &quot;NodeRenderStyle.h&quot;
</span><span class="cx"> #include &quot;RadioNodeList.h&quot;
</span><span class="lines">@@ -920,6 +921,24 @@
</span><span class="cx">     return std::distance(children.begin(), children.end());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ContainerNode::append(Vector&lt;NodeOrString&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
+{
+    RefPtr&lt;Node&gt; node = convertNodesOrStringsIntoNode(*this, WTF::move(nodeOrStringVector), ec);
+    if (ec || !node)
+        return;
+
+    appendChild(node.release(), ec);
+}
+
+void ContainerNode::prepend(Vector&lt;NodeOrString&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
+{
+    RefPtr&lt;Node&gt; node = convertNodesOrStringsIntoNode(*this, WTF::move(nodeOrStringVector), ec);
+    if (ec || !node)
+        return;
+
+    insertBefore(node.release(), firstChild(), ec);
+}
+
</ins><span class="cx"> Ref&lt;HTMLCollection&gt; ContainerNode::ensureCachedHTMLCollection(CollectionType type)
</span><span class="cx"> {
</span><span class="cx">     if (HTMLCollection* collection = cachedHTMLCollection(type))
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class HTMLCollection;
</span><ins>+class NodeOrString;
</ins><span class="cx"> class QualifiedName;
</span><span class="cx"> class RenderElement;
</span><span class="cx"> 
</span><span class="lines">@@ -152,6 +153,8 @@
</span><span class="cx">     Element* firstElementChild() const;
</span><span class="cx">     Element* lastElementChild() const;
</span><span class="cx">     unsigned childElementCount() const;
</span><ins>+    void append(Vector&lt;NodeOrString&gt;&amp;&amp;, ExceptionCode&amp;);
+    void prepend(Vector&lt;NodeOrString&gt;&amp;&amp;, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     explicit ContainerNode(Document&amp;, ConstructionType = CreateContainer);
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMAllInOne.cpp        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> #include &quot;NodeFilter.cpp&quot;
</span><span class="cx"> #include &quot;NodeFilterCondition.cpp&quot;
</span><span class="cx"> #include &quot;NodeIterator.cpp&quot;
</span><ins>+#include &quot;NodeOrString.cpp&quot;
</ins><span class="cx"> #include &quot;NodeRareData.cpp&quot;
</span><span class="cx"> #include &quot;NodeRenderingTraversal.cpp&quot;
</span><span class="cx"> #include &quot;NodeTraversal.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/dom/Node.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -28,15 +28,15 @@
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;Attr.h&quot;
</span><span class="cx"> #include &quot;BeforeLoadEvent.h&quot;
</span><del>-#include &quot;ChildListMutationScope.h&quot;
-#include &quot;Chrome.h&quot;
-#include &quot;ChromeClient.h&quot;
</del><span class="cx"> #include &quot;CSSParser.h&quot;
</span><span class="cx"> #include &quot;CSSRule.h&quot;
</span><span class="cx"> #include &quot;CSSSelector.h&quot;
</span><span class="cx"> #include &quot;CSSSelectorList.h&quot;
</span><span class="cx"> #include &quot;CSSStyleRule.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><ins>+#include &quot;ChildListMutationScope.h&quot;
+#include &quot;Chrome.h&quot;
+#include &quot;ChromeClient.h&quot;
</ins><span class="cx"> #include &quot;ContainerNodeAlgorithms.h&quot;
</span><span class="cx"> #include &quot;ContextMenuController.h&quot;
</span><span class="cx"> #include &quot;DOMImplementation.h&quot;
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> #include &quot;KeyboardEvent.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MutationEvent.h&quot;
</span><ins>+#include &quot;NodeOrString.h&quot;
</ins><span class="cx"> #include &quot;NodeRenderStyle.h&quot;
</span><span class="cx"> #include &quot;PlatformMouseEvent.h&quot;
</span><span class="cx"> #include &quot;PlatformWheelEvent.h&quot;
</span><span class="lines">@@ -474,6 +475,96 @@
</span><span class="cx">     return downcast&lt;ContainerNode&gt;(*this).appendChild(newChild, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static HashSet&lt;RefPtr&lt;Node&gt;&gt; nodeSetPreTransformedFromNodeOrStringVector(const Vector&lt;NodeOrString&gt;&amp; nodeOrStringVector)
+{
+    HashSet&lt;RefPtr&lt;Node&gt;&gt; nodeSet;
+    for (auto&amp; nodeOrString : nodeOrStringVector) {
+        switch (nodeOrString.type()) {
+        case NodeOrString::Type::String:
+            break;
+        case NodeOrString::Type::Node:
+            nodeSet.add(&amp;nodeOrString.node());
+            break;
+        }
+    }
+
+    return nodeSet;
+}
+
+static RefPtr&lt;Node&gt; firstPrecedingSiblingNotInNodeSet(Node&amp; context, const HashSet&lt;RefPtr&lt;Node&gt;&gt;&amp; nodeSet)
+{
+    for (auto* sibling = context.previousSibling(); sibling; sibling = sibling-&gt;previousSibling()) {
+        if (!nodeSet.contains(sibling))
+            return sibling;
+    }
+    return nullptr;
+}
+
+static RefPtr&lt;Node&gt; firstFollowingSiblingNotInNodeSet(Node&amp; context, const HashSet&lt;RefPtr&lt;Node&gt;&gt;&amp; nodeSet)
+{
+    for (auto* sibling = context.nextSibling(); sibling; sibling = sibling-&gt;nextSibling()) {
+        if (!nodeSet.contains(sibling))
+            return sibling;
+    }
+    return nullptr;
+}
+
+void Node::before(Vector&lt;NodeOrString&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
+{
+    RefPtr&lt;ContainerNode&gt; parent = parentNode();
+    if (!parent)
+        return;
+
+    auto nodeSet = nodeSetPreTransformedFromNodeOrStringVector(nodeOrStringVector);
+    auto viablePreviousSibling = firstPrecedingSiblingNotInNodeSet(*this, nodeSet);
+
+    auto node = convertNodesOrStringsIntoNode(*this, WTF::move(nodeOrStringVector), ec);
+    if (ec || !node)
+        return;
+
+    if (viablePreviousSibling)
+        viablePreviousSibling = viablePreviousSibling-&gt;nextSibling();
+    else
+        viablePreviousSibling = parent-&gt;firstChild();
+
+    parent-&gt;insertBefore(node.release(), viablePreviousSibling.get(), ec);
+}
+
+void Node::after(Vector&lt;NodeOrString&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
+{
+    RefPtr&lt;ContainerNode&gt; parent = parentNode();
+    if (!parent)
+        return;
+
+    auto nodeSet = nodeSetPreTransformedFromNodeOrStringVector(nodeOrStringVector);
+    auto viableNextSibling = firstFollowingSiblingNotInNodeSet(*this, nodeSet);
+
+    auto node = convertNodesOrStringsIntoNode(*this, WTF::move(nodeOrStringVector), ec);
+    if (ec || !node)
+        return;
+
+    parent-&gt;insertBefore(node.release(), viableNextSibling.get(), ec);
+}
+
+void Node::replaceWith(Vector&lt;NodeOrString&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
+{
+    RefPtr&lt;ContainerNode&gt; parent = parentNode();
+    if (!parent)
+        return;
+
+    auto nodeSet = nodeSetPreTransformedFromNodeOrStringVector(nodeOrStringVector);
+    auto viableNextSibling = firstFollowingSiblingNotInNodeSet(*this, nodeSet);
+
+    auto node = convertNodesOrStringsIntoNode(*this, WTF::move(nodeOrStringVector), ec);
+    if (ec || !node)
+        return;
+
+    if (parentNode() == parent)
+        parent-&gt;replaceChild(node.release(), this, ec);
+    else
+        parent-&gt;insertBefore(node.release(), viableNextSibling.get(), ec);
+}
+
</ins><span class="cx"> void Node::remove(ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (ContainerNode* parent = parentNode())
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/dom/Node.h        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -58,10 +58,11 @@
</span><span class="cx"> class KeyboardEvent;
</span><span class="cx"> class MathMLQualifiedName;
</span><span class="cx"> class NSResolver;
</span><ins>+class NameNodeList;
</ins><span class="cx"> class NamedNodeMap;
</span><del>-class NameNodeList;
</del><span class="cx"> class NodeList;
</span><span class="cx"> class NodeListsNodeData;
</span><ins>+class NodeOrString;
</ins><span class="cx"> class NodeRareData;
</span><span class="cx"> class QualifiedName;
</span><span class="cx"> class RadioNodeList;
</span><span class="lines">@@ -193,7 +194,6 @@
</span><span class="cx">     WEBCORE_EXPORT bool removeChild(Node* child, ExceptionCode&amp;);
</span><span class="cx">     WEBCORE_EXPORT bool appendChild(PassRefPtr&lt;Node&gt; newChild, ExceptionCode&amp;);
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void remove(ExceptionCode&amp;);
</del><span class="cx">     bool hasChildNodes() const { return firstChild(); }
</span><span class="cx"> 
</span><span class="cx">     enum class CloningOperation {
</span><span class="lines">@@ -227,6 +227,12 @@
</span><span class="cx">     Element* previousElementSibling() const;
</span><span class="cx">     Element* nextElementSibling() const;
</span><span class="cx"> 
</span><ins>+    // From the ChildNode - https://dom.spec.whatwg.org/#childnode
+    void before(Vector&lt;NodeOrString&gt;&amp;&amp;, ExceptionCode&amp;);
+    void after(Vector&lt;NodeOrString&gt;&amp;&amp;, ExceptionCode&amp;);
+    void replaceWith(Vector&lt;NodeOrString&gt;&amp;&amp;, ExceptionCode&amp;);
+    WEBCORE_EXPORT void remove(ExceptionCode&amp;);
+
</ins><span class="cx">     // Other methods (not part of DOM)
</span><span class="cx"> 
</span><span class="cx">     bool isElementNode() const { return getFlag(IsElementFlag); }
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeOrStringcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/dom/NodeOrString.cpp (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeOrString.cpp                                (rev 0)
+++ trunk/Source/WebCore/dom/NodeOrString.cpp        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 &quot;config.h&quot;
+#include &quot;NodeOrString.h&quot;
+
+#include &quot;DocumentFragment.h&quot;
+#include &quot;Text.h&quot;
+
+namespace WebCore {
+
+RefPtr&lt;Node&gt; convertNodesOrStringsIntoNode(Node&amp; context, Vector&lt;NodeOrString&gt;&amp;&amp; nodeOrStringVector, ExceptionCode&amp; ec)
+{
+    if (nodeOrStringVector.isEmpty())
+        return nullptr;
+
+    Vector&lt;RefPtr&lt;Node&gt;&gt; nodes;
+    nodes.reserveInitialCapacity(nodeOrStringVector.size());
+    for (auto&amp; nodeOrString : nodeOrStringVector) {
+        switch (nodeOrString.type()) {
+        case NodeOrString::Type::String:
+            nodes.uncheckedAppend(Text::create(context.document(), nodeOrString.string()));
+            break;
+        case NodeOrString::Type::Node:
+            nodes.uncheckedAppend(&amp;nodeOrString.node());
+            break;
+        }
+    }
+
+    RefPtr&lt;Node&gt; nodeToReturn;
+    if (nodes.size() == 1)
+        nodeToReturn = nodes.first();
+    else {
+        nodeToReturn = DocumentFragment::create(context.document());
+        for (auto&amp; node : nodes) {
+            nodeToReturn-&gt;appendChild(node, ec);
+            if (ec)
+                return nullptr;
+        }
+    }
+    
+    return WTF::move(nodeToReturn);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoredomNodeOrStringh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/dom/NodeOrString.h (0 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeOrString.h                                (rev 0)
+++ trunk/Source/WebCore/dom/NodeOrString.h        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -0,0 +1,163 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef NodeOrString_h
+#define NodeOrString_h
+
+#include &quot;Node.h&quot;
+#include &lt;wtf/StdLibExtras.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class NodeOrString {
+public:
+    enum class Type {
+        String,
+        Node
+    };
+
+    NodeOrString(const String&amp; string)
+        : m_type(Type::String)
+    {
+        m_data.string = string.impl();
+        m_data.string-&gt;ref();
+    }
+
+    NodeOrString(Node* node)
+        : m_type(Type::Node)
+    {
+        m_data.node = node;
+        m_data.node-&gt;ref();
+    }
+
+    NodeOrString(const NodeOrString&amp; other)
+        : m_type(other.m_type)
+    {
+        switch (m_type) {
+        case Type::String:
+            m_data.string = other.m_data.string;
+            m_data.string-&gt;ref();
+            break;
+        case Type::Node:
+            m_data.node = other.m_data.node;
+            m_data.node-&gt;ref();
+            break;
+        }
+    }
+
+    NodeOrString(NodeOrString&amp;&amp; other)
+        : m_type(other.m_type)
+    {
+        switch (m_type) {
+        case Type::String:
+            m_data.string = std::exchange(other.m_data.string, nullptr);
+            break;
+        case Type::Node:
+            m_data.node = std::exchange(other.m_data.node, nullptr);
+            break;
+        }
+    }
+
+    NodeOrString&amp; operator=(const NodeOrString&amp; other)
+    {
+        if (this == &amp;other)
+            return *this;
+
+        derefData();
+
+        m_type = other.m_type;
+        switch (m_type) {
+        case Type::String:
+            m_data.string = other.m_data.string;
+            m_data.string-&gt;ref();
+            break;
+        case Type::Node:
+            m_data.node = other.m_data.node;
+            m_data.node-&gt;ref();
+            break;
+        }
+
+        return *this;
+    }
+
+    NodeOrString&amp; operator=(NodeOrString&amp;&amp; other)
+    {
+        if (this == &amp;other)
+            return *this;
+
+        derefData();
+
+        m_type = other.m_type;
+        switch (m_type) {
+        case Type::String:
+            m_data.string = std::exchange(other.m_data.string, nullptr);
+            break;
+        case Type::Node:
+            m_data.node = std::exchange(other.m_data.node, nullptr);
+            break;
+        }
+
+        return *this;
+    }
+
+    ~NodeOrString()
+    {
+        derefData();
+    }
+
+    Type type() const { return m_type; }
+
+    Node&amp; node() const { ASSERT(m_type == Type::Node); ASSERT(m_data.node); return *m_data.node; }
+    StringImpl&amp; string() const { ASSERT(m_type == Type::String); ASSERT(m_data.string); return *m_data.string; }
+    
+private:
+    void derefData()
+    {
+        switch (m_type) {
+        case Type::String:
+            if (m_data.string)
+                m_data.string-&gt;deref();
+            break;
+        case Type::Node:
+            if (m_data.node)
+                m_data.node-&gt;deref();
+            break;
+        }
+    }
+
+    Type m_type;
+    union {
+        StringImpl* string;
+        Node* node;
+    } m_data;
+};
+
+RefPtr&lt;Node&gt; convertNodesOrStringsIntoNode(Node&amp; context, Vector&lt;NodeOrString&gt;&amp;&amp;, ExceptionCode&amp;);
+
+} // namespace WebCore
+
+#endif // NodeOrString_h
</ins></span></pre></div>
<a id="trunkSourceWebCoredomParentNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ParentNode.idl (186802 => 186803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ParentNode.idl        2015-07-14 15:35:48 UTC (rev 186802)
+++ trunk/Source/WebCore/dom/ParentNode.idl        2015-07-14 15:58:05 UTC (rev 186803)
</span><span class="lines">@@ -33,6 +33,13 @@
</span><span class="cx">     readonly attribute Element lastElementChild;
</span><span class="cx">     readonly attribute unsigned long childElementCount;
</span><span class="cx"> 
</span><ins>+#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
+    [Unscopeable, RaisesException, Custom] void prepend((Node or DOMString)... nodes);
+    [Unscopeable, RaisesException, Custom] void append((Node or DOMString)... nodes);
+#endif
+
+    // [Unscopeable] Element? query(DOMString relativeSelectors);
+    // [NewObject, Unscopeable] Elements queryAll(DOMString relativeSelectors);
</ins><span class="cx">     [RaisesException] Element querySelector(DOMString selectors);
</span><span class="cx">     [RaisesException] NodeList querySelectorAll(DOMString selectors);
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>