<!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>[200555] 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/200555">200555</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-05-08 09:54:09 -0700 (Sun, 08 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Correct dictionary bindings handling of optional, null, and undefined
https://bugs.webkit.org/show_bug.cgi?id=157463

Reviewed by Chris Dumez.

Source/WebCore:

* bindings/js/JSDOMBinding.cpp:
(WebCore::propertyValue): Deleted.
* bindings/js/JSDOMBinding.h: Deleted propertyValue, not all that helpful for now.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Added a new early exit for convert to
a dictionary type when the value is undefined or null and all members are either
optional or have a default value. This returns the default values for everything
without raising an exception. Added checking that requires that the dictionary
argument is an object and not a regular expression, since that's also called for
in the latest draft of the Web IDL specification. This ends up speeding up the
code a bit since we now use JSObject::get for properties instead of JSValue::get.
(GenerateParametersCheck): Renamed some local variables. Taught the code that
optional dictionaries all have a default value; before it was doing that for the
type &quot;Dictionary&quot; but not the real dictionary types (IsDictionaryType).

* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.

* css/FontFace.cpp:
(WebCore::FontFace::create): Changed argument to be Descriptors instead of
Optional&lt;Descriptors&gt;. It would have compiled the other way, but there is now
no caller that will pass a null. Because the IDL dictionary support was new,
this was the only place that was doing it wrong. Good that we &quot;nipped it in the bud&quot;
before doing this in more places.
* css/FontFace.h: Ditto.

LayoutTests:

* fast/dom/MutationObserver/observe-exceptions-expected.txt: Reverted that
change to expect a more specific TypeError just as it was a day ago before
my last patch. The TypeError is back to being a problem with the specifics
of the arguments passed rather than a problem with null and undefined
themselves being invalid.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomMutationObserverobserveexceptionsexpectedtxt">trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.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="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/LayoutTests/ChangeLog        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-05-08  Darin Adler  &lt;darin@apple.com&gt;
+
+        Correct dictionary bindings handling of optional, null, and undefined
+        https://bugs.webkit.org/show_bug.cgi?id=157463
+
+        Reviewed by Chris Dumez.
+
+        * fast/dom/MutationObserver/observe-exceptions-expected.txt: Reverted that
+        change to expect a more specific TypeError just as it was a day ago before
+        my last patch. The TypeError is back to being a problem with the specifics
+        of the arguments passed rather than a problem with null and undefined
+        themselves being invalid.
+
</ins><span class="cx"> 2016-05-07  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Change MutationObserver::observe to take an IDL dictionary, rather than WebCore::Dictionary
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomMutationObserverobserveexceptionsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -7,8 +7,8 @@
</span><span class="cx"> PASS observer.observe(null) threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS observer.observe(undefined) threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS observer.observe(document.body) threw exception TypeError: Not enough arguments.
</span><del>-PASS observer.observe(document.body, null) threw exception TypeError: null is not an object (evaluating 'observer.observe(document.body, null)').
-PASS observer.observe(document.body, undefined) threw exception TypeError: undefined is not an object (evaluating 'observer.observe(document.body, undefined)').
</del><ins>+PASS observer.observe(document.body, null) threw exception TypeError: Type error.
+PASS observer.observe(document.body, undefined) threw exception TypeError: Type error.
</ins><span class="cx"> PASS observer.observe(null, {attributes: true}) threw exception TypeError: Type error.
</span><span class="cx"> PASS observer.observe(undefined, {attributes: true}) threw exception TypeError: Type error.
</span><span class="cx"> PASS observer.observe(document.body, {subtree: true}) threw exception TypeError: Type error.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/Source/WebCore/ChangeLog        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-05-08  Darin Adler  &lt;darin@apple.com&gt;
+
+        Correct dictionary bindings handling of optional, null, and undefined
+        https://bugs.webkit.org/show_bug.cgi?id=157463
+
+        Reviewed by Chris Dumez.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::propertyValue): Deleted.
+        * bindings/js/JSDOMBinding.h: Deleted propertyValue, not all that helpful for now.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateDictionaryImplementationContent): Added a new early exit for convert to
+        a dictionary type when the value is undefined or null and all members are either
+        optional or have a default value. This returns the default values for everything
+        without raising an exception. Added checking that requires that the dictionary
+        argument is an object and not a regular expression, since that's also called for
+        in the latest draft of the Web IDL specification. This ends up speeding up the
+        code a bit since we now use JSObject::get for properties instead of JSValue::get.
+        (GenerateParametersCheck): Renamed some local variables. Taught the code that
+        optional dictionaries all have a default value; before it was doing that for the
+        type &quot;Dictionary&quot; but not the real dictionary types (IsDictionaryType).
+
+        * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
+
+        * css/FontFace.cpp:
+        (WebCore::FontFace::create): Changed argument to be Descriptors instead of
+        Optional&lt;Descriptors&gt;. It would have compiled the other way, but there is now
+        no caller that will pass a null. Because the IDL dictionary support was new,
+        this was the only place that was doing it wrong. Good that we &quot;nipped it in the bud&quot;
+        before doing this in more places.
+        * css/FontFace.h: Ditto.
+
</ins><span class="cx"> 2016-05-08  David Kilzer  &lt;ddkilzer@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -840,9 +840,4 @@
</span><span class="cx">     return CallType::Host;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue propertyValue(ExecState&amp; state, JSValue value, const char* propertyName)
-{
-    return value.get(&amp;state, Identifier::fromString(&amp;state, propertyName));
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -298,8 +298,6 @@
</span><span class="cx"> template&lt;typename DOMClass&gt; const JSC::HashTableValue* getStaticValueSlotEntryWithoutCaching(JSC::ExecState*, JSC::PropertyName);
</span><span class="cx"> template&lt;JSC::NativeFunction, int length&gt; JSC::EncodedJSValue nonCachingStaticFunctionGetter(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> 
</span><del>-JSC::JSValue propertyValue(JSC::ExecState&amp;, JSC::JSValue, const char* propertyName);
-
</del><span class="cx"> // Inline functions and template definitions.
</span><span class="cx"> 
</span><span class="cx"> inline JSC::Structure* DOMConstructorObject::createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -958,8 +958,27 @@
</span><span class="cx">         # FIXME: A little ugly to have this be a side effect instead of a return value.
</span><span class="cx">         AddToImplIncludes(&quot;JSDOMConvert.h&quot;);
</span><span class="cx"> 
</span><ins>+        my $defaultValues = &quot;&quot;;
+        my $comma = &quot;&quot;;
+        foreach my $member (@{$dictionary-&gt;members}) {
+            if (!$member-&gt;isOptional) {
+                $defaultValues = &quot;&quot;;
+                last;
+            }
+            $defaultValues .= $comma . (defined $member-&gt;default ? $member-&gt;default : &quot;Nullopt&quot;);
+            $comma = &quot;, &quot;;
+        }
+
</ins><span class="cx">         $result .= &quot;template&lt;&gt; $className convert&lt;$className&gt;(ExecState&amp; state, JSValue value)\n&quot;;
</span><span class="cx">         $result .= &quot;{\n&quot;;
</span><ins>+        $result .= &quot;    if (value.isUndefinedOrNull())\n&quot; if $defaultValues;
+        $result .= &quot;        return { &quot; . $defaultValues . &quot; };\n&quot; if $defaultValues;
+        $result .= &quot;    auto* object = value.getObject();\n&quot;;
+        $result .= &quot;    if (UNLIKELY(!object || object-&gt;type() == RegExpObjectType)) {\n&quot;;
+        $result .= &quot;        throwTypeError(&amp;state);\n&quot;;
+        $result .= &quot;        return { };\n&quot;;
+        $result .= &quot;    }\n&quot;;
+
</ins><span class="cx">         my $needExceptionCheck = 0;
</span><span class="cx">         foreach my $member (@{$dictionary-&gt;members}) {
</span><span class="cx">             if ($needExceptionCheck) {
</span><span class="lines">@@ -970,16 +989,18 @@
</span><span class="cx">             my $function = $member-&gt;isOptional ? &quot;convertOptional&quot; : &quot;convert&quot;;
</span><span class="cx">             my $defaultValueWithLeadingComma = $member-&gt;isOptional &amp;&amp; defined $member-&gt;default ? &quot;, &quot; . $member-&gt;default : &quot;&quot;;
</span><span class="cx">             $result .= &quot;    auto &quot; . $member-&gt;name . &quot; = &quot; . $function . &quot;&lt;&quot; . GetNativeTypeFromSignature($interface, $member) . &quot;&gt;&quot;
</span><del>-                . &quot;(state, propertyValue(state, value, \&quot;&quot; . $member-&gt;name . &quot;\&quot;)&quot; . $defaultValueWithLeadingComma . &quot;);\n&quot;;
</del><ins>+                . &quot;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, \&quot;&quot; . $member-&gt;name . &quot;\&quot;))&quot; . $defaultValueWithLeadingComma . &quot;);\n&quot;;
</ins><span class="cx">             $needExceptionCheck = 1;
</span><span class="cx">         }
</span><del>-        $result .= &quot;    return { &quot;;
-        my $comma = &quot;&quot;;
</del><ins>+
+        my $arguments = &quot;&quot;;
+        $comma = &quot;&quot;;
</ins><span class="cx">         foreach my $member (@{$dictionary-&gt;members}) {
</span><del>-            $result .= $comma . &quot;WTFMove(&quot; . $member-&gt;name . &quot;)&quot;;
</del><ins>+            $arguments .= $comma . &quot;WTFMove(&quot; . $member-&gt;name . &quot;)&quot;;
</ins><span class="cx">             $comma = &quot;, &quot;;
</span><span class="cx">         }
</span><del>-        $result .= &quot; };\n&quot;;
</del><ins>+
+        $result .= &quot;    return { &quot; . $arguments . &quot; };\n&quot;;
</ins><span class="cx">         $result .= &quot;}\n\n&quot;;
</span><span class="cx"> 
</span><span class="cx">         $result .= &quot;#endif\n\n&quot; if $conditionalString;
</span><span class="lines">@@ -3592,90 +3613,90 @@
</span><span class="cx">     $implIncludes{&quot;ExceptionCode.h&quot;} = 1;
</span><span class="cx">     $implIncludes{&quot;JSDOMBinding.h&quot;} = 1;
</span><span class="cx"> 
</span><del>-    my $argsIndex = 0;
</del><ins>+    my $argumentIndex = 0;
</ins><span class="cx">     foreach my $parameter (@{$function-&gt;parameters}) {
</span><del>-        my $argType = $parameter-&gt;type;
</del><ins>+        my $type = $parameter-&gt;type;
</ins><span class="cx"> 
</span><del>-        die &quot;Optional parameters of non-nullable wrapper types are not supported&quot; if $parameter-&gt;isOptional &amp;&amp; !$parameter-&gt;isNullable &amp;&amp; $codeGenerator-&gt;IsWrapperType($argType);
</del><ins>+        die &quot;Optional parameters of non-nullable wrapper types are not supported&quot; if $parameter-&gt;isOptional &amp;&amp; !$parameter-&gt;isNullable &amp;&amp; $codeGenerator-&gt;IsWrapperType($type);
</ins><span class="cx"> 
</span><span class="cx">         if ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
</span><span class="cx">             # As per Web IDL, optional dictionary parameters are always considered to have a default value of an empty dictionary, unless otherwise specified.
</span><del>-            $parameter-&gt;default(&quot;[]&quot;) if $argType eq &quot;Dictionary&quot;;
-            
</del><ins>+            $parameter-&gt;default(&quot;[]&quot;) if $type eq &quot;Dictionary&quot; or $codeGenerator-&gt;IsDictionaryType($type);
+
</ins><span class="cx">             # We use undefined as default value for optional parameters of type 'any' unless specified otherwise.
</span><del>-            $parameter-&gt;default(&quot;undefined&quot;) if $argType eq &quot;any&quot;;
</del><ins>+            $parameter-&gt;default(&quot;undefined&quot;) if $type eq &quot;any&quot;;
</ins><span class="cx"> 
</span><span class="cx">             # We use the null string as default value for parameters of type DOMString unless specified otherwise.
</span><del>-            $parameter-&gt;default(&quot;null&quot;) if $argType eq &quot;DOMString&quot;;
</del><ins>+            $parameter-&gt;default(&quot;null&quot;) if $type eq &quot;DOMString&quot;;
</ins><span class="cx"> 
</span><span class="cx">             # As per Web IDL, passing undefined for a nullable parameter is treated as null. Therefore, use null as
</span><span class="cx">             # default value for nullable parameters unless otherwise specified.
</span><span class="cx">             $parameter-&gt;default(&quot;null&quot;) if $parameter-&gt;isNullable;
</span><span class="cx"> 
</span><span class="cx">             # For callback parameters, the generated bindings treat undefined as null, so use null as implicit default value.
</span><del>-            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($argType);
</del><ins>+            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($type);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         my $name = $parameter-&gt;name;
</span><span class="cx">         my $value = $name;
</span><span class="cx"> 
</span><del>-        if ($codeGenerator-&gt;IsCallbackInterface($argType)) {
-            my $callbackClassName = GetCallbackClassName($argType);
</del><ins>+        if ($codeGenerator-&gt;IsCallbackInterface($type)) {
+            my $callbackClassName = GetCallbackClassName($type);
</ins><span class="cx">             $implIncludes{&quot;$callbackClassName.h&quot;} = 1;
</span><span class="cx">             if ($parameter-&gt;isOptional) {
</span><del>-                push(@$outputArray, &quot;    RefPtr&lt;$argType&gt; $name;\n&quot;);
-                push(@$outputArray, &quot;    if (!state-&gt;argument($argsIndex).isUndefinedOrNull()) {\n&quot;);
-                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($argType)) {
-                    push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argsIndex).isFunction())\n&quot;);
</del><ins>+                push(@$outputArray, &quot;    RefPtr&lt;$type&gt; $name;\n&quot;);
+                push(@$outputArray, &quot;    if (!state-&gt;argument($argumentIndex).isUndefinedOrNull()) {\n&quot;);
+                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
+                    push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argumentIndex).isFunction())\n&quot;);
</ins><span class="cx">                 } else {
</span><del>-                    push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argsIndex).isObject())\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argumentIndex).isObject())\n&quot;);
</ins><span class="cx">                 }
</span><del>-                push(@$outputArray, &quot;            return throwArgumentMustBeFunctionError(*state, $argsIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;            return throwArgumentMustBeFunctionError(*state, $argumentIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName);\n&quot;);
</ins><span class="cx">                 if ($function-&gt;isStatic) {
</span><span class="cx">                     AddToImplIncludes(&quot;CallbackFunction.h&quot;);
</span><del>-                    push(@$outputArray, &quot;        $name = createFunctionOnlyCallback&lt;${callbackClassName}&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument($argsIndex));\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;        $name = createFunctionOnlyCallback&lt;${callbackClassName}&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument($argumentIndex));\n&quot;);
</ins><span class="cx">                 } else {
</span><del>-                    push(@$outputArray, &quot;        $name = ${callbackClassName}::create(asObject(state-&gt;uncheckedArgument($argsIndex)), castedThis-&gt;globalObject());\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;        $name = ${callbackClassName}::create(asObject(state-&gt;uncheckedArgument($argumentIndex)), castedThis-&gt;globalObject());\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;);
</span><span class="cx">             } else {
</span><del>-                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($argType)) {
-                    push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;argument($argsIndex).isFunction()))\n&quot;);
</del><ins>+                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
+                    push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;argument($argumentIndex).isFunction()))\n&quot;);
</ins><span class="cx">                 } else {
</span><del>-                    push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;argument($argsIndex).isObject()))\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;argument($argumentIndex).isObject()))\n&quot;);
</ins><span class="cx">                 }
</span><del>-                push(@$outputArray, &quot;        return throwArgumentMustBeFunctionError(*state, $argsIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;        return throwArgumentMustBeFunctionError(*state, $argumentIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName);\n&quot;);
</ins><span class="cx">                 if ($function-&gt;isStatic) {
</span><span class="cx">                     AddToImplIncludes(&quot;CallbackFunction.h&quot;);
</span><del>-                    push(@$outputArray, &quot;    RefPtr&lt;$argType&gt; $name = createFunctionOnlyCallback&lt;${callbackClassName}&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument($argsIndex));\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;    RefPtr&lt;$type&gt; $name = createFunctionOnlyCallback&lt;${callbackClassName}&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument($argumentIndex));\n&quot;);
</ins><span class="cx">                 } else {
</span><del>-                    push(@$outputArray, &quot;    RefPtr&lt;$argType&gt; $name = ${callbackClassName}::create(asObject(state-&gt;uncheckedArgument($argsIndex)), castedThis-&gt;globalObject());\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;    RefPtr&lt;$type&gt; $name = ${callbackClassName}::create(asObject(state-&gt;uncheckedArgument($argumentIndex)), castedThis-&gt;globalObject());\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             $value = &quot;WTFMove($name)&quot;;
</span><span class="cx">         } elsif ($parameter-&gt;isVariadic) {
</span><span class="cx">             my $nativeElementType;
</span><del>-            if ($argType eq &quot;DOMString&quot;) {
</del><ins>+            if ($type eq &quot;DOMString&quot;) {
</ins><span class="cx">                 $nativeElementType = &quot;String&quot;;
</span><span class="cx">             } else {
</span><del>-                $nativeElementType = GetNativeType($interface, $argType);
</del><ins>+                $nativeElementType = GetNativeType($interface, $type);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if (!IsNativeType($argType)) {
</del><ins>+            if (!IsNativeType($type)) {
</ins><span class="cx">                 push(@$outputArray, &quot;    Vector&lt;$nativeElementType&gt; $name;\n&quot;);
</span><del>-                push(@$outputArray, &quot;    for (unsigned i = $argsIndex, count = state-&gt;argumentCount(); i &lt; count; ++i) {\n&quot;);
-                push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument(i).inherits(JS${argType}::info()))\n&quot;);
-                push(@$outputArray, &quot;            return throwArgumentTypeError(*state, i, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, \&quot;$argType\&quot;);\n&quot;);
-                push(@$outputArray, &quot;        $name.append(JS${argType}::toWrapped(state-&gt;uncheckedArgument(i)));\n&quot;);
</del><ins>+                push(@$outputArray, &quot;    for (unsigned i = $argumentIndex, count = state-&gt;argumentCount(); i &lt; count; ++i) {\n&quot;);
+                push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument(i).inherits(JS${type}::info()))\n&quot;);
+                push(@$outputArray, &quot;            return throwArgumentTypeError(*state, i, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
+                push(@$outputArray, &quot;        $name.append(JS${type}::toWrapped(state-&gt;uncheckedArgument(i)));\n&quot;);
</ins><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;)
</span><span class="cx">             } else {
</span><del>-                push(@$outputArray, &quot;    Vector&lt;$nativeElementType&gt; $name = toNativeArguments&lt;$nativeElementType&gt;(state, $argsIndex);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;    Vector&lt;$nativeElementType&gt; $name = toNativeArguments&lt;$nativeElementType&gt;(state, $argumentIndex);\n&quot;);
</ins><span class="cx">                 # Check if the type conversion succeeded.
</span><span class="cx">                 push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             }
</span><del>-        } elsif ($codeGenerator-&gt;IsEnumType($argType)) {
-            my $className = GetEnumerationClassName($interface, $argType);
</del><ins>+        } elsif ($codeGenerator-&gt;IsEnumType($type)) {
+            my $className = GetEnumerationClassName($interface, $type);
</ins><span class="cx"> 
</span><span class="cx">             $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx"> 
</span><span class="lines">@@ -3690,7 +3711,7 @@
</span><span class="cx">                 $defineOptionalValue = $name;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            push(@$outputArray, &quot;    auto ${name}Value = state-&gt;argument($argsIndex);\n&quot;);
</del><ins>+            push(@$outputArray, &quot;    auto ${name}Value = state-&gt;argument($argumentIndex);\n&quot;);
</ins><span class="cx">             push(@$outputArray, &quot;    $nativeType $name;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             if ($parameter-&gt;isOptional) {
</span><span class="lines">@@ -3707,7 +3728,7 @@
</span><span class="cx">             push(@$outputArray, &quot;$indent    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;$indent        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;$indent    if (UNLIKELY(!$optionalValue))\n&quot;);
</span><del>-            push(@$outputArray, &quot;$indent        return throwArgumentMustBeEnumError(*state, $argsIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, expectedEnumerationValues&lt;$className&gt;());\n&quot;);
</del><ins>+            push(@$outputArray, &quot;$indent        return throwArgumentMustBeEnumError(*state, $argumentIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, expectedEnumerationValues&lt;$className&gt;());\n&quot;);
</ins><span class="cx">             push(@$outputArray, &quot;$indent    $name = optionalValue.value();\n&quot;) if $optionalValue ne $name;
</span><span class="cx"> 
</span><span class="cx">             push(@$outputArray, &quot;    }\n&quot;) if $indent ne &quot;&quot;;
</span><span class="lines">@@ -3720,16 +3741,16 @@
</span><span class="cx">             if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;StrictTypeChecking&quot;}) {
</span><span class="cx">                 $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx"> 
</span><del>-                my $argValue = &quot;state-&gt;argument($argsIndex)&quot;;
-                if ($codeGenerator-&gt;IsWrapperType($argType)) {
-                    push(@$outputArray, &quot;    if (UNLIKELY(!${argValue}.isUndefinedOrNull() &amp;&amp; !${argValue}.inherits(JS${argType}::info())))\n&quot;);
-                    push(@$outputArray, &quot;        return throwArgumentTypeError(*state, $argsIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, \&quot;$argType\&quot;);\n&quot;);
</del><ins>+                my $argValue = &quot;state-&gt;argument($argumentIndex)&quot;;
+                if ($codeGenerator-&gt;IsWrapperType($type)) {
+                    push(@$outputArray, &quot;    if (UNLIKELY(!${argValue}.isUndefinedOrNull() &amp;&amp; !${argValue}.inherits(JS${type}::info())))\n&quot;);
+                    push(@$outputArray, &quot;        return throwArgumentTypeError(*state, $argumentIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             if ($parameter-&gt;extendedAttributes-&gt;{&quot;RequiresExistingAtomicString&quot;}) {
</span><span class="cx">                 # FIXME: This could be made slightly more efficient if we added an AtomicString(RefPtr&lt;AtomicStringImpl&gt;&amp;&amp;) constructor and removed the call to get() here.
</span><del>-                push(@$outputArray, &quot;    AtomicString $name = state-&gt;argument($argsIndex).toString(state)-&gt;toExistingAtomicString(state).get();\n&quot;);
</del><ins>+                push(@$outputArray, &quot;    AtomicString $name = state-&gt;argument($argumentIndex).toString(state)-&gt;toExistingAtomicString(state).get();\n&quot;);
</ins><span class="cx">                 push(@$outputArray, &quot;    if ($name.isNull())\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        return JSValue::encode(jsNull());\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</span><span class="lines">@@ -3739,11 +3760,11 @@
</span><span class="cx">                 my $inner;
</span><span class="cx">                 my $nativeType = GetNativeTypeFromSignature($interface, $parameter);
</span><span class="cx"> 
</span><del>-                if ($parameter-&gt;isOptional &amp;&amp; defined($parameter-&gt;default) &amp;&amp; !WillConvertUndefinedToDefaultParameterValue($parameter-&gt;type, $parameter-&gt;default)) {
</del><ins>+                if ($parameter-&gt;isOptional &amp;&amp; defined($parameter-&gt;default) &amp;&amp; !WillConvertUndefinedToDefaultParameterValue($type, $parameter-&gt;default)) {
</ins><span class="cx">                     my $defaultValue = $parameter-&gt;default;
</span><span class="cx"> 
</span><span class="cx">                     # String-related optimizations.
</span><del>-                    if ($parameter-&gt;type eq &quot;DOMString&quot;) {
</del><ins>+                    if ($type eq &quot;DOMString&quot;) {
</ins><span class="cx">                         my $useAtomicString = $parameter-&gt;extendedAttributes-&gt;{&quot;AtomicString&quot;};
</span><span class="cx">                         if ($defaultValue eq &quot;null&quot;) {
</span><span class="cx">                             $defaultValue = $useAtomicString ? &quot;nullAtom&quot; : &quot;String()&quot;;
</span><span class="lines">@@ -3759,16 +3780,15 @@
</span><span class="cx">                         $defaultValue = &quot;JSValue::JSUndefined&quot; if $defaultValue eq &quot;undefined&quot;;
</span><span class="cx">                     }
</span><span class="cx"> 
</span><del>-                    $outer = &quot;state-&gt;argument($argsIndex).isUndefined() ? $defaultValue : &quot;;
-                    $inner = &quot;state-&gt;uncheckedArgument($argsIndex)&quot;;
</del><ins>+                    $outer = &quot;state-&gt;argument($argumentIndex).isUndefined() ? $defaultValue : &quot;;
+                    $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
</ins><span class="cx">                 } elsif ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
</span><del>-                    # Use WTF::Optional&lt;&gt;() for optional parameters that are missing or undefined and that do not have
-                    # a default value in the IDL.
-                    $outer = &quot;state-&gt;argument($argsIndex).isUndefined() ? Optional&lt;$nativeType&gt;() : &quot;;
-                    $inner = &quot;state-&gt;uncheckedArgument($argsIndex)&quot;;
</del><ins>+                    # Use WTF::Optional&lt;&gt;() for optional parameters that are missing or undefined and that do not have a default value in the IDL.
+                    $outer = &quot;state-&gt;argument($argumentIndex).isUndefined() ? Optional&lt;$nativeType&gt;() : &quot;;
+                    $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
</ins><span class="cx">                 } else {
</span><span class="cx">                     $outer = &quot;&quot;;
</span><del>-                    $inner = &quot;state-&gt;argument($argsIndex)&quot;;
</del><ins>+                    $inner = &quot;state-&gt;argument($argumentIndex)&quot;;
</ins><span class="cx">                 }
</span><span class="cx">                 my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $inner, $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;});
</span><span class="cx">                 push(@$outputArray, &quot;    auto $name = ${outer}${nativeValue};\n&quot;);
</span><span class="lines">@@ -3779,7 +3799,7 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            my $isTearOff = $codeGenerator-&gt;IsSVGTypeNeedingTearOff($argType) &amp;&amp; $interfaceName !~ /List$/;
</del><ins>+            my $isTearOff = $codeGenerator-&gt;IsSVGTypeNeedingTearOff($type) &amp;&amp; $interfaceName !~ /List$/;
</ins><span class="cx">             my $shouldPassByReference = ShouldPassWrapperByReference($parameter, $interface);
</span><span class="cx">             if ($isTearOff or $shouldPassByReference) {
</span><span class="cx">                 push(@$outputArray, &quot;    if (UNLIKELY(!$name))\n&quot;);
</span><span class="lines">@@ -3787,13 +3807,13 @@
</span><span class="cx">                 $value = $isTearOff ? &quot;$name-&gt;propertyReference()&quot; : &quot;*$name&quot;;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if ($codeGenerator-&gt;IsTypedArrayType($argType) and $argType ne &quot;ArrayBuffer&quot;) {
</del><ins>+            if ($codeGenerator-&gt;IsTypedArrayType($type) and $parameter-&gt;type ne &quot;ArrayBuffer&quot;) {
</ins><span class="cx">                $value = $shouldPassByReference ? &quot;$name.releaseNonNull()&quot; : &quot;WTFMove($name)&quot;;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         push(@arguments, $value);
</span><del>-        $argsIndex++;
</del><ins>+        $argumentIndex++;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     push @arguments, GenerateReturnParameters($function);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -486,28 +486,47 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt; TestObj::ShadowRootInit convert&lt;TestObj::ShadowRootInit&gt;(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><del>-    auto mode = convert&lt;TestObj::ShadowRootMode&gt;(state, propertyValue(state, value, &quot;mode&quot;));
</del><ins>+    auto* object = value.getObject();
+    if (UNLIKELY(!object || object-&gt;type() == RegExpObjectType)) {
+        throwTypeError(&amp;state);
+        return { };
+    }
+    auto mode = convert&lt;TestObj::ShadowRootMode&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;mode&quot;)));
</ins><span class="cx">     return { WTFMove(mode) };
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt; TestObj::FontFaceDescriptors convert&lt;TestObj::FontFaceDescriptors&gt;(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><del>-    auto style = convertOptional&lt;String&gt;(state, propertyValue(state, value, &quot;style&quot;), &quot;normal&quot;);
</del><ins>+    if (value.isUndefinedOrNull())
+        return { &quot;normal&quot;, &quot;U+0-10FFFF&quot; };
+    auto* object = value.getObject();
+    if (UNLIKELY(!object || object-&gt;type() == RegExpObjectType)) {
+        throwTypeError(&amp;state);
+        return { };
+    }
+    auto style = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;style&quot;)), &quot;normal&quot;);
</ins><span class="cx">     if (UNLIKELY(state.hadException()))
</span><span class="cx">         return { };
</span><del>-    auto unicodeRange = convertOptional&lt;String&gt;(state, propertyValue(state, value, &quot;unicodeRange&quot;), &quot;U+0-10FFFF&quot;);
</del><ins>+    auto unicodeRange = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unicodeRange&quot;)), &quot;U+0-10FFFF&quot;);
</ins><span class="cx">     return { WTFMove(style), WTFMove(unicodeRange) };
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt; TestObj::MutationObserverInit convert&lt;TestObj::MutationObserverInit&gt;(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><del>-    auto childList = convertOptional&lt;bool&gt;(state, propertyValue(state, value, &quot;childList&quot;), false);
</del><ins>+    if (value.isUndefinedOrNull())
+        return { false, Nullopt, Nullopt };
+    auto* object = value.getObject();
+    if (UNLIKELY(!object || object-&gt;type() == RegExpObjectType)) {
+        throwTypeError(&amp;state);
+        return { };
+    }
+    auto childList = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;childList&quot;)), false);
</ins><span class="cx">     if (UNLIKELY(state.hadException()))
</span><span class="cx">         return { };
</span><del>-    auto attributes = convertOptional&lt;bool&gt;(state, propertyValue(state, value, &quot;attributes&quot;));
</del><ins>+    auto attributes = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;attributes&quot;)));
</ins><span class="cx">     if (UNLIKELY(state.hadException()))
</span><span class="cx">         return { };
</span><del>-    auto attributeFilter = convertOptional&lt;Vector&lt;String&gt;&gt;(state, propertyValue(state, value, &quot;attributeFilter&quot;));
</del><ins>+    auto attributeFilter = convertOptional&lt;Vector&lt;String&gt;&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;attributeFilter&quot;)));
</ins><span class="cx">     return { WTFMove(childList), WTFMove(attributes), WTFMove(attributeFilter) };
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFace.cpp (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFace.cpp        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/Source/WebCore/css/FontFace.cpp        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-RefPtr&lt;FontFace&gt; FontFace::create(JSC::ExecState&amp; state, Document&amp; document, const String&amp; family, JSC::JSValue source, const Optional&lt;Descriptors&gt;&amp; descriptors, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;FontFace&gt; FontFace::create(JSC::ExecState&amp; state, Document&amp; document, const String&amp; family, JSC::JSValue source, const Descriptors&amp; descriptors, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     auto result = adoptRef(*new FontFace(document.fontSelector()));
</span><span class="cx"> 
</span><span class="lines">@@ -54,26 +54,24 @@
</span><span class="cx">         CSSFontFace::appendSources(result-&gt;backing(), downcast&lt;CSSValueList&gt;(*value), &amp;document, false);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (descriptors) {
-        result-&gt;setStyle(descriptors-&gt;style, ec);
-        if (ec)
-            return nullptr;
-        result-&gt;setWeight(descriptors-&gt;weight, ec);
-        if (ec)
-            return nullptr;
-        result-&gt;setStretch(descriptors-&gt;stretch, ec);
-        if (ec)
-            return nullptr;
-        result-&gt;setUnicodeRange(descriptors-&gt;unicodeRange, ec);
-        if (ec)
-            return nullptr;
-        result-&gt;setVariant(descriptors-&gt;variant, ec);
-        if (ec)
-            return nullptr;
-        result-&gt;setFeatureSettings(descriptors-&gt;featureSettings, ec);
-        if (ec)
-            return nullptr;
-    }
</del><ins>+    result-&gt;setStyle(descriptors.style, ec);
+    if (ec)
+        return nullptr;
+    result-&gt;setWeight(descriptors.weight, ec);
+    if (ec)
+        return nullptr;
+    result-&gt;setStretch(descriptors.stretch, ec);
+    if (ec)
+        return nullptr;
+    result-&gt;setUnicodeRange(descriptors.unicodeRange, ec);
+    if (ec)
+        return nullptr;
+    result-&gt;setVariant(descriptors.variant, ec);
+    if (ec)
+        return nullptr;
+    result-&gt;setFeatureSettings(descriptors.featureSettings, ec);
+    if (ec)
+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFace.h (200554 => 200555)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFace.h        2016-05-08 15:22:36 UTC (rev 200554)
+++ trunk/Source/WebCore/css/FontFace.h        2016-05-08 16:54:09 UTC (rev 200555)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">         String variant;
</span><span class="cx">         String featureSettings;
</span><span class="cx">     };
</span><del>-    static RefPtr&lt;FontFace&gt; create(JSC::ExecState&amp;, Document&amp;, const String&amp; family, JSC::JSValue source, const Optional&lt;Descriptors&gt;&amp;, ExceptionCode&amp;);
</del><ins>+    static RefPtr&lt;FontFace&gt; create(JSC::ExecState&amp;, Document&amp;, const String&amp; family, JSC::JSValue source, const Descriptors&amp;, ExceptionCode&amp;);
</ins><span class="cx">     static Ref&lt;FontFace&gt; create(CSSFontFace&amp;);
</span><span class="cx">     virtual ~FontFace();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>