<!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>[189676] 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/189676">189676</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-09-13 19:42:06 -0700 (Sun, 13 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>CharacterData API parameters should not be optional
https://bugs.webkit.org/show_bug.cgi?id=149101
&lt;rdar://problem/22546954&gt;

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/CharacterData-appendData-expected.txt:
* web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt:

Source/WebCore:

CharacterData API parameters should not be optional as per the DOM
specification:
https://dom.spec.whatwg.org/#characterdata

The parameters are also mandatory in Firefox and Chrome. However,
those parameters are optional in WebKit. When DOMString parameters
were omitted, we would use the &quot;undefined&quot; string instead. When
unsigned long parameters were omitted, we would use 0 instead.
This patch aligns our behavior with the specification and other
major browsers.

No new tests, already covered by existing tests.

* dom/CharacterData.cpp:
(WebCore::CharacterData::appendData):
* dom/CharacterData.h:
* dom/CharacterData.idl:
* dom/Element.cpp:
(WebCore::Element::mergeWithNextTextNode):
* dom/Node.cpp:
(WebCore::Node::normalize):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::exitText):

LayoutTests:

Update existing test to reflect our web-exposed behavior change.

* fast/dom/non-numeric-values-numeric-parameters-expected.txt:
* fast/dom/script-tests/non-numeric-values-numeric-parameters.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomnonnumericvaluesnumericparametersexpectedtxt">trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomscripttestsnonnumericvaluesnumericparametersjs">trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesCharacterDataappendDataexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-appendData-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesCharacterDatasubstringDataexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatacpp">trunk/Source/WebCore/dom/CharacterData.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatah">trunk/Source/WebCore/dom/CharacterData.h</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDataidl">trunk/Source/WebCore/dom/CharacterData.idl</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParsercpp">trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/LayoutTests/ChangeLog        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-09-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        CharacterData API parameters should not be optional
+        https://bugs.webkit.org/show_bug.cgi?id=149101
+        &lt;rdar://problem/22546954&gt;
+
+        Reviewed by Sam Weinig.
+
+        Update existing test to reflect our web-exposed behavior change.
+
+        * fast/dom/non-numeric-values-numeric-parameters-expected.txt:
+        * fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
+
</ins><span class="cx"> 2015-09-12  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Another test fix after r189670.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnonnumericvaluesnumericparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -4,10 +4,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).substringData(x, 0)') is 'any type allowed'
</span><del>-PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).substringData(0, x)') is 'any type allowed'
</del><ins>+PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).substringData(0, x)') is 'any type allowed (but not omitted)'
</ins><span class="cx"> PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).insertData(x, &quot;b&quot;)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).deleteData(x, 0)') is 'any type allowed'
</span><del>-PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).deleteData(0, x)') is 'any type allowed'
</del><ins>+PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).deleteData(0, x)') is 'any type allowed (but not omitted)'
</ins><span class="cx"> PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).replaceData(x, 0, &quot;b&quot;)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('document.createTextNode(&quot;a&quot;).replaceData(0, x, &quot;b&quot;)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)') is 'any type allowed'
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomscripttestsnonnumericvaluesnumericparametersjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -186,10 +186,10 @@
</span><span class="cx"> // CharacterData
</span><span class="cx"> 
</span><span class="cx"> shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).substringData(x, 0)')&quot;, &quot;'any type allowed'&quot;);
</span><del>-shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).substringData(0, x)')&quot;, &quot;'any type allowed'&quot;);
</del><ins>+shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).substringData(0, x)')&quot;, &quot;'any type allowed (but not omitted)'&quot;);
</ins><span class="cx"> shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).insertData(x, \&quot;b\&quot;)')&quot;, &quot;'any type allowed'&quot;);
</span><span class="cx"> shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).deleteData(x, 0)')&quot;, &quot;'any type allowed'&quot;);
</span><del>-shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).deleteData(0, x)')&quot;, &quot;'any type allowed'&quot;);
</del><ins>+shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).deleteData(0, x)')&quot;, &quot;'any type allowed (but not omitted)'&quot;);
</ins><span class="cx"> shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).replaceData(x, 0, \&quot;b\&quot;)')&quot;, &quot;'any type allowed'&quot;);
</span><span class="cx"> shouldBe(&quot;nonNumericPolicy('document.createTextNode(\&quot;a\&quot;).replaceData(0, x, \&quot;b\&quot;)')&quot;, &quot;'any type allowed'&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-09-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        CharacterData API parameters should not be optional
+        https://bugs.webkit.org/show_bug.cgi?id=149101
+        &lt;rdar://problem/22546954&gt;
+
+        Reviewed by Sam Weinig.
+
+        Rebaseline W3C tests now that more checks are passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/dom/nodes/CharacterData-appendData-expected.txt:
+        * web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt:
+
</ins><span class="cx"> 2015-09-12  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         window.EventTarget should exist
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -1260,11 +1260,11 @@
</span><span class="cx"> FAIL CharacterData interface: attribute length 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 CharacterData interface: operation substringData(unsigned long,unsigned long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL CharacterData interface: operation appendData(DOMString) assert_equals: property has wrong .length expected 1 but got 0
-FAIL CharacterData interface: operation insertData(unsigned long,DOMString) assert_equals: property has wrong .length expected 2 but got 0
-FAIL CharacterData interface: operation deleteData(unsigned long,unsigned long) assert_equals: property has wrong .length expected 2 but got 0
-FAIL CharacterData interface: operation replaceData(unsigned long,unsigned long,DOMString) assert_equals: property has wrong .length expected 3 but got 0
</del><ins>+PASS CharacterData interface: operation substringData(unsigned long,unsigned long) 
+PASS CharacterData interface: operation appendData(DOMString) 
+PASS CharacterData interface: operation insertData(unsigned long,DOMString) 
+PASS CharacterData interface: operation deleteData(unsigned long,unsigned long) 
+PASS CharacterData interface: operation replaceData(unsigned long,unsigned long,DOMString) 
</ins><span class="cx"> FAIL CharacterData interface: attribute previousElementSibling 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><span class="lines">@@ -1293,25 +1293,15 @@
</span><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;data&quot; with the proper type (0) 
</span><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;length&quot; with the proper type (1) 
</span><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;substringData&quot; with the proper type (2) 
</span><del>-FAIL CharacterData interface: calling substringData(unsigned long,unsigned long) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling substringData(unsigned long,unsigned long) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;appendData&quot; with the proper type (3) 
</span><del>-FAIL CharacterData interface: calling appendData(DOMString) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling appendData(DOMString) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;insertData&quot; with the proper type (4) 
</span><del>-FAIL CharacterData interface: calling insertData(unsigned long,DOMString) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling insertData(unsigned long,DOMString) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;deleteData&quot; with the proper type (5) 
</span><del>-FAIL CharacterData interface: calling deleteData(unsigned long,unsigned long) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling deleteData(unsigned long,unsigned long) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;replaceData&quot; with the proper type (6) 
</span><del>-FAIL CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;previousElementSibling&quot; with the proper type (7) 
</span><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;nextElementSibling&quot; with the proper type (8) 
</span><span class="cx"> PASS CharacterData interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;before&quot; with the proper type (9) 
</span><span class="lines">@@ -1421,25 +1411,15 @@
</span><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;data&quot; with the proper type (0) 
</span><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;length&quot; with the proper type (1) 
</span><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;substringData&quot; with the proper type (2) 
</span><del>-FAIL CharacterData interface: calling substringData(unsigned long,unsigned long) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling substringData(unsigned long,unsigned long) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;appendData&quot; with the proper type (3) 
</span><del>-FAIL CharacterData interface: calling appendData(DOMString) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling appendData(DOMString) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;insertData&quot; with the proper type (4) 
</span><del>-FAIL CharacterData interface: calling insertData(unsigned long,DOMString) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling insertData(unsigned long,DOMString) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;deleteData&quot; with the proper type (5) 
</span><del>-FAIL CharacterData interface: calling deleteData(unsigned long,unsigned long) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling deleteData(unsigned long,unsigned long) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;replaceData&quot; with the proper type (6) 
</span><del>-FAIL CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;previousElementSibling&quot; with the proper type (7) 
</span><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;nextElementSibling&quot; with the proper type (8) 
</span><span class="cx"> PASS CharacterData interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;before&quot; with the proper type (9) 
</span><span class="lines">@@ -1545,25 +1525,15 @@
</span><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;data&quot; with the proper type (0) 
</span><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;length&quot; with the proper type (1) 
</span><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;substringData&quot; with the proper type (2) 
</span><del>-FAIL CharacterData interface: calling substringData(unsigned long,unsigned long) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling substringData(unsigned long,unsigned long) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;appendData&quot; with the proper type (3) 
</span><del>-FAIL CharacterData interface: calling appendData(DOMString) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling appendData(DOMString) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;insertData&quot; with the proper type (4) 
</span><del>-FAIL CharacterData interface: calling insertData(unsigned long,DOMString) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling insertData(unsigned long,DOMString) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;deleteData&quot; with the proper type (5) 
</span><del>-FAIL CharacterData interface: calling deleteData(unsigned long,unsigned long) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling deleteData(unsigned long,unsigned long) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;replaceData&quot; with the proper type (6) 
</span><del>-FAIL CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
-    [native code]
-}&quot; did not throw
</del><ins>+PASS CharacterData interface: calling replaceData(unsigned long,unsigned long,DOMString) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;previousElementSibling&quot; with the proper type (7) 
</span><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;nextElementSibling&quot; with the proper type (8) 
</span><span class="cx"> PASS CharacterData interface: document.createComment(&quot;abc&quot;) must inherit property &quot;before&quot; with the proper type (9) 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesCharacterDataappendDataexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-appendData-expected.txt (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-appendData-expected.txt        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-appendData-expected.txt        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -5,12 +5,12 @@
</span><span class="cx"> PASS Text.appendData(null) 
</span><span class="cx"> PASS Text.appendData(undefined) 
</span><span class="cx"> PASS Text.appendData('', 'bar') 
</span><del>-FAIL Text.appendData() assert_throws: function &quot;function () { node.appendData() }&quot; did not throw
</del><ins>+PASS Text.appendData() 
</ins><span class="cx"> PASS Comment.appendData('bar') 
</span><span class="cx"> PASS Comment.appendData('') 
</span><span class="cx"> PASS Comment.appendData(non-ASCII) 
</span><span class="cx"> PASS Comment.appendData(null) 
</span><span class="cx"> PASS Comment.appendData(undefined) 
</span><span class="cx"> PASS Comment.appendData('', 'bar') 
</span><del>-FAIL Comment.appendData() assert_throws: function &quot;function () { node.appendData() }&quot; did not throw
</del><ins>+PASS Comment.appendData() 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesCharacterDatasubstringDataexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/CharacterData-substringData-expected.txt        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL Text.substringData() with too few arguments assert_throws: function &quot;function () { node.substringData() }&quot; did not throw
</del><ins>+PASS Text.substringData() with too few arguments 
</ins><span class="cx"> PASS Text.substringData() with too many arguments 
</span><span class="cx"> PASS Text.substringData() with invalid offset 
</span><span class="cx"> PASS Text.substringData() with in-bounds offset 
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> FAIL Text.substringData() with negative count IndexSizeError: DOM Exception 1
</span><span class="cx"> PASS Text.substringData() with non-ASCII data 
</span><span class="cx"> PASS Text.substringData() with non-BMP data 
</span><del>-FAIL Comment.substringData() with too few arguments assert_throws: function &quot;function () { node.substringData() }&quot; did not throw
</del><ins>+PASS Comment.substringData() with too few arguments 
</ins><span class="cx"> PASS Comment.substringData() with too many arguments 
</span><span class="cx"> PASS Comment.substringData() with invalid offset 
</span><span class="cx"> PASS Comment.substringData() with in-bounds offset 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/Source/WebCore/ChangeLog        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-09-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        CharacterData API parameters should not be optional
+        https://bugs.webkit.org/show_bug.cgi?id=149101
+        &lt;rdar://problem/22546954&gt;
+
+        Reviewed by Sam Weinig.
+
+        CharacterData API parameters should not be optional as per the DOM
+        specification:
+        https://dom.spec.whatwg.org/#characterdata
+
+        The parameters are also mandatory in Firefox and Chrome. However,
+        those parameters are optional in WebKit. When DOMString parameters
+        were omitted, we would use the &quot;undefined&quot; string instead. When
+        unsigned long parameters were omitted, we would use 0 instead.
+        This patch aligns our behavior with the specification and other
+        major browsers.
+
+        No new tests, already covered by existing tests.
+
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::appendData):
+        * dom/CharacterData.h:
+        * dom/CharacterData.idl:
+        * dom/Element.cpp:
+        (WebCore::Element::mergeWithNextTextNode):
+        * dom/Node.cpp:
+        (WebCore::Node::normalize):
+        * xml/parser/XMLDocumentParser.cpp:
+        (WebCore::XMLDocumentParser::exitText):
+
</ins><span class="cx"> 2015-09-13  Gyuyoung Kim  &lt;gyuyoung.kim@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove all uses of PassRefPtr in crypto, storage, and history
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.cpp (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.cpp        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/Source/WebCore/dom/CharacterData.cpp        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">     return characterLengthLimit;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CharacterData::appendData(const String&amp; data, ExceptionCode&amp;)
</del><ins>+void CharacterData::appendData(const String&amp; data)
</ins><span class="cx"> {
</span><span class="cx">     String newStr = m_data;
</span><span class="cx">     newStr.append(data);
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.h (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.h        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/Source/WebCore/dom/CharacterData.h        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     WEBCORE_EXPORT void setData(const String&amp;, ExceptionCode&amp;);
</span><span class="cx">     unsigned length() const { return m_data.length(); }
</span><span class="cx">     String substringData(unsigned offset, unsigned count, ExceptionCode&amp;);
</span><del>-    void appendData(const String&amp;, ExceptionCode&amp;);
</del><ins>+    void appendData(const String&amp;);
</ins><span class="cx">     void insertData(unsigned offset, const String&amp;, ExceptionCode&amp;);
</span><span class="cx">     void deleteData(unsigned offset, unsigned count, ExceptionCode&amp;);
</span><span class="cx">     void replaceData(unsigned offset, unsigned count, const String&amp;, ExceptionCode&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDataidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.idl (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.idl        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/Source/WebCore/dom/CharacterData.idl        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -23,20 +23,15 @@
</span><span class="cx"> 
</span><span class="cx">     readonly attribute unsigned long length;
</span><span class="cx">     
</span><del>-    [TreatReturnedNullStringAs=Null, ObjCLegacyUnnamedParameters, RaisesException] DOMString substringData([IsIndex, Default=Undefined] optional unsigned long offset, 
-                                                                     [IsIndex, Default=Undefined] optional unsigned long length);
</del><ins>+    [TreatReturnedNullStringAs=Null, ObjCLegacyUnnamedParameters, RaisesException] DOMString substringData([IsIndex] unsigned long offset, [IsIndex] unsigned long length);
</ins><span class="cx"> 
</span><del>-    [RaisesException] void appendData([Default=Undefined] optional DOMString data);
</del><ins>+    void appendData(DOMString data);
</ins><span class="cx"> 
</span><del>-    [ObjCLegacyUnnamedParameters, RaisesException] void insertData([IsIndex, Default=Undefined] optional unsigned long offset, 
-                                   [Default=Undefined] optional DOMString data);
</del><ins>+    [ObjCLegacyUnnamedParameters, RaisesException] void insertData([IsIndex] unsigned long offset, DOMString data);
</ins><span class="cx"> 
</span><del>-    [ObjCLegacyUnnamedParameters, RaisesException] void deleteData([IsIndex, Default=Undefined] optional unsigned long offset, 
-                                   [IsIndex, Default=Undefined] optional unsigned long length);
</del><ins>+    [ObjCLegacyUnnamedParameters, RaisesException] void deleteData([IsIndex] unsigned long offset, [IsIndex] unsigned long length);
</ins><span class="cx"> 
</span><del>-    [ObjCLegacyUnnamedParameters, RaisesException] void replaceData([IsIndex, Default=Undefined] optional unsigned long offset, 
-                                    [IsIndex, Default=Undefined] optional unsigned long length,
-                                    [Default=Undefined] optional DOMString data);
</del><ins>+    [ObjCLegacyUnnamedParameters, RaisesException] void replaceData([IsIndex] unsigned long offset, [IsIndex] unsigned long length, DOMString data);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> CharacterData implements ChildNode;
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/Source/WebCore/dom/Element.cpp        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -2286,9 +2286,7 @@
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;Text&gt; textNode(node);
</span><span class="cx">     Ref&lt;Text&gt; textNext(downcast&lt;Text&gt;(*next));
</span><del>-    textNode-&gt;appendData(textNext-&gt;data(), ec);
-    if (ec)
-        return;
</del><ins>+    textNode-&gt;appendData(textNext-&gt;data());
</ins><span class="cx">     textNext-&gt;remove(ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/Source/WebCore/dom/Node.cpp        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -623,7 +623,7 @@
</span><span class="cx"> 
</span><span class="cx">             // Both non-empty text nodes. Merge them.
</span><span class="cx">             unsigned offset = text-&gt;length();
</span><del>-            text-&gt;appendData(nextText-&gt;data(), IGNORE_EXCEPTION);
</del><ins>+            text-&gt;appendData(nextText-&gt;data());
</ins><span class="cx">             document().textNodesMerged(nextText.get(), offset);
</span><span class="cx">             nextText-&gt;remove(IGNORE_EXCEPTION);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp (189675 => 189676)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2015-09-14 02:36:37 UTC (rev 189675)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2015-09-14 02:42:06 UTC (rev 189676)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">     if (!m_leafTextNode)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_leafTextNode-&gt;appendData(toString(m_bufferedText.data(), m_bufferedText.size()), IGNORE_EXCEPTION);
</del><ins>+    m_leafTextNode-&gt;appendData(toString(m_bufferedText.data(), m_bufferedText.size()));
</ins><span class="cx">     Vector&lt;xmlChar&gt; empty;
</span><span class="cx">     m_bufferedText.swap(empty);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>