<!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>[197139] 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/197139">197139</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-02-25 15:24:14 -0800 (Thu, 25 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
https://bugs.webkit.org/show_bug.cgi?id=154662

Reviewed by Darin Adler.

Source/WebCore:

Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute.
This has no standard equivalent and all uses in WebKit are either useless
or wrong.

Test: fast/frames/detached-frame-document-defaultCharset.html

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Deleted.
* bindings/scripts/IDLAttributes.txt:
Drop support for [TreatReturnedNullStringAs=X] entirely.

* dom/Document.cpp:
(WebCore::Document::defaultCharset):
Fall back to return &quot;UTF-8&quot; instead of the null string, similarly to
what is done in for Document.characterSet. Note that this attribute
is non-standard and is an IE extension. Firefox never supported it
and Chrome dropped it last year.

* dom/Document.idl:
- Drop extended attribute for Document.defaultCharset as the
  implementation has been updated to never return a null String.
- Drop extended attribute for Document.readyState. It was useless
  because the implementation could never return a null String.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::getAllResponseHeaders):
Update implementation to return emptyString() instead of &quot;&quot; in case
of error.

* xml/XMLHttpRequest.idl:
Drop extended attribute from XMLHttpRequest.getAllResponseHeaders().
It was useless because the implementation could never return a
null String.

* xml/XSLTProcessor.idl:
Drop extended attribute from XSLTProcessor.getParameter(). The
operation is already marked as [Custom] so the extended attribute
had no effect.

LayoutTests:

Add layout test to cover the return value of document.defaultCharset before
and after its frame is detached.

* fast/frames/detached-frame-document-defaultCharset-expected.txt: Added.
* fast/frames/detached-frame-document-defaultCharset.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentidl">trunk/Source/WebCore/dom/Document.idl</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestcpp">trunk/Source/WebCore/xml/XMLHttpRequest.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestidl">trunk/Source/WebCore/xml/XMLHttpRequest.idl</a></li>
<li><a href="#trunkSourceWebCorexmlXSLTProcessoridl">trunk/Source/WebCore/xml/XSLTProcessor.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastframesdetachedframedocumentdefaultCharsetexpectedtxt">trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastframesdetachedframedocumentdefaultCharsethtml">trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/LayoutTests/ChangeLog        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-02-25  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
+        https://bugs.webkit.org/show_bug.cgi?id=154662
+
+        Reviewed by Darin Adler.
+
+        Add layout test to cover the return value of document.defaultCharset before
+        and after its frame is detached.
+
+        * fast/frames/detached-frame-document-defaultCharset-expected.txt: Added.
+        * fast/frames/detached-frame-document-defaultCharset.html: Added.
+
</ins><span class="cx"> 2016-02-25  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Removing failure expectation for 26 editing tests that now pass on ios-simulator
</span></span></pre></div>
<a id="trunkLayoutTestsfastframesdetachedframedocumentdefaultCharsetexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset-expected.txt (0 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset-expected.txt        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Tests the value returned by document.defaultCharset before and after its frame is detached.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS childDocument.defaultCharset is &quot;ISO-8859-1&quot;
+Detaching frame.
+PASS childDocument.defaultCharset is &quot;UTF-8&quot;
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastframesdetachedframedocumentdefaultCharsethtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset.html (0 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset.html                                (rev 0)
+++ trunk/LayoutTests/fast/frames/detached-frame-document-defaultCharset.html        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Tests the value returned by document.defaultCharset before and after its frame is detached.&quot;);
+jsTestIsAsync = true;
+
+onload = function()
+{
+    childDocument = frames[0].document;
+    shouldBeEqualToString(&quot;childDocument.defaultCharset&quot;, &quot;ISO-8859-1&quot;);
+    debug(&quot;Detaching frame.&quot;);
+    document.body.removeChild(document.getElementsByTagName(&quot;iframe&quot;)[0]);
+    shouldBeEqualToString(&quot;childDocument.defaultCharset&quot;, &quot;UTF-8&quot;);
+    debug(&quot;&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/ChangeLog        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2016-02-25  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
+        https://bugs.webkit.org/show_bug.cgi?id=154662
+
+        Reviewed by Darin Adler.
+
+        Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute.
+        This has no standard equivalent and all uses in WebKit are either useless
+        or wrong.
+
+        Test: fast/frames/detached-frame-document-defaultCharset.html
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NativeToJSValue): Deleted.
+        * bindings/scripts/IDLAttributes.txt:
+        Drop support for [TreatReturnedNullStringAs=X] entirely.
+
+        * dom/Document.cpp:
+        (WebCore::Document::defaultCharset):
+        Fall back to return &quot;UTF-8&quot; instead of the null string, similarly to
+        what is done in for Document.characterSet. Note that this attribute
+        is non-standard and is an IE extension. Firefox never supported it
+        and Chrome dropped it last year.
+
+        * dom/Document.idl:
+        - Drop extended attribute for Document.defaultCharset as the
+          implementation has been updated to never return a null String.
+        - Drop extended attribute for Document.readyState. It was useless
+          because the implementation could never return a null String.
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::getAllResponseHeaders):
+        Update implementation to return emptyString() instead of &quot;&quot; in case
+        of error.
+
+        * xml/XMLHttpRequest.idl:
+        Drop extended attribute from XMLHttpRequest.getAllResponseHeaders().
+        It was useless because the implementation could never return a
+        null String.
+
+        * xml/XSLTProcessor.idl:
+        Drop extended attribute from XSLTProcessor.getParameter(). The
+        operation is already marked as [Custom] so the extended attribute
+        had no effect.
+
</ins><span class="cx"> 2016-02-25  Gavin Barraclough  &lt;barraclough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Should template RefCounter instead of RefCounter::Token
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -4260,12 +4260,6 @@
</span><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;IsStringType($type)) {
</span><span class="cx">         AddToImplIncludes(&quot;URL.h&quot;, $conditional);
</span><del>-        my $conv = $signature-&gt;extendedAttributes-&gt;{&quot;TreatReturnedNullStringAs&quot;};
-        if (defined $conv) {
-            return &quot;jsStringOrUndefined(state, $value)&quot; if $conv eq &quot;Undefined&quot;;
-
-            die &quot;Unknown value for TreatReturnedNullStringAs extended attribute&quot;;
-        }
</del><span class="cx">         return &quot;jsStringOrNull(state, $value)&quot; if $signature-&gt;isNullable;
</span><span class="cx">         AddToImplIncludes(&quot;&lt;runtime/JSString.h&gt;&quot;, $conditional);
</span><span class="cx">         return &quot;jsStringWithCache(state, $value)&quot;;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -121,7 +121,6 @@
</span><span class="cx"> SuppressToJSObject
</span><span class="cx"> TreatNullAs=NullString
</span><span class="cx"> TreatReturnedNaNDateAs=Null|NaN
</span><del>-TreatReturnedNullStringAs=Undefined
</del><span class="cx"> TreatUndefinedAs=NullString
</span><span class="cx"> TypedArray=*
</span><span class="cx"> URL
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -1294,7 +1294,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (Settings* settings = this-&gt;settings())
</span><span class="cx">         return settings-&gt;defaultTextEncodingName();
</span><del>-    return String();
</del><ins>+    return UTF8Encoding().domName();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::setCharset(const String&amp; charset)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.idl (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.idl        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/dom/Document.idl        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -188,12 +188,12 @@
</span><span class="cx">     // IE extensions
</span><span class="cx"> 
</span><span class="cx"> #if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) &amp;&amp; LANGUAGE_GOBJECT
</span><del>-    [TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
</del><ins>+    attribute DOMString charset;
</ins><span class="cx"> #else
</span><span class="cx">     [ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString charset;
</span><span class="cx"> #endif
</span><del>-    [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
-    [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState;
</del><ins>+    readonly attribute DOMString defaultCharset;
+    readonly attribute DOMString readyState;
</ins><span class="cx"> 
</span><span class="cx">     Element            elementFromPoint([Default=Undefined] optional long x, 
</span><span class="cx">                                         [Default=Undefined] optional long y);
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -961,7 +961,7 @@
</span><span class="cx"> String XMLHttpRequest::getAllResponseHeaders() const
</span><span class="cx"> {
</span><span class="cx">     if (m_state &lt; HEADERS_RECEIVED || m_error)
</span><del>-        return &quot;&quot;;
</del><ins>+        return emptyString();
</ins><span class="cx"> 
</span><span class="cx">     StringBuilder stringBuilder;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.idl (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.idl        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.idl        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     readonly attribute XMLHttpRequestUpload upload;
</span><span class="cx"> 
</span><span class="cx">     // response
</span><del>-    [TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders();
</del><ins>+    DOMString getAllResponseHeaders();
</ins><span class="cx">     DOMString? getResponseHeader(DOMString header);
</span><span class="cx">     [GetterRaisesException, CustomGetter] readonly attribute DOMString? responseText;
</span><span class="cx">     [GetterRaisesException] readonly attribute Document responseXML;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXSLTProcessoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XSLTProcessor.idl (197138 => 197139)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XSLTProcessor.idl        2016-02-25 23:12:50 UTC (rev 197138)
+++ trunk/Source/WebCore/xml/XSLTProcessor.idl        2016-02-25 23:24:14 UTC (rev 197139)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">     Document transformToDocument([Default=Undefined] optional Node source);
</span><span class="cx"> 
</span><span class="cx">     [Custom] void setParameter(DOMString namespaceURI, DOMString localName, DOMString value);
</span><del>-    [Custom, TreatReturnedNullStringAs=Undefined] DOMString getParameter(DOMString namespaceURI, DOMString localName);
</del><ins>+    [Custom] DOMString getParameter(DOMString namespaceURI, DOMString localName);
</ins><span class="cx">     [Custom] void removeParameter(DOMString namespaceURI, DOMString localName);
</span><span class="cx">     void clearParameters();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>