<!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>[189240] 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/189240">189240</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-09-01 18:37:59 -0700 (Tue, 01 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Range API should throw a TypeError for null Node parameters
https://bugs.webkit.org/show_bug.cgi?id=148692

Reviewed by Ryosuke Niwa.

Source/WebCore:

Range API should throw a TypeError for null Node parameters. We currently
throw a NotFoundError.

As per the DOM specification, the Node arguments are not optional nor
nullable [1]:
https://dom.spec.whatwg.org/#range

Therefore, as per the Web IDL specification, we should throw a TypeError
if the Node parameter is null or missing:
https://heycam.github.io/webidl/#es-interface (step 1).

[1] https://heycam.github.io/webidl/#es-nullable-type

No new tests, covered by existing tests which have been
rebaselined.

* dom/Range.cpp:
(WebCore::Range::setStart):
(WebCore::Range::setEnd):
(WebCore::Range::isPointInRange):
(WebCore::Range::comparePoint):
(WebCore::Range::compareNode):
(WebCore::Range::compareBoundaryPoints):
(WebCore::Range::intersectsNode):
(WebCore::Range::insertNode):
(WebCore::Range::setStartAfter):
(WebCore::Range::setEndBefore):
(WebCore::Range::setEndAfter):
(WebCore::Range::selectNode):
(WebCore::Range::selectNodeContents):
(WebCore::Range::surroundContents):
(WebCore::Range::setStartBefore):
Set the Exception code to TypeError instead of NOT_FOUND_ERR if
the Node parameter is null.

* dom/Range.idl:
Stop marking the Node parameters as optional. They are not optional in
the specification and they are not really optional in our implementation.
Previously, if the Node parameter was missing, we would call the
implementation with a null pointer and the implementation would throw a
NotFoundError. Now that they are mandatory, the bindings will directly
throw a TypeError (as per the Web IDL spec) if the Node parameter is
missing. However, if the JavaScript explicitely passes null or undefined,
the implementation will still be called with a null pointer (because
our bindings generator does not distinguish nullable / non-nullable
parameters). For this reason, we still need to handle null pointers on
the implementation side.

LayoutTests:

Update / rebaseline existing tests.

* fast/dom/Range/range-compareNode.html:
* fast/dom/Range/range-intersectsNode-expected.txt:
* fast/text/text-combine-crash-expected.txt:
* http/tests/w3c/dom/interfaces-expected.txt:
* http/tests/w3c/dom/ranges/Range-comparePoint-2-expected.txt:
* http/tests/w3c/dom/ranges/Range-intersectsNode-binding-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomRangerangecompareNodehtml">trunk/LayoutTests/fast/dom/Range/range-compareNode.html</a></li>
<li><a href="#trunkLayoutTestsfastdomRangerangeintersectsNodeexpectedtxt">trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasttexttextcombinecrashexpectedtxt">trunk/LayoutTests/fast/text/text-combine-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsw3cdominterfacesexpectedtxt">trunk/LayoutTests/http/tests/w3c/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsw3cdomrangesRangecomparePoint2expectedtxt">trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-comparePoint-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsw3cdomrangesRangeintersectsNodebindingexpectedtxt">trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-intersectsNode-binding-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangeidl">trunk/Source/WebCore/dom/Range.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/LayoutTests/ChangeLog        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-09-01  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Range API should throw a TypeError for null Node parameters
+        https://bugs.webkit.org/show_bug.cgi?id=148692
+
+        Reviewed by Ryosuke Niwa.
+
+        Update / rebaseline existing tests.
+
+        * fast/dom/Range/range-compareNode.html:
+        * fast/dom/Range/range-intersectsNode-expected.txt:
+        * fast/text/text-combine-crash-expected.txt:
+        * http/tests/w3c/dom/interfaces-expected.txt:
+        * http/tests/w3c/dom/ranges/Range-comparePoint-2-expected.txt:
+        * http/tests/w3c/dom/ranges/Range-intersectsNode-binding-expected.txt:
+
</ins><span class="cx"> 2015-09-01  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, Layout Test http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html is failing
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomRangerangecompareNodehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Range/range-compareNode.html (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Range/range-compareNode.html        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/LayoutTests/fast/dom/Range/range-compareNode.html        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx">     try {
</span><span class="cx">         result = range.compareNode(node);
</span><span class="cx">     } catch (e) {
</span><del>-        if(e.code == DOMException.NOT_FOUND_ERR) {
</del><ins>+        if(e instanceof TypeError) {
</ins><span class="cx">             document.getElementById(&quot;test19&quot;).innerHTML = &quot;test 19 passed: deleted node&quot;;
</span><span class="cx">         } else {
</span><span class="cx">             document.getElementById(&quot;test19&quot;).innerHTML = &quot;&lt;span style=\&quot;color: red;\&quot;&gt;test 19 failed error: &quot; + e.message + &quot;&lt;/span&gt;&quot;;
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomRangerangeintersectsNodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> PASS intersects is false
</span><span class="cx"> 
</span><span class="cx"> 2.6 Node deleted
</span><del>-PASS range.intersectsNode(node) threw exception Error: NotFoundError: DOM Exception 8.
</del><ins>+PASS range.intersectsNode(node) threw exception TypeError: Type error.
</ins><span class="cx"> 
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasttexttextcombinecrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/text-combine-crash-expected.txt (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/text-combine-crash-expected.txt        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/LayoutTests/fast/text/text-combine-crash-expected.txt        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -6,12 +6,12 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> Errlog webtest_fn_1: TypeError: undefined is not an object (evaluating 'document.applets[0].addEventListener')
</span><del>-Errlog webtest_fn_2: NotFoundError: NotFoundError: DOM Exception 8
</del><ins>+Errlog webtest_fn_2: TypeError: Type error
</ins><span class="cx"> Errlog webtest_fn_3: TypeError: undefined is not an object (evaluating 'document.images[2].contentEditable=&quot;true&quot;')
</span><span class="cx"> Errlog webtest_fn_8: TypeError: null is not an object (evaluating 'lis.length')
</span><span class="cx"> Errlog webtest_fn_9: TypeError: undefined is not an object (evaluating 'document.anchors[4].setAttribute')
</span><del>-Errlog webtest_fn_10: NotFoundError: NotFoundError: DOM Exception 8
-Errlog webtest_fn_15: NotFoundError: NotFoundError: DOM Exception 8
</del><ins>+Errlog webtest_fn_10: TypeError: Type error
+Errlog webtest_fn_15: TypeError: Type error
</ins><span class="cx"> Errlog webtest_fn_16: TypeError: undefined is not an object (evaluating 'elem.parentNode')
</span><span class="cx"> Errlog webtest_fn_18: TypeError: undefined is not an object (evaluating 'document.applets[0].contentEditable=&quot;true&quot;')
</span><span class="cx"> Errlog webtest_fn_21: TypeError: undefined is not an object (evaluating 'document.anchors[4].appendChild')
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsw3cdominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/w3c/dom/interfaces-expected.txt (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/w3c/dom/interfaces-expected.txt        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/LayoutTests/http/tests/w3c/dom/interfaces-expected.txt        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -1642,15 +1642,15 @@
</span><span class="cx"> FAIL Range interface: attribute commonAncestorContainer assert_throws: getting property on prototype object must throw TypeError function &quot;function () {
</span><span class="cx">     [native code]
</span><span class="cx"> }&quot; did not throw
</span><del>-FAIL Range interface: operation setStart(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Range interface: operation setEnd(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Range interface: operation setStartBefore(Node) assert_equals: property has wrong .length expected 1 but got 0
-FAIL Range interface: operation setStartAfter(Node) assert_equals: property has wrong .length expected 1 but got 0
-FAIL Range interface: operation setEndBefore(Node) assert_equals: property has wrong .length expected 1 but got 0
-FAIL Range interface: operation setEndAfter(Node) assert_equals: property has wrong .length expected 1 but got 0
</del><ins>+FAIL Range interface: operation setStart(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 1
+FAIL Range interface: operation setEnd(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 1
+PASS Range interface: operation setStartBefore(Node) 
+PASS Range interface: operation setStartAfter(Node) 
+PASS Range interface: operation setEndBefore(Node) 
+PASS Range interface: operation setEndAfter(Node) 
</ins><span class="cx"> PASS Range interface: operation collapse(boolean) 
</span><del>-FAIL Range interface: operation selectNode(Node) assert_equals: property has wrong .length expected 1 but got 0
-FAIL Range interface: operation selectNodeContents(Node) assert_equals: property has wrong .length expected 1 but got 0
</del><ins>+PASS Range interface: operation selectNode(Node) 
+PASS Range interface: operation selectNodeContents(Node) 
</ins><span class="cx"> PASS Range interface: constant START_TO_START on interface object 
</span><span class="cx"> PASS Range interface: constant START_TO_START on interface prototype object 
</span><span class="cx"> PASS Range interface: constant START_TO_END on interface object 
</span><span class="lines">@@ -1663,13 +1663,13 @@
</span><span class="cx"> PASS Range interface: operation deleteContents() 
</span><span class="cx"> PASS Range interface: operation extractContents() 
</span><span class="cx"> PASS Range interface: operation cloneContents() 
</span><del>-FAIL Range interface: operation insertNode(Node) assert_equals: property has wrong .length expected 1 but got 0
-FAIL Range interface: operation surroundContents(Node) assert_equals: property has wrong .length expected 1 but got 0
</del><ins>+PASS Range interface: operation insertNode(Node) 
+PASS Range interface: operation surroundContents(Node) 
</ins><span class="cx"> PASS Range interface: operation cloneRange() 
</span><span class="cx"> PASS Range interface: operation detach() 
</span><del>-FAIL Range interface: operation isPointInRange(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Range interface: operation comparePoint(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL Range interface: operation intersectsNode(Node) assert_equals: property has wrong .length expected 1 but got 0
</del><ins>+FAIL Range interface: operation isPointInRange(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 1
+FAIL Range interface: operation comparePoint(Node,unsigned long) assert_equals: property has wrong .length expected 2 but got 1
+PASS Range interface: operation intersectsNode(Node) 
</ins><span class="cx"> PASS Range interface: stringifier 
</span><span class="cx"> PASS Range must be primary interface of document.createRange() 
</span><span class="cx"> PASS Stringification of document.createRange() 
</span><span class="lines">@@ -1680,72 +1680,52 @@
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;collapsed&quot; with the proper type (4) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;commonAncestorContainer&quot; with the proper type (5) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;setStart&quot; with the proper type (6) 
</span><del>-FAIL Range interface: calling setStart(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling setStart(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; did not throw
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;setEnd&quot; with the proper type (7) 
</span><del>-FAIL Range interface: calling setEnd(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling setEnd(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; did not throw
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;setStartBefore&quot; with the proper type (8) 
</span><del>-FAIL Range interface: calling setStartBefore(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setStartBefore(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;setStartAfter&quot; with the proper type (9) 
</span><del>-FAIL Range interface: calling setStartAfter(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setStartAfter(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;setEndBefore&quot; with the proper type (10) 
</span><del>-FAIL Range interface: calling setEndBefore(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setEndBefore(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;setEndAfter&quot; with the proper type (11) 
</span><del>-FAIL Range interface: calling setEndAfter(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setEndAfter(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;collapse&quot; with the proper type (12) 
</span><span class="cx"> PASS Range interface: calling collapse(boolean) on document.createRange() with too few arguments must throw TypeError 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;selectNode&quot; with the proper type (13) 
</span><del>-FAIL Range interface: calling selectNode(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling selectNode(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;selectNodeContents&quot; with the proper type (14) 
</span><del>-FAIL Range interface: calling selectNodeContents(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling selectNodeContents(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;START_TO_START&quot; with the proper type (15) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;START_TO_END&quot; with the proper type (16) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;END_TO_END&quot; with the proper type (17) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;END_TO_START&quot; with the proper type (18) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;compareBoundaryPoints&quot; with the proper type (19) 
</span><del>-FAIL Range interface: calling compareBoundaryPoints(unsigned short,Range) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling compareBoundaryPoints(unsigned short,Range) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;deleteContents&quot; with the proper type (20) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;extractContents&quot; with the proper type (21) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;cloneContents&quot; with the proper type (22) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;insertNode&quot; with the proper type (23) 
</span><del>-FAIL Range interface: calling insertNode(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling insertNode(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;surroundContents&quot; with the proper type (24) 
</span><del>-FAIL Range interface: calling surroundContents(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling surroundContents(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;cloneRange&quot; with the proper type (25) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;detach&quot; with the proper type (26) 
</span><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;isPointInRange&quot; with the proper type (27) 
</span><del>-FAIL Range interface: calling isPointInRange(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling isPointInRange(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: HierarchyRequestError: DOM Exception 3&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; did not throw
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;comparePoint&quot; with the proper type (28) 
</span><del>-FAIL Range interface: calling comparePoint(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling comparePoint(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: HierarchyRequestError: DOM Exception 3&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; threw object &quot;Error: WrongDocumentError: DOM Exception 4&quot; (&quot;WrongDocumentError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</ins><span class="cx"> PASS Range interface: document.createRange() must inherit property &quot;intersectsNode&quot; with the proper type (29) 
</span><del>-FAIL Range interface: calling intersectsNode(Node) on document.createRange() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling intersectsNode(Node) on document.createRange() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range must be primary interface of detachedRange 
</span><span class="cx"> PASS Stringification of detachedRange 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;startContainer&quot; with the proper type (0) 
</span><span class="lines">@@ -1755,72 +1735,52 @@
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;collapsed&quot; with the proper type (4) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;commonAncestorContainer&quot; with the proper type (5) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;setStart&quot; with the proper type (6) 
</span><del>-FAIL Range interface: calling setStart(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling setStart(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; did not throw
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;setEnd&quot; with the proper type (7) 
</span><del>-FAIL Range interface: calling setEnd(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling setEnd(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; did not throw
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;setStartBefore&quot; with the proper type (8) 
</span><del>-FAIL Range interface: calling setStartBefore(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setStartBefore(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;setStartAfter&quot; with the proper type (9) 
</span><del>-FAIL Range interface: calling setStartAfter(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setStartAfter(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;setEndBefore&quot; with the proper type (10) 
</span><del>-FAIL Range interface: calling setEndBefore(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setEndBefore(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;setEndAfter&quot; with the proper type (11) 
</span><del>-FAIL Range interface: calling setEndAfter(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling setEndAfter(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;collapse&quot; with the proper type (12) 
</span><span class="cx"> PASS Range interface: calling collapse(boolean) on detachedRange with too few arguments must throw TypeError 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;selectNode&quot; with the proper type (13) 
</span><del>-FAIL Range interface: calling selectNode(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling selectNode(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;selectNodeContents&quot; with the proper type (14) 
</span><del>-FAIL Range interface: calling selectNodeContents(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling selectNodeContents(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;START_TO_START&quot; with the proper type (15) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;START_TO_END&quot; with the proper type (16) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;END_TO_END&quot; with the proper type (17) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;END_TO_START&quot; with the proper type (18) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;compareBoundaryPoints&quot; with the proper type (19) 
</span><del>-FAIL Range interface: calling compareBoundaryPoints(unsigned short,Range) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling compareBoundaryPoints(unsigned short,Range) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;deleteContents&quot; with the proper type (20) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;extractContents&quot; with the proper type (21) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;cloneContents&quot; with the proper type (22) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;insertNode&quot; with the proper type (23) 
</span><del>-FAIL Range interface: calling insertNode(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling insertNode(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;surroundContents&quot; with the proper type (24) 
</span><del>-FAIL Range interface: calling surroundContents(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling surroundContents(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;cloneRange&quot; with the proper type (25) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;detach&quot; with the proper type (26) 
</span><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;isPointInRange&quot; with the proper type (27) 
</span><del>-FAIL Range interface: calling isPointInRange(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling isPointInRange(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: HierarchyRequestError: DOM Exception 3&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; did not throw
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;comparePoint&quot; with the proper type (28) 
</span><del>-FAIL Range interface: calling comparePoint(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
</del><ins>+FAIL Range interface: calling comparePoint(Node,unsigned long) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
</ins><span class="cx">     [native code]
</span><del>-}&quot; threw object &quot;Error: HierarchyRequestError: DOM Exception 3&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+}&quot; threw object &quot;Error: WrongDocumentError: DOM Exception 4&quot; (&quot;WrongDocumentError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</ins><span class="cx"> PASS Range interface: detachedRange must inherit property &quot;intersectsNode&quot; with the proper type (29) 
</span><del>-FAIL Range interface: calling intersectsNode(Node) on detachedRange with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range interface: calling intersectsNode(Node) on detachedRange with too few arguments must throw TypeError 
</ins><span class="cx"> FAIL NodeIterator interface: existence and properties of interface object assert_equals: class string of NodeIterator expected &quot;[object Function]&quot; but got &quot;[object NodeIteratorConstructor]&quot;
</span><span class="cx"> PASS NodeIterator interface object length 
</span><span class="cx"> PASS NodeIterator interface: existence and properties of interface prototype object 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsw3cdomrangesRangecomparePoint2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-comparePoint-2-expected.txt (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-comparePoint-2-expected.txt        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-comparePoint-2-expected.txt        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Range.comparePoint 
</span><del>-FAIL Range.comparePoint 1 assert_throws: function &quot;function () { r.comparePoint(null, 0) }&quot; threw object &quot;Error: HierarchyRequestError: DOM Exception 3&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Range.comparePoint 1 
</ins><span class="cx"> PASS Range.comparePoint 2 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsw3cdomrangesRangeintersectsNodebindingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-intersectsNode-binding-expected.txt (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-intersectsNode-binding-expected.txt        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/LayoutTests/http/tests/w3c/dom/ranges/Range-intersectsNode-binding-expected.txt        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx"> 
</span><del>-FAIL Calling intersectsNode without an argument or with an invalid argument should throw a TypeError. assert_throws: function &quot;function () { r.intersectsNode(); }&quot; threw object &quot;Error: NotFoundError: DOM Exception 8&quot; (&quot;NotFoundError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Calling intersectsNode without an argument or with an invalid argument should throw a TypeError. 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/Source/WebCore/ChangeLog        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -1,3 +1,58 @@
</span><ins>+2015-09-01  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Range API should throw a TypeError for null Node parameters
+        https://bugs.webkit.org/show_bug.cgi?id=148692
+
+        Reviewed by Ryosuke Niwa.
+
+        Range API should throw a TypeError for null Node parameters. We currently
+        throw a NotFoundError.
+
+        As per the DOM specification, the Node arguments are not optional nor
+        nullable [1]:
+        https://dom.spec.whatwg.org/#range
+
+        Therefore, as per the Web IDL specification, we should throw a TypeError
+        if the Node parameter is null or missing:
+        https://heycam.github.io/webidl/#es-interface (step 1).
+
+        [1] https://heycam.github.io/webidl/#es-nullable-type
+
+        No new tests, covered by existing tests which have been
+        rebaselined.
+
+        * dom/Range.cpp:
+        (WebCore::Range::setStart):
+        (WebCore::Range::setEnd):
+        (WebCore::Range::isPointInRange):
+        (WebCore::Range::comparePoint):
+        (WebCore::Range::compareNode):
+        (WebCore::Range::compareBoundaryPoints):
+        (WebCore::Range::intersectsNode):
+        (WebCore::Range::insertNode):
+        (WebCore::Range::setStartAfter):
+        (WebCore::Range::setEndBefore):
+        (WebCore::Range::setEndAfter):
+        (WebCore::Range::selectNode):
+        (WebCore::Range::selectNodeContents):
+        (WebCore::Range::surroundContents):
+        (WebCore::Range::setStartBefore):
+        Set the Exception code to TypeError instead of NOT_FOUND_ERR if
+        the Node parameter is null.
+
+        * dom/Range.idl:
+        Stop marking the Node parameters as optional. They are not optional in
+        the specification and they are not really optional in our implementation.
+        Previously, if the Node parameter was missing, we would call the
+        implementation with a null pointer and the implementation would throw a
+        NotFoundError. Now that they are mandatory, the bindings will directly
+        throw a TypeError (as per the Web IDL spec) if the Node parameter is
+        missing. However, if the JavaScript explicitely passes null or undefined,
+        the implementation will still be called with a null pointer (because
+        our bindings generator does not distinguish nullable / non-nullable
+        parameters). For this reason, we still need to handle null pointers on
+        the implementation side.
+
</ins><span class="cx"> 2015-09-01  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/Source/WebCore/dom/Range.cpp        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> void Range::setStart(PassRefPtr&lt;Node&gt; refNode, int offset, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx"> void Range::setEnd(PassRefPtr&lt;Node&gt; refNode, int offset, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -225,7 +225,7 @@
</span><span class="cx"> bool Range::isPointInRange(Node* refNode, int offset, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = HIERARCHY_REQUEST_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">     // refNode node and an offset within the node is before, same as, or after the range respectively.
</span><span class="cx"> 
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = HIERARCHY_REQUEST_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx">     // before and after(surrounds), or inside the range, respectively
</span><span class="cx"> 
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return NODE_BEFORE;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx"> short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, ExceptionCode&amp; ec) const
</span><span class="cx"> {
</span><span class="cx">     if (!sourceRange) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -489,7 +489,7 @@
</span><span class="cx">     // Returns a bool if the node intersects the range.
</span><span class="cx"> 
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -841,7 +841,7 @@
</span><span class="cx"> 
</span><span class="cx">     ec = 0;
</span><span class="cx">     if (!newNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1082,7 +1082,7 @@
</span><span class="cx"> void Range::setStartAfter(Node* refNode, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1097,7 +1097,7 @@
</span><span class="cx"> void Range::setEndBefore(Node* refNode, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1112,7 +1112,7 @@
</span><span class="cx"> void Range::setEndAfter(Node* refNode, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1127,7 +1127,7 @@
</span><span class="cx"> void Range::selectNode(Node* refNode, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1185,7 +1185,7 @@
</span><span class="cx"> void Range::selectNodeContents(Node* refNode, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1223,7 +1223,7 @@
</span><span class="cx">     RefPtr&lt;Node&gt; newParent = passNewParent;
</span><span class="cx"> 
</span><span class="cx">     if (!newParent) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1309,7 +1309,7 @@
</span><span class="cx"> void Range::setStartBefore(Node* refNode, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!refNode) {
</span><del>-        ec = NOT_FOUND_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.idl (189239 => 189240)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.idl        2015-09-02 00:54:43 UTC (rev 189239)
+++ trunk/Source/WebCore/dom/Range.idl        2015-09-02 01:37:59 UTC (rev 189240)
</span><span class="lines">@@ -32,17 +32,17 @@
</span><span class="cx">     readonly attribute boolean collapsed;
</span><span class="cx">     readonly attribute Node commonAncestorContainer;
</span><span class="cx"> 
</span><del>-    [ObjCLegacyUnnamedParameters, RaisesException] void setStart([Default=Undefined] optional Node refNode, 
</del><ins>+    [ObjCLegacyUnnamedParameters, RaisesException] void setStart(Node refNode,
</ins><span class="cx">                                  [Default=Undefined] optional long offset);
</span><del>-    [ObjCLegacyUnnamedParameters, RaisesException] void setEnd([Default=Undefined] optional Node refNode, 
</del><ins>+    [ObjCLegacyUnnamedParameters, RaisesException] void setEnd(Node refNode,
</ins><span class="cx">                                [Default=Undefined] optional long offset);
</span><del>-    [RaisesException] void setStartBefore([Default=Undefined] optional Node refNode);
-    [RaisesException] void setStartAfter([Default=Undefined] optional Node refNode);
-    [RaisesException] void setEndBefore([Default=Undefined] optional Node refNode);
-    [RaisesException] void setEndAfter([Default=Undefined] optional Node refNode);
</del><ins>+    [RaisesException] void setStartBefore(Node refNode);
+    [RaisesException] void setStartAfter(Node refNode);
+    [RaisesException] void setEndBefore(Node refNode);
+    [RaisesException] void setEndAfter(Node refNode);
</ins><span class="cx">     void collapse([Default=Undefined] optional boolean toStart);
</span><del>-    [RaisesException] void selectNode([Default=Undefined] optional Node refNode);
-    [RaisesException] void selectNodeContents([Default=Undefined] optional Node refNode);
</del><ins>+    [RaisesException] void selectNode(Node refNode);
+    [RaisesException] void selectNodeContents(Node refNode);
</ins><span class="cx"> 
</span><span class="cx">     // CompareHow
</span><span class="cx">     const unsigned short START_TO_START = 0;
</span><span class="lines">@@ -50,14 +50,13 @@
</span><span class="cx">     const unsigned short END_TO_END     = 2;
</span><span class="cx">     const unsigned short END_TO_START   = 3;
</span><span class="cx"> 
</span><del>-    [ObjCLegacyUnnamedParameters, RaisesException, ImplementedAs=compareBoundaryPointsForBindings] short compareBoundaryPoints([Default=Undefined] optional unsigned short how,
-                                               [Default=Undefined] optional Range sourceRange);
</del><ins>+    [ObjCLegacyUnnamedParameters, RaisesException, ImplementedAs=compareBoundaryPointsForBindings] short compareBoundaryPoints([Default=Undefined] optional unsigned short how, Range sourceRange);
</ins><span class="cx"> 
</span><span class="cx">     [RaisesException] void deleteContents();
</span><span class="cx">     [RaisesException] DocumentFragment extractContents();
</span><span class="cx">     [RaisesException] DocumentFragment cloneContents();
</span><del>-    [RaisesException] void insertNode([Default=Undefined] optional Node newNode);
-    [RaisesException] void surroundContents([Default=Undefined] optional Node newParent);
</del><ins>+    [RaisesException] void insertNode(Node newNode);
+    [RaisesException] void surroundContents(Node newParent);
</ins><span class="cx">     Range cloneRange();
</span><span class="cx">     DOMString toString();
</span><span class="cx"> 
</span><span class="lines">@@ -76,22 +75,18 @@
</span><span class="cx"> 
</span><span class="cx">     // WebKit extensions
</span><span class="cx"> 
</span><del>-    [RaisesException] boolean intersectsNode([Default=Undefined] optional Node refNode);
</del><ins>+    [RaisesException] short compareNode(Node refNode);
</ins><span class="cx"> 
</span><del>-    [RaisesException] short compareNode([Default=Undefined] optional Node refNode);
-
</del><span class="cx">     // CompareResults
</span><span class="cx">     const unsigned short NODE_BEFORE           = 0;
</span><span class="cx">     const unsigned short NODE_AFTER            = 1;
</span><span class="cx">     const unsigned short NODE_BEFORE_AND_AFTER = 2;
</span><span class="cx">     const unsigned short NODE_INSIDE           = 3;
</span><span class="cx"> 
</span><del>-    [RaisesException] short comparePoint([Default=Undefined] optional Node refNode, 
-                       [Default=Undefined] optional long offset);
</del><ins>+    [RaisesException] short comparePoint(Node refNode, [Default=Undefined] optional long offset);
+    [RaisesException] boolean intersectsNode(Node refNode);
+    [RaisesException] boolean isPointInRange(Node refNode, [Default=Undefined] optional long offset);
</ins><span class="cx"> 
</span><del>-    [RaisesException] boolean isPointInRange([Default=Undefined] optional Node refNode, 
-                           [Default=Undefined] optional long offset);
-
</del><span class="cx">     [RaisesException] void expand([Default=Undefined] optional DOMString unit);
</span><span class="cx"> 
</span><span class="cx"> #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
</span></span></pre>
</div>
</div>

</body>
</html>