<!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>[200288] trunk/Source</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/200288">200288</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-04-29 22:09:10 -0700 (Fri, 29 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>First step in using &quot;enum class&quot; instead of &quot;String&quot; for enumerations in DOM
https://bugs.webkit.org/show_bug.cgi?id=157163

Reviewed by Chris Dumez.

Source/JavaScriptCore:

* runtime/JSString.h:
(JSC::jsStringWithCache): Deleted unneeded overload for AtomicString.

Source/WebCore:

This patch adds the basic support for using &quot;enum class&quot; to implement enumerations
in the C++ DOM. This is enough so we can use it for one case, but not enough for
others. For example, it correctly generates code to get an attribute, but likely
does not correctly generate code to set an attribute or call a function with an
argument type that is the new style of enum.

* bindings/scripts/CodeGenerator.pm: Cleaned up the formatting of the hashes
at the start of this file. Added a new one named stringBasedEnumerationHash
and a comment explaining that we need to eventually make it empty.
(ProcessDocument): Pass the enumerations into the GenerateInterface function.
(IsStringBasedEnumType): Added. Returns 1 for the old-style string-based enumerations,
as opposed to enumerations we use &quot;enum class&quot; for.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateInterface): Take the enumerations argument and pass it along to the
functions that generate headers and implementation files.
(EnumerationClassName): Added. Maps from an enumeration type name as seen
in the IDL file to the enumeration class name used in the C++ DOM implementation.
(EnumerationValueName): Added. Maps from an anumeration string value as seen
in the IDL file to an enumeration value name used in the C++ DOM implementatino.
(EnumerationImplementationContent): Added. Generates a string with all the content
needed in the implementation file to define the helper functions for enumerations.
(GenerateHeader): Tweak.
(GenerateImplementation): Added call to EnumerationImplementationContent.
(GenerateParametersCheck): Use toWTFString instead of toString/value, which is a
longer way of writing out the same thing.
(GenerateCallbackHeader): Tweak.
(GenerateCallbackImplementation): Added call to EnumerationImplementationContent.
(GetNativeType): Continue to return String for string-based enum types, but for
other enum types, return the result of EnumerationClassName instead.
(JSValueToNative): Use toWTFString instead of toString/value (see above), convert
to a string only for string-based enum types, and add a preliminary, probably not
yet working, version of the code for non-string-based enum types. Will finish this
in the next patch when we are trying to use one of the new enumerations for a setter
or a function argument.
(NativeToJSValue): Call the stringValue function to convert an enumeration value
into a string when it's not a string-based enumeration.

* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Regenerated.

* css/FontFace.cpp:
(WebCore::FontFace::status): Updated to return enum values rather than strings.

* css/FontFace.h: Removed unneeded forward declaration of Deprecated::ScriptValue.
Added enum class for FontFaceLoadStatus, with names that match the names from the
enumeration in the IDL, but with our standard enum capitalization style. Changed
the return value of the status function to FontFaceLoadStatus.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringh">trunk/Source/JavaScriptCore/runtime/JSString.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorecssFontFacecpp">trunk/Source/WebCore/css/FontFace.cpp</a></li>
<li><a href="#trunkSourceWebCorecssFontFaceh">trunk/Source/WebCore/css/FontFace.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-04-28  Darin Adler  &lt;darin@apple.com&gt;
+
+        First step in using &quot;enum class&quot; instead of &quot;String&quot; for enumerations in DOM
+        https://bugs.webkit.org/show_bug.cgi?id=157163
+
+        Reviewed by Chris Dumez.
+
+        * runtime/JSString.h:
+        (JSC::jsStringWithCache): Deleted unneeded overload for AtomicString.
+
</ins><span class="cx"> 2016-04-29  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC][ARMv7S] Arithmetic module results change when tiering up to DFG
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSString.h (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSString.h        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/JavaScriptCore/runtime/JSString.h        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -653,11 +653,6 @@
</span><span class="cx">     return jsStringWithCacheSlowCase(vm, *stringImpl);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE JSString* jsStringWithCache(ExecState* exec, const AtomicString&amp; s)
-{
-    return jsStringWithCache(exec, s.string());
-}
-
</del><span class="cx"> ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="cx"> {
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().length) {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/ChangeLog        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -1,3 +1,70 @@
</span><ins>+2016-04-28  Darin Adler  &lt;darin@apple.com&gt;
+
+        First step in using &quot;enum class&quot; instead of &quot;String&quot; for enumerations in DOM
+        https://bugs.webkit.org/show_bug.cgi?id=157163
+
+        Reviewed by Chris Dumez.
+
+        This patch adds the basic support for using &quot;enum class&quot; to implement enumerations
+        in the C++ DOM. This is enough so we can use it for one case, but not enough for
+        others. For example, it correctly generates code to get an attribute, but likely
+        does not correctly generate code to set an attribute or call a function with an
+        argument type that is the new style of enum.
+
+        * bindings/scripts/CodeGenerator.pm: Cleaned up the formatting of the hashes
+        at the start of this file. Added a new one named stringBasedEnumerationHash
+        and a comment explaining that we need to eventually make it empty.
+        (ProcessDocument): Pass the enumerations into the GenerateInterface function.
+        (IsStringBasedEnumType): Added. Returns 1 for the old-style string-based enumerations,
+        as opposed to enumerations we use &quot;enum class&quot; for.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateInterface): Take the enumerations argument and pass it along to the
+        functions that generate headers and implementation files.
+        (EnumerationClassName): Added. Maps from an enumeration type name as seen
+        in the IDL file to the enumeration class name used in the C++ DOM implementation.
+        (EnumerationValueName): Added. Maps from an anumeration string value as seen
+        in the IDL file to an enumeration value name used in the C++ DOM implementatino.
+        (EnumerationImplementationContent): Added. Generates a string with all the content
+        needed in the implementation file to define the helper functions for enumerations.
+        (GenerateHeader): Tweak.
+        (GenerateImplementation): Added call to EnumerationImplementationContent.
+        (GenerateParametersCheck): Use toWTFString instead of toString/value, which is a
+        longer way of writing out the same thing.
+        (GenerateCallbackHeader): Tweak.
+        (GenerateCallbackImplementation): Added call to EnumerationImplementationContent.
+        (GetNativeType): Continue to return String for string-based enum types, but for
+        other enum types, return the result of EnumerationClassName instead.
+        (JSValueToNative): Use toWTFString instead of toString/value (see above), convert
+        to a string only for string-based enum types, and add a preliminary, probably not
+        yet working, version of the code for non-string-based enum types. Will finish this
+        in the next patch when we are trying to use one of the new enumerations for a setter
+        or a function argument.
+        (NativeToJSValue): Call the stringValue function to convert an enumeration value
+        into a string when it's not a string-based enumeration.
+
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
+        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        Regenerated.
+
+        * css/FontFace.cpp:
+        (WebCore::FontFace::status): Updated to return enum values rather than strings.
+
+        * css/FontFace.h: Removed unneeded forward declaration of Deprecated::ScriptValue.
+        Added enum class for FontFaceLoadStatus, with names that match the names from the
+        enumeration in the IDL, but with our standard enum capitalization style. Changed
+        the return value of the status function to FontFaceLoadStatus.
+
</ins><span class="cx"> 2016-04-29  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -44,33 +44,55 @@
</span><span class="cx"> 
</span><span class="cx"> my $verbose = 0;
</span><span class="cx"> 
</span><del>-my %numericTypeHash = (&quot;int&quot; =&gt; 1, &quot;short&quot; =&gt; 1, &quot;long&quot; =&gt; 1, &quot;long long&quot; =&gt; 1,
-                       &quot;unsigned int&quot; =&gt; 1, &quot;unsigned short&quot; =&gt; 1,
-                       &quot;unsigned long&quot; =&gt; 1, &quot;unsigned long long&quot; =&gt; 1,
-                       &quot;float&quot; =&gt; 1, &quot;double&quot; =&gt; 1, 
-                       &quot;unrestricted float&quot; =&gt; 1, &quot;unrestricted double&quot; =&gt; 1,
-                       &quot;byte&quot; =&gt; 1, &quot;octet&quot; =&gt; 1);
</del><ins>+my %numericTypeHash = (
+    &quot;byte&quot; =&gt; 1,
+    &quot;double&quot; =&gt; 1,
+    &quot;float&quot; =&gt; 1,
+    &quot;int&quot; =&gt; 1,
+    &quot;long long&quot; =&gt; 1,
+    &quot;long&quot; =&gt; 1,
+    &quot;octet&quot; =&gt; 1,
+    &quot;short&quot; =&gt; 1,
+    &quot;unrestricted double&quot; =&gt; 1,
+    &quot;unrestricted float&quot; =&gt; 1,
+    &quot;unsigned int&quot; =&gt; 1,
+    &quot;unsigned long long&quot; =&gt; 1,
+    &quot;unsigned long&quot; =&gt; 1,
+    &quot;unsigned short&quot; =&gt; 1,
+);
</ins><span class="cx"> 
</span><del>-my %primitiveTypeHash = ( &quot;boolean&quot; =&gt; 1, &quot;void&quot; =&gt; 1, &quot;Date&quot; =&gt; 1);
</del><ins>+my %primitiveTypeHash = ( &quot;boolean&quot; =&gt; 1, &quot;void&quot; =&gt; 1, &quot;Date&quot; =&gt; 1 );
</ins><span class="cx"> 
</span><del>-my %stringTypeHash = (&quot;DOMString&quot; =&gt; 1);
</del><ins>+my %stringTypeHash = ( &quot;DOMString&quot; =&gt; 1 );
</ins><span class="cx"> 
</span><span class="cx"> # WebCore types used directly in IDL files.
</span><span class="cx"> my %webCoreTypeHash = (
</span><ins>+    &quot;Dictionary&quot; =&gt; 1,
</ins><span class="cx">     &quot;SerializedScriptValue&quot; =&gt; 1,
</span><del>-    &quot;Dictionary&quot; =&gt; 1
</del><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> my %enumTypeHash = ();
</span><span class="cx"> 
</span><del>-my %nonPointerTypeHash = (&quot;DOMTimeStamp&quot; =&gt; 1);
</del><ins>+my %nonPointerTypeHash = ( &quot;DOMTimeStamp&quot; =&gt; 1 );
</ins><span class="cx"> 
</span><del>-my %svgAttributesInHTMLHash = (&quot;class&quot; =&gt; 1, &quot;id&quot; =&gt; 1, &quot;onabort&quot; =&gt; 1, &quot;onclick&quot; =&gt; 1,
-                               &quot;onerror&quot; =&gt; 1, &quot;onload&quot; =&gt; 1, &quot;onmousedown&quot; =&gt; 1,
-                               &quot;onmouseenter&quot; =&gt; 1, &quot;onmouseleave&quot; =&gt; 1,
-                               &quot;onmousemove&quot; =&gt; 1, &quot;onmouseout&quot; =&gt; 1, &quot;onmouseover&quot; =&gt; 1,
-                               &quot;onmouseup&quot; =&gt; 1, &quot;onresize&quot; =&gt; 1, &quot;onscroll&quot; =&gt; 1,
-                               &quot;onunload&quot; =&gt; 1);
</del><ins>+my %svgAttributesInHTMLHash = (
+    &quot;class&quot; =&gt; 1,
+    &quot;id&quot; =&gt; 1,
+    &quot;onabort&quot; =&gt; 1,
+    &quot;onclick&quot; =&gt; 1,
+    &quot;onerror&quot; =&gt; 1,
+    &quot;onload&quot; =&gt; 1,
+    &quot;onmousedown&quot; =&gt; 1,
+    &quot;onmouseenter&quot; =&gt; 1,
+    &quot;onmouseleave&quot; =&gt; 1,
+    &quot;onmousemove&quot; =&gt; 1,
+    &quot;onmouseout&quot; =&gt; 1,
+    &quot;onmouseover&quot; =&gt; 1,
+    &quot;onmouseup&quot; =&gt; 1,
+    &quot;onresize&quot; =&gt; 1,
+    &quot;onscroll&quot; =&gt; 1,
+    &quot;onunload&quot; =&gt; 1,
+);
</ins><span class="cx"> 
</span><span class="cx"> my %svgTypeNeedingTearOff = (
</span><span class="cx">     &quot;SVGAngle&quot; =&gt; &quot;SVGPropertyTearOff&lt;SVGAngle&gt;&quot;,
</span><span class="lines">@@ -94,6 +116,48 @@
</span><span class="cx">     &quot;SVGMatrix&quot; =&gt; 1
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+# FIXME: Remove each enum from this hash as we convert it from the string-based
+# enumeration to using an actual enum class in the C++. Once that is done, we should
+# remove this hash and the function that calls it.
+my %stringBasedEnumerationHash = (
+    &quot;AppendMode&quot; =&gt; 1,
+    &quot;AudioContextState&quot; =&gt; 1,
+    &quot;AutoFillButtonType&quot; =&gt; 1,
+    &quot;CachePolicy&quot; =&gt; 1,
+    &quot;CanvasWindingRule&quot; =&gt; 1,
+    &quot;DeviceType&quot; =&gt; 1,
+    &quot;EndOfStreamError&quot; =&gt; 1,
+    &quot;FontFaceSetLoadStatus&quot; =&gt; 1,
+    &quot;IDBCursorDirection&quot; =&gt; 1,
+    &quot;IDBRequestReadyState&quot; =&gt; 1,
+    &quot;IDBTransactionMode&quot; =&gt; 1,
+    &quot;ImageSmoothingQuality&quot; =&gt; 1,
+    &quot;KeyType&quot; =&gt; 1,
+    &quot;KeyUsage&quot; =&gt; 1,
+    &quot;MediaControlEvent&quot; =&gt; 1,
+    &quot;MediaDeviceKind&quot; =&gt; 1,
+    &quot;MediaSessionInterruptingCategory&quot; =&gt; 1,
+    &quot;MediaSessionKind&quot; =&gt; 1,
+    &quot;MediaStreamTrackState&quot; =&gt; 1,
+    &quot;OverSampleType&quot; =&gt; 1,
+    &quot;PageOverlayType&quot; =&gt; 1,
+    &quot;RTCBundlePolicyEnum&quot; =&gt; 1,
+    &quot;RTCIceTransportPolicyEnum&quot; =&gt; 1,
+    &quot;ReferrerPolicy&quot; =&gt; 1,
+    &quot;RequestCache&quot; =&gt; 1,
+    &quot;RequestCredentials&quot; =&gt; 1,
+    &quot;RequestDestination&quot; =&gt; 1,
+    &quot;RequestMode&quot; =&gt; 1,
+    &quot;RequestRedirect&quot; =&gt; 1,
+    &quot;RequestType&quot; =&gt; 1,
+    &quot;ResourceLoadPriority&quot; =&gt; 1,
+    &quot;ResponseType&quot; =&gt; 1,
+    &quot;TextTrackKind&quot; =&gt; 1,
+    &quot;TextTrackMode&quot; =&gt; 1,
+    &quot;VideoPresentationMode&quot; =&gt; 1,
+    &quot;XMLHttpRequestResponseType&quot; =&gt; 1,
+);
+
</ins><span class="cx"> # Cache of IDL file pathnames.
</span><span class="cx"> my $idlFiles;
</span><span class="cx"> my $cachedInterfaces = {};
</span><span class="lines">@@ -141,7 +205,9 @@
</span><span class="cx">     my $interfaces = $useDocument-&gt;interfaces;
</span><span class="cx">     foreach my $interface (@$interfaces) {
</span><span class="cx">         print &quot;Generating $useGenerator bindings code for IDL interface \&quot;&quot; . $interface-&gt;name . &quot;\&quot;...\n&quot; if $verbose;
</span><del>-        $codeGenerator-&gt;GenerateInterface($interface, $defines);
</del><ins>+        # FIXME: Repeating each enumeration for every interface would not work if we actually were using
+        # multiple interfaces per file, but we aren't, so this is fine for now.
+        $codeGenerator-&gt;GenerateInterface($interface, $defines, $useDocument-&gt;enumerations);
</ins><span class="cx">         $codeGenerator-&gt;WriteData($interface, $useOutputDir, $useOutputHeadersDir);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -335,6 +401,16 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsStringBasedEnumType
+{
+    my $object = shift;
+    my $type = shift;
+
+    return 0 if !$object-&gt;IsEnumType($type);
+    return 1 if exists $stringBasedEnumerationHash{$type};
+    return 0;
+}
+
</ins><span class="cx"> sub IsEnumType
</span><span class="cx"> {
</span><span class="cx">     my $object = shift;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -123,16 +123,17 @@
</span><span class="cx">     my $object = shift;
</span><span class="cx">     my $interface = shift;
</span><span class="cx">     my $defines = shift;
</span><ins>+    my $enumerations = shift;
</ins><span class="cx"> 
</span><span class="cx">     $codeGenerator-&gt;LinkOverloadedFunctions($interface);
</span><span class="cx"> 
</span><span class="cx">     # Start actual generation
</span><span class="cx">     if ($interface-&gt;isCallback) {
</span><span class="cx">         $object-&gt;GenerateCallbackHeader($interface);
</span><del>-        $object-&gt;GenerateCallbackImplementation($interface);
</del><ins>+        $object-&gt;GenerateCallbackImplementation($interface, $enumerations);
</ins><span class="cx">     } else {
</span><span class="cx">         $object-&gt;GenerateHeader($interface);
</span><del>-        $object-&gt;GenerateImplementation($interface);
</del><ins>+        $object-&gt;GenerateImplementation($interface, $enumerations);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -830,10 +831,73 @@
</span><span class="cx">     return $name;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GetEnumerationClassName {
+    my ($name) = @_;
+    return $codeGenerator-&gt;WK_ucfirst($name);
+};
+
+sub GetEnumerationValueName {
+    my ($name) = @_;
+    return &quot;EmptyString&quot; if $name eq &quot;&quot;;
+    return $codeGenerator-&gt;WK_ucfirst($name);
+};
+
+sub GetEnumerationImplementationContent
+{
+    my ($enumerations) = @_;
+
+    my $result = &quot;&quot;;
+    foreach my $enumeration (@$enumerations) {
+        my $name = $enumeration-&gt;name;
+        next if $codeGenerator-&gt;IsStringBasedEnumType($name);
+
+        my $className = GetEnumerationClassName($name);
+
+        # Declare these instead of using &quot;static&quot; because these functions may be unused
+        # and we don't want to get warnings about unused static functions.
+        $result .= &quot;const String&amp; stringValue($className);\n&quot;;
+        $result .= &quot;Optional&lt;$className&gt; enumerationValue$className(const String&amp;);\n\n&quot;;
+
+        $result .= &quot;const String&amp; stringValue($className enumerationValue)\n&quot;;
+        $result .= &quot;{\n&quot;;
+        # FIXME: Might be nice to make this global be &quot;const&quot;, but NeverDestroyed does not currently support that.
+        # FIXME: Might be nice to make the entire array be NeverDestroyed instead of each value, but not sure the syntax for that.
+        $result .= &quot;    static NeverDestroyed&lt;const String&gt; values[] = {\n&quot;;
+        foreach my $value (@{$enumeration-&gt;values}) {
+            $result .= &quot;        ASCIILiteral(\&quot;$value\&quot;),\n&quot;;
+        }
+        $result .= &quot;    };\n&quot;;
+        my $index = 0;
+        foreach my $value (@{$enumeration-&gt;values}) {
+            my $enumerationValueName = GetEnumerationValueName($value);
+            if ($index) {
+                $result .= &quot;    static_assert(static_cast&lt;size_t&gt;($className::$enumerationValueName) == $index, \&quot;$className::$enumerationValueName is not $index as expected\&quot;);\n&quot;;
+            } else {
+                # Keep the style checker happy. Not sure I still love this style guideline.
+                $result .= &quot;    static_assert(!static_cast&lt;size_t&gt;($className::$enumerationValueName), \&quot;$className::$enumerationValueName is not $index as expected\&quot;);\n&quot;;
+            }
+            $index++;
+        }
+        $result .= &quot;    ASSERT(static_cast&lt;size_t&gt;(enumerationValue) &lt; WTF_ARRAY_LENGTH(values));\n&quot;;
+        $result .= &quot;    return values[static_cast&lt;size_t&gt;(enumerationValue)];\n&quot;;
+        $result .= &quot;}\n\n&quot;;
+
+        $result .= &quot;Optional&lt;$className&gt; enumerationValue$className(const String&amp; stringValue)\n&quot;;
+        $result .= &quot;{\n&quot;;
+        foreach my $value (@{$enumeration-&gt;values}) {
+            my $enumerationValueName = GetEnumerationValueName($value);
+            $result .= &quot;    if (stringValue == \&quot;$value\&quot;)\n&quot;;
+            $result .= &quot;        return $className::$enumerationValueName;\n&quot;;
+        }
+        $result .= &quot;    return Nullopt;\n&quot;;
+        $result .= &quot;}\n\n&quot;;
+    }
+    return $result;
+}
+
</ins><span class="cx"> sub GenerateHeader
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $interface = shift;
</del><ins>+    my ($object, $interface) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $interfaceName = $interface-&gt;name;
</span><span class="cx">     my $className = &quot;JS$interfaceName&quot;;
</span><span class="lines">@@ -1796,7 +1860,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GenerateImplementation
</span><span class="cx"> {
</span><del>-    my ($object, $interface) = @_;
</del><ins>+    my ($object, $interface, $enumerations) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $interfaceName = $interface-&gt;name;
</span><span class="cx">     my $className = &quot;JS$interfaceName&quot;;
</span><span class="lines">@@ -1828,6 +1892,8 @@
</span><span class="cx">     push(@implContent, &quot;\nusing namespace JSC;\n\n&quot;);
</span><span class="cx">     push(@implContent, &quot;namespace WebCore {\n\n&quot;);
</span><span class="cx"> 
</span><ins>+    push(@implContent, GetEnumerationImplementationContent($enumerations));
+
</ins><span class="cx">     my @functions = @{$interface-&gt;functions};
</span><span class="cx">     push(@functions, @{$interface-&gt;iterable-&gt;functions}) if $interface-&gt;iterable;
</span><span class="cx"> 
</span><span class="lines">@@ -3602,7 +3668,7 @@
</span><span class="cx">                 push(@$outputArray, &quot;    if (${argValue}.isUndefined())\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        $name = ASCIILiteral(&quot; . $parameter-&gt;default . &quot;);\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;    else {\n&quot;);
</span><del>-                push(@$outputArray, &quot;        $name = state-&gt;uncheckedArgument($argsIndex).toString(state)-&gt;value(state);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;        $name = state-&gt;uncheckedArgument($argsIndex).toWTFString(state);\n&quot;);
</ins><span class="cx">                 &amp;$exceptionCheck(&quot;    &quot;);
</span><span class="cx">                 &amp;$enumValueCheck(&quot;    &quot;);
</span><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;);
</span><span class="lines">@@ -3721,8 +3787,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GenerateCallbackHeader
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $interface = shift;
</del><ins>+    my ($object, $interface) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $interfaceName = $interface-&gt;name;
</span><span class="cx">     my $className = &quot;JS$interfaceName&quot;;
</span><span class="lines">@@ -3806,7 +3871,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GenerateCallbackImplementation
</span><span class="cx"> {
</span><del>-    my ($object, $interface) = @_;
</del><ins>+    my ($object, $interface, $enumerations) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $interfaceName = $interface-&gt;name;
</span><span class="cx">     my $visibleInterfaceName = $codeGenerator-&gt;GetVisibleInterfaceName($interface);
</span><span class="lines">@@ -3823,6 +3888,8 @@
</span><span class="cx">     push(@implContent, &quot;\nusing namespace JSC;\n\n&quot;);
</span><span class="cx">     push(@implContent, &quot;namespace WebCore {\n\n&quot;);
</span><span class="cx"> 
</span><ins>+    push(@implContent, GetEnumerationImplementationContent($enumerations));
+
</ins><span class="cx">     # Constructor
</span><span class="cx">     push(@implContent, &quot;${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n&quot;);
</span><span class="cx">     if ($interface-&gt;extendedAttributes-&gt;{&quot;CallbackNeedsOperatorEqual&quot;}) {
</span><span class="lines">@@ -4179,7 +4246,8 @@
</span><span class="cx">     my $arrayOrSequenceType = $arrayType || $sequenceType;
</span><span class="cx"> 
</span><span class="cx">     return &quot;Vector&lt;&quot; . GetNativeVectorInnerType($arrayOrSequenceType) . &quot;&gt;&quot; if $arrayOrSequenceType;
</span><del>-    return &quot;String&quot; if $codeGenerator-&gt;IsEnumType($type);
</del><ins>+    return &quot;String&quot; if $codeGenerator-&gt;IsStringBasedEnumType($type);
+    return GetEnumerationClassName($type) if $codeGenerator-&gt;IsEnumType($type);
</ins><span class="cx"> 
</span><span class="cx">     # For all other types, the native type is a pointer with same type name as the IDL type.
</span><span class="cx">     return &quot;${type}*&quot;;
</span><span class="lines">@@ -4296,7 +4364,7 @@
</span><span class="cx">         return &quot;valueToStringWithUndefinedOrNullCheck(state, $value)&quot; if $signature-&gt;isNullable;
</span><span class="cx">         return &quot;$value.toString(state)-&gt;toAtomicString(state)&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;AtomicString&quot;};
</span><span class="cx"> 
</span><del>-        return &quot;$value.toString(state)-&gt;value(state)&quot;;
</del><ins>+        return &quot;$value.toWTFString(state)&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($type eq &quot;any&quot;) {
</span><span class="lines">@@ -4342,8 +4410,11 @@
</span><span class="cx">         return &quot;toNativeArray&lt;&quot; . GetNativeVectorInnerType($arrayOrSequenceType) . &quot;&gt;(state, $value)&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    return &quot;$value.toWTFString(state)&quot; if $codeGenerator-&gt;IsStringBasedEnumType($type);
+
</ins><span class="cx">     if ($codeGenerator-&gt;IsEnumType($type)) {
</span><del>-        return &quot;$value.toString(state)-&gt;value(state)&quot;;
</del><ins>+        my $className = GetEnumerationClassName($type);
+        return &quot;enumerationValue$className($value.toWTFString(state)).value()&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Default, assume autogenerated type conversion routines
</span><span class="lines">@@ -4394,6 +4465,7 @@
</span><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;IsEnumType($type)) {
</span><span class="cx">         AddToImplIncludes(&quot;&lt;runtime/JSString.h&gt;&quot;, $conditional);
</span><ins>+        $value = &quot;stringValue($value)&quot; unless $codeGenerator-&gt;IsStringBasedEnumType($type);
</ins><span class="cx">         return &quot;jsStringWithCache(state, $value)&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String message = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String message = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.postMessage(message);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String str = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String str = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.anotherFunction(str);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestGlobalObject&quot;, &quot;regularAttribute&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setRegularAttribute(nativeValue);
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestGlobalObject&quot;, &quot;enabledAtRuntimeAttribute&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setEnabledAtRuntimeAttribute(nativeValue);
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String testParam = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String testParam = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.regularOperation(testParam);
</span><span class="lines">@@ -274,7 +274,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String testParam = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String testParam = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(testParam);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -228,10 +228,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String str1 = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String str1 = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String str2 = state-&gt;argument(1).isUndefined() ? ASCIILiteral(&quot;defaultString&quot;) : state-&gt;uncheckedArgument(1).toString(state)-&gt;value(state);
</del><ins>+    String str2 = state-&gt;argument(1).isUndefined() ? ASCIILiteral(&quot;defaultString&quot;) : state-&gt;uncheckedArgument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();
</span><span class="lines">@@ -632,7 +632,7 @@
</span><span class="cx"> bool setJSTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx">     JSValue value = JSValue::decode(encodedValue);
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     TestInterface::setImplementsStaticAttr(nativeValue);
</span><span class="lines">@@ -651,7 +651,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestInterface&quot;, &quot;implementsStr2&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setImplementsStr2(nativeValue);
</span><span class="lines">@@ -698,7 +698,7 @@
</span><span class="cx"> bool setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx">     JSValue value = JSValue::decode(encodedValue);
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     WebCore::TestSupplemental::setSupplementalStaticAttr(nativeValue);
</span><span class="lines">@@ -717,7 +717,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestInterface&quot;, &quot;supplementalStr2&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     WebCore::TestSupplemental::setSupplementalStr2(impl, nativeValue);
</span><span class="lines">@@ -795,7 +795,7 @@
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(1));
</span><span class="lines">@@ -863,7 +863,7 @@
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(1));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -86,13 +86,13 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String str1 = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String str1 = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String str2 = state-&gt;argument(1).isUndefined() ? ASCIILiteral(&quot;defaultString&quot;) : state-&gt;uncheckedArgument(1).toString(state)-&gt;value(state);
</del><ins>+    String str2 = state-&gt;argument(1).isUndefined() ? ASCIILiteral(&quot;defaultString&quot;) : state-&gt;uncheckedArgument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String str3 = state-&gt;argument(2).isUndefined() ? String() : state-&gt;uncheckedArgument(2).toString(state)-&gt;value(state);
</del><ins>+    String str3 = state-&gt;argument(2).isUndefined() ? String() : state-&gt;uncheckedArgument(2).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     RefPtr&lt;TestNamedConstructor&gt; object = TestNamedConstructor::createForJSConstructor(*castedThis-&gt;document(), str1, str2, str3, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestNode&quot;, &quot;name&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setName(nativeValue);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -352,7 +352,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestNondeterministic&quot;, &quot;nondeterministicWriteableAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicWriteableAttr(nativeValue);
</span><span class="lines">@@ -369,7 +369,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestNondeterministic&quot;, &quot;nondeterministicExceptionAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicExceptionAttr(nativeValue);
</span><span class="lines">@@ -386,7 +386,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestNondeterministic&quot;, &quot;nondeterministicGetterExceptionAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicGetterExceptionAttr(nativeValue);
</span><span class="lines">@@ -404,7 +404,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicSetterExceptionAttr(nativeValue, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -89,6 +89,70 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+const String&amp; stringValue(TestEnumType);
+Optional&lt;TestEnumType&gt; enumerationValueTestEnumType(const String&amp;);
+
+const String&amp; stringValue(TestEnumType enumerationValue)
+{
+    static NeverDestroyed&lt;const String&gt; values[] = {
+        ASCIILiteral(&quot;&quot;),
+        ASCIILiteral(&quot;EnumValue1&quot;),
+        ASCIILiteral(&quot;EnumValue2&quot;),
+        ASCIILiteral(&quot;EnumValue3&quot;),
+    };
+    static_assert(!static_cast&lt;size_t&gt;(TestEnumType::EmptyString), &quot;TestEnumType::EmptyString is not 0 as expected&quot;);
+    static_assert(static_cast&lt;size_t&gt;(TestEnumType::EnumValue1) == 1, &quot;TestEnumType::EnumValue1 is not 1 as expected&quot;);
+    static_assert(static_cast&lt;size_t&gt;(TestEnumType::EnumValue2) == 2, &quot;TestEnumType::EnumValue2 is not 2 as expected&quot;);
+    static_assert(static_cast&lt;size_t&gt;(TestEnumType::EnumValue3) == 3, &quot;TestEnumType::EnumValue3 is not 3 as expected&quot;);
+    ASSERT(static_cast&lt;size_t&gt;(enumerationValue) &lt; WTF_ARRAY_LENGTH(values));
+    return values[static_cast&lt;size_t&gt;(enumerationValue)];
+}
+
+Optional&lt;TestEnumType&gt; enumerationValueTestEnumType(const String&amp; stringValue)
+{
+    if (stringValue == &quot;&quot;)
+        return TestEnumType::EmptyString;
+    if (stringValue == &quot;EnumValue1&quot;)
+        return TestEnumType::EnumValue1;
+    if (stringValue == &quot;EnumValue2&quot;)
+        return TestEnumType::EnumValue2;
+    if (stringValue == &quot;EnumValue3&quot;)
+        return TestEnumType::EnumValue3;
+    return Nullopt;
+}
+
+const String&amp; stringValue(Optional);
+Optional&lt;Optional&gt; enumerationValueOptional(const String&amp;);
+
+const String&amp; stringValue(Optional enumerationValue)
+{
+    static NeverDestroyed&lt;const String&gt; values[] = {
+        ASCIILiteral(&quot;&quot;),
+        ASCIILiteral(&quot;OptionalValue1&quot;),
+        ASCIILiteral(&quot;OptionalValue2&quot;),
+        ASCIILiteral(&quot;OptionalValue3&quot;),
+    };
+    static_assert(!static_cast&lt;size_t&gt;(Optional::EmptyString), &quot;Optional::EmptyString is not 0 as expected&quot;);
+    static_assert(static_cast&lt;size_t&gt;(Optional::OptionalValue1) == 1, &quot;Optional::OptionalValue1 is not 1 as expected&quot;);
+    static_assert(static_cast&lt;size_t&gt;(Optional::OptionalValue2) == 2, &quot;Optional::OptionalValue2 is not 2 as expected&quot;);
+    static_assert(static_cast&lt;size_t&gt;(Optional::OptionalValue3) == 3, &quot;Optional::OptionalValue3 is not 3 as expected&quot;);
+    ASSERT(static_cast&lt;size_t&gt;(enumerationValue) &lt; WTF_ARRAY_LENGTH(values));
+    return values[static_cast&lt;size_t&gt;(enumerationValue)];
+}
+
+Optional&lt;Optional&gt; enumerationValueOptional(const String&amp; stringValue)
+{
+    if (stringValue == &quot;&quot;)
+        return Optional::EmptyString;
+    if (stringValue == &quot;OptionalValue1&quot;)
+        return Optional::OptionalValue1;
+    if (stringValue == &quot;OptionalValue2&quot;)
+        return Optional::OptionalValue2;
+    if (stringValue == &quot;OptionalValue3&quot;)
+        return Optional::OptionalValue3;
+    return Nullopt;
+}
+
</ins><span class="cx"> // Functions
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TEST_FEATURE)
</span><span class="lines">@@ -990,7 +1054,7 @@
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;enumAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsStringWithCache(state, impl.enumAttr());
</del><ins>+    JSValue result = jsStringWithCache(state, stringValue(impl.enumAttr()));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2147,7 +2211,7 @@
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestObj&quot;, &quot;attributeWithReservedEnumType&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    JSValue result = jsStringWithCache(state, impl.attributeWithReservedEnumType());
</del><ins>+    JSValue result = jsStringWithCache(state, stringValue(impl.attributeWithReservedEnumType()));
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2205,7 +2269,7 @@
</span><span class="cx"> bool setJSTestObjConstructorStaticStringAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx">     JSValue value = JSValue::decode(encodedValue);
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     TestObj::setStaticStringAttr(nativeValue);
</span><span class="lines">@@ -2235,7 +2299,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;enumAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    TestEnumType nativeValue = enumerationValueTestEnumType(value.toWTFString(state)).value();
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     if (nativeValue != &quot;&quot; &amp;&amp; nativeValue != &quot;EnumValue1&quot; &amp;&amp; nativeValue != &quot;EnumValue2&quot; &amp;&amp; nativeValue != &quot;EnumValue3&quot;)
</span><span class="lines">@@ -2407,7 +2471,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;stringAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttr(nativeValue);
</span><span class="lines">@@ -2509,7 +2573,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;reflectedStringAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedstringattrAttr, nativeValue);
</span><span class="lines">@@ -2577,7 +2641,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;reflectedURLAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedurlattrAttr, nativeValue);
</span><span class="lines">@@ -2594,7 +2658,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;reflectedStringAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::customContentStringAttrAttr, nativeValue);
</span><span class="lines">@@ -2645,7 +2709,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;reflectedCustomURLAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::customContentURLAttrAttr, nativeValue);
</span><span class="lines">@@ -2663,7 +2727,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;enabledAtRuntimeAttribute&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setEnabledAtRuntimeAttribute(nativeValue);
</span><span class="lines">@@ -2770,7 +2834,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;stringAttrWithGetterException&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithGetterException(nativeValue);
</span><span class="lines">@@ -2788,7 +2852,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithSetterException(nativeValue, ec);
</span><span class="lines">@@ -3302,7 +3366,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;attributeWithReservedEnumType&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    Optional nativeValue = enumerationValueOptional(value.toWTFString(state)).value();
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     if (nativeValue != &quot;&quot; &amp;&amp; nativeValue != &quot;OptionalValue1&quot; &amp;&amp; nativeValue != &quot;OptionalValue2&quot; &amp;&amp; nativeValue != &quot;OptionalValue3&quot;)
</span><span class="lines">@@ -3322,7 +3386,7 @@
</span><span class="cx">     }
</span><span class="cx">     Ref&lt;TestNode&gt; forwardedImpl = castedThis-&gt;wrapped().putForwardsAttribute();
</span><span class="cx">     auto&amp; impl = forwardedImpl.get();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setName(nativeValue);
</span><span class="lines">@@ -3342,7 +3406,7 @@
</span><span class="cx">     if (!forwardedImpl)
</span><span class="cx">         return false;
</span><span class="cx">     auto&amp; impl = *forwardedImpl;
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setName(nativeValue);
</span><span class="lines">@@ -3375,7 +3439,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String testParam = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String testParam = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(testParam);
</span><span class="lines">@@ -3447,7 +3511,7 @@
</span><span class="cx">     int longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(1).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="lines">@@ -3484,7 +3548,7 @@
</span><span class="cx">     int8_t byteArg = toInt8(state, state-&gt;argument(0), NormalConversion);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(1).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="lines">@@ -3521,7 +3585,7 @@
</span><span class="cx">     uint8_t octetArg = toUInt8(state, state-&gt;argument(0), NormalConversion);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(1).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="lines">@@ -3558,7 +3622,7 @@
</span><span class="cx">     int longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(1).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="lines">@@ -3595,7 +3659,7 @@
</span><span class="cx">     int longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(1).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="lines">@@ -3738,7 +3802,7 @@
</span><span class="cx">     if (state-&gt;argument(0).isUndefined())
</span><span class="cx">         enumArg = ASCIILiteral(&quot;EnumValue1&quot;);
</span><span class="cx">     else {
</span><del>-        enumArg = state-&gt;uncheckedArgument(0).toString(state)-&gt;value(state);
</del><ins>+        enumArg = state-&gt;uncheckedArgument(0).toWTFString(state);
</ins><span class="cx">         if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (enumArg != &quot;&quot; &amp;&amp; enumArg != &quot;EnumValue1&quot; &amp;&amp; enumArg != &quot;EnumValue2&quot; &amp;&amp; enumArg != &quot;EnumValue3&quot;)
</span><span class="lines">@@ -3759,7 +3823,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String strArg = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(1));
</span><span class="lines">@@ -3868,7 +3932,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String argument = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String argument = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsStringWithCache(state, impl.privateMethod(argument));
</span><span class="lines">@@ -4140,7 +4204,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalString&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String str = state-&gt;argument(0).isUndefined() ? String() : state-&gt;uncheckedArgument(0).toString(state)-&gt;value(state);
</del><ins>+    String str = state-&gt;argument(0).isUndefined() ? String() : state-&gt;uncheckedArgument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalString(str);
</span><span class="lines">@@ -4170,7 +4234,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalStringAndDefaultValue&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String str = state-&gt;argument(0).isUndefined() ? ASCIILiteral(&quot;foo&quot;) : state-&gt;uncheckedArgument(0).toString(state)-&gt;value(state);
</del><ins>+    String str = state-&gt;argument(0).isUndefined() ? ASCIILiteral(&quot;foo&quot;) : state-&gt;uncheckedArgument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringAndDefaultValue(str);
</span><span class="lines">@@ -4200,7 +4264,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalStringIsNull&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String str = state-&gt;argument(0).isUndefined() ? String() : state-&gt;uncheckedArgument(0).toString(state)-&gt;value(state);
</del><ins>+    String str = state-&gt;argument(0).isUndefined() ? String() : state-&gt;uncheckedArgument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringIsNull(str);
</span><span class="lines">@@ -4215,7 +4279,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalStringIsUndefined&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String str = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String str = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringIsUndefined(str);
</span><span class="lines">@@ -4245,7 +4309,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalStringIsEmptyString&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String str = state-&gt;argument(0).isUndefined() ? emptyString() : state-&gt;uncheckedArgument(0).toString(state)-&gt;value(state);
</del><ins>+    String str = state-&gt;argument(0).isUndefined() ? emptyString() : state-&gt;uncheckedArgument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringIsEmptyString(str);
</span><span class="lines">@@ -4668,7 +4732,7 @@
</span><span class="cx">     TestObj* objArg = JSTestObj::toWrapped(state-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String strArg = state-&gt;argument(1).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(1).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(objArg, strArg);
</span><span class="lines">@@ -4705,7 +4769,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String strArg = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(strArg);
</span><span class="lines">@@ -4843,7 +4907,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String strArg = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String strArg = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(strArg);
</span><span class="lines">@@ -4997,7 +5061,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String type = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String type = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj::overloadedMethod1(type);
</span><span class="lines">@@ -5225,7 +5289,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String value = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String value = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.convert3(value);
</span><span class="lines">@@ -5296,7 +5360,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String str = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String str = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     float a = state-&gt;argument(1).toFloat(state);
</span><span class="lines">@@ -5375,7 +5439,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String head = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String head = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Vector&lt;String&gt; tail = toNativeArguments&lt;String&gt;(state, 1);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">     auto* castedThis = jsCast&lt;JSTestOverloadedConstructorsConstructor*&gt;(state-&gt;callee());
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String string = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String string = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     RefPtr&lt;TestOverloadedConstructors&gt; object = TestOverloadedConstructors::create(string);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestOverrideBuiltins&quot;, &quot;namedItem&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestOverrideBuiltins::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String name = state-&gt;argument(0).isUndefined() ? ASCIILiteral(&quot;test&quot;) : state-&gt;uncheckedArgument(0).toString(state)-&gt;value(state);
</del><ins>+    String name = state-&gt;argument(0).isUndefined() ? ASCIILiteral(&quot;test&quot;) : state-&gt;uncheckedArgument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), WTF::getPtr(impl.namedItem(name)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">     auto* castedThis = jsCast&lt;JSTestTypedefsConstructor*&gt;(state-&gt;callee());
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    String hello = state-&gt;argument(0).toString(state)-&gt;value(state);
</del><ins>+    String hello = state-&gt;argument(0).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!state-&gt;argument(1).isObject()))
</span><span class="lines">@@ -423,7 +423,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestTypedefs&quot;, &quot;stringAttrWithGetterException&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithGetterException(nativeValue);
</span><span class="lines">@@ -441,7 +441,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String nativeValue = value.toString(state)-&gt;value(state);
</del><ins>+    String nativeValue = value.toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithSetterException(nativeValue, ec);
</span><span class="lines">@@ -489,7 +489,7 @@
</span><span class="cx">     float blur = state-&gt;argument(2).toFloat(state);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String color = state-&gt;argument(3).isUndefined() ? String() : state-&gt;uncheckedArgument(3).toString(state)-&gt;value(state);
</del><ins>+    String color = state-&gt;argument(3).isUndefined() ? String() : state-&gt;uncheckedArgument(3).toWTFString(state);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Optional&lt;float&gt; alpha = state-&gt;argument(4).isUndefined() ? Optional&lt;float&gt;() : state-&gt;uncheckedArgument(4).toFloat(state);
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFace.cpp (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFace.cpp        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/css/FontFace.cpp        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -317,22 +317,22 @@
</span><span class="cx">     return list-&gt;cssText();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String FontFace::status() const
</del><ins>+FontFaceLoadStatus FontFace::status() const
</ins><span class="cx"> {
</span><span class="cx">     switch (m_backing-&gt;status()) {
</span><span class="cx">     case CSSFontFace::Status::Pending:
</span><del>-        return String(&quot;unloaded&quot;, String::ConstructFromLiteral);
</del><ins>+        return FontFaceLoadStatus::Unloaded;
</ins><span class="cx">     case CSSFontFace::Status::Loading:
</span><del>-        return String(&quot;loading&quot;, String::ConstructFromLiteral);
</del><ins>+        return FontFaceLoadStatus::Loading;
</ins><span class="cx">     case CSSFontFace::Status::TimedOut:
</span><del>-        return String(&quot;error&quot;, String::ConstructFromLiteral);
</del><ins>+        return FontFaceLoadStatus::Error;
</ins><span class="cx">     case CSSFontFace::Status::Success:
</span><del>-        return String(&quot;loaded&quot;, String::ConstructFromLiteral);
</del><ins>+        return FontFaceLoadStatus::Loaded;
</ins><span class="cx">     case CSSFontFace::Status::Failure:
</span><del>-        return String(&quot;error&quot;, String::ConstructFromLiteral);
</del><ins>+        return FontFaceLoadStatus::Error;
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return String(&quot;error&quot;, String::ConstructFromLiteral);
</del><ins>+    return FontFaceLoadStatus::Error;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FontFace::fontStateChanged(CSSFontFace&amp; face, CSSFontFace::Status, CSSFontFace::Status newState)
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFace.h (200287 => 200288)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFace.h        2016-04-30 04:51:31 UTC (rev 200287)
+++ trunk/Source/WebCore/css/FontFace.h        2016-04-30 05:09:10 UTC (rev 200288)
</span><span class="lines">@@ -36,16 +36,14 @@
</span><span class="cx"> #include &lt;wtf/WeakPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-namespace Deprecated {
-class ScriptValue;
-}
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSFontFace;
</span><span class="cx"> class CSSValue;
</span><span class="cx"> class Dictionary;
</span><span class="cx"> 
</span><ins>+enum class FontFaceLoadStatus { Unloaded, Loading, Loaded, Error };
+
</ins><span class="cx"> class FontFace final : public RefCounted&lt;FontFace&gt;, public CSSFontFace::Client {
</span><span class="cx"> public:
</span><span class="cx">     static RefPtr&lt;FontFace&gt; create(JSC::ExecState&amp;, ScriptExecutionContext&amp;, const String&amp; family, JSC::JSValue source, const Dictionary&amp; descriptors, ExceptionCode&amp;);
</span><span class="lines">@@ -67,7 +65,7 @@
</span><span class="cx">     String unicodeRange() const;
</span><span class="cx">     String variant() const;
</span><span class="cx">     String featureSettings() const;
</span><del>-    String status() const;
</del><ins>+    FontFaceLoadStatus status() const;
</ins><span class="cx"> 
</span><span class="cx">     typedef DOMPromise&lt;FontFace&amp;, DOMCoreException&amp;&gt; Promise;
</span><span class="cx">     Promise&amp; promise() { return m_promise; }
</span></span></pre>
</div>
</div>

</body>
</html>