<!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>[200607] trunk/Source/WebCore</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/200607">200607</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-05-09 19:31:03 -0700 (Mon, 09 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Change Notification constructor to take an IDL dictionary instead of a WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=157466

Reviewed by Alex Christensen.

* Modules/notifications/Notification.cpp: Got rid of unneeded includes.
(WebCore::Notification::Notification): Deleted the unused default constructor. Changed
NotificationCenter argument to be reference rather than PassRefPtr. Changed one of the
ScriptExecutionContext arguments to be a Document since the code relies on that already.
Used the lambda form of timer creation instead of the class member form. Added a FIXME
about when m_notificationCenter can be null.
(WebCore::Notification::create): Changed NotificationCenter argument to be reference
rather than PassRefPtr. Changed options argument to be Options rather than Dictionary.
(WebCore::directionString): Added. Helper because the class still wants to store the
direction as a string, at least for now.
(WebCore::Notification::show): Streamlined the code a bit.
(WebCore::Notification::taskTimerFired): Deleted. Not needed now that we use a lambda
inside the constructor.
(WebCore::Notification::permission): Removed unneeded const from return type.
(WebCore::Notification::permissionString): Ditto.

* Modules/notifications/Notification.h: Used pragma once, updated for changes above.
Removed a number of unused functions, including cancel, setIconURL, setLang,
stopLoadingIcon, detachPresenter, setBody, startLoadingIcon, finishLoadingIcon, and
taskTimerFired.

* Modules/notifications/Notification.idl: Add NotificationOptions and pass it instead
of Dictionary to the constructor. Note that this is only a subset of what is
currently specified in the Notifications API document. The latest document specifies
a much more complex feature with lots more options.

* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::createNotification): Pass a reference rather than a
pointer to this.
* Modules/notifications/NotificationClient.h: Use pragma once. Removed unneeded
includes and forward declarations. Fixed #if to be easier to read.

* bindings/js/JSDOMConvert.h: Reworked the convert functions to use Converter and
DefaultConverter structs so we can do partial specialization in the future and so
we can get custom types for optional values. Used this to make an optional String
just be a null String, so it won't try to use Optional&lt;String&gt; instead. Might get
more complex latter when we add support for nullable.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationImplementationContent): Generate a blank line to make the output
slightly clearer. Tweaked a comment.
(GenerateDefaultValue): Added. Converts the default syntax from IDL into the syntax
needed in C++ code.
(GenerateDefaultValueWithLeadingComma): Added. Helper for use below.
(GenerateDictionaryImplementationContent): Use GenerateDefaultValue and
GenerateDefaultValueWithLeadingComma to make default values.
(GenerateParametersCheck): Use GenerateDefaultValue here in the enumeration code
path. This is a step in the direction of being able to make the whole thing more
generic in the future.

* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
Regenerated.

* bindings/scripts/test/TestObj.idl: Simplified and extended some of the test cases
to cover more combinations of the dictionary and enumeration support.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsNotificationcpp">trunk/Source/WebCore/Modules/notifications/Notification.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsNotificationh">trunk/Source/WebCore/Modules/notifications/Notification.h</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsNotificationidl">trunk/Source/WebCore/Modules/notifications/Notification.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsNotificationCentercpp">trunk/Source/WebCore/Modules/notifications/NotificationCenter.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsNotificationClienth">trunk/Source/WebCore/Modules/notifications/NotificationClient.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/ChangeLog        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -1,3 +1,70 @@
</span><ins>+2016-05-09  Darin Adler  &lt;darin@apple.com&gt;
+
+        Change Notification constructor to take an IDL dictionary instead of a WebCore::Dictionary
+        https://bugs.webkit.org/show_bug.cgi?id=157466
+
+        Reviewed by Alex Christensen.
+
+        * Modules/notifications/Notification.cpp: Got rid of unneeded includes.
+        (WebCore::Notification::Notification): Deleted the unused default constructor. Changed
+        NotificationCenter argument to be reference rather than PassRefPtr. Changed one of the
+        ScriptExecutionContext arguments to be a Document since the code relies on that already.
+        Used the lambda form of timer creation instead of the class member form. Added a FIXME
+        about when m_notificationCenter can be null.
+        (WebCore::Notification::create): Changed NotificationCenter argument to be reference
+        rather than PassRefPtr. Changed options argument to be Options rather than Dictionary.
+        (WebCore::directionString): Added. Helper because the class still wants to store the
+        direction as a string, at least for now.
+        (WebCore::Notification::show): Streamlined the code a bit.
+        (WebCore::Notification::taskTimerFired): Deleted. Not needed now that we use a lambda
+        inside the constructor.
+        (WebCore::Notification::permission): Removed unneeded const from return type.
+        (WebCore::Notification::permissionString): Ditto.
+
+        * Modules/notifications/Notification.h: Used pragma once, updated for changes above.
+        Removed a number of unused functions, including cancel, setIconURL, setLang,
+        stopLoadingIcon, detachPresenter, setBody, startLoadingIcon, finishLoadingIcon, and
+        taskTimerFired.
+
+        * Modules/notifications/Notification.idl: Add NotificationOptions and pass it instead
+        of Dictionary to the constructor. Note that this is only a subset of what is
+        currently specified in the Notifications API document. The latest document specifies
+        a much more complex feature with lots more options.
+
+        * Modules/notifications/NotificationCenter.cpp:
+        (WebCore::NotificationCenter::createNotification): Pass a reference rather than a
+        pointer to this.
+        * Modules/notifications/NotificationClient.h: Use pragma once. Removed unneeded
+        includes and forward declarations. Fixed #if to be easier to read.
+
+        * bindings/js/JSDOMConvert.h: Reworked the convert functions to use Converter and
+        DefaultConverter structs so we can do partial specialization in the future and so
+        we can get custom types for optional values. Used this to make an optional String
+        just be a null String, so it won't try to use Optional&lt;String&gt; instead. Might get
+        more complex latter when we add support for nullable.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateEnumerationImplementationContent): Generate a blank line to make the output
+        slightly clearer. Tweaked a comment.
+        (GenerateDefaultValue): Added. Converts the default syntax from IDL into the syntax
+        needed in C++ code.
+        (GenerateDefaultValueWithLeadingComma): Added. Helper for use below.
+        (GenerateDictionaryImplementationContent): Use GenerateDefaultValue and
+        GenerateDefaultValueWithLeadingComma to make default values.
+        (GenerateParametersCheck): Use GenerateDefaultValue here in the enumeration code
+        path. This is a step in the direction of being able to make the whole thing more
+        generic in the future.
+
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/ObjC/DOMTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.mm:
+        Regenerated.
+
+        * bindings/scripts/test/TestObj.idl: Simplified and extended some of the test cases
+        to cover more combinations of the dictionary and enumeration support.
+
</ins><span class="cx"> 2016-05-09  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: Have server database connections remember the OpenDB request that spawned them.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/Notification.cpp (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/Notification.cpp        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/Modules/notifications/Notification.cpp        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2011, 2012, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -37,34 +37,24 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMWindow.h&quot;
</span><span class="cx"> #include &quot;DOMWindowNotifications.h&quot;
</span><del>-#include &quot;Dictionary.h&quot;
</del><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;ErrorEvent.h&quot;
</del><ins>+#include &quot;Event.h&quot;
</ins><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;NotificationCenter.h&quot;
</span><del>-#include &quot;NotificationClient.h&quot;
</del><span class="cx"> #include &quot;NotificationController.h&quot;
</span><span class="cx"> #include &quot;NotificationPermissionCallback.h&quot;
</span><del>-#include &quot;ResourceRequest.h&quot;
-#include &quot;ResourceResponse.h&quot;
-#include &quot;ThreadableLoader.h&quot;
</del><ins>+#include &quot;VoidCallback.h&quot;
</ins><span class="cx"> #include &quot;WindowFocusAllowedIndicator.h&quot;
</span><del>-#include &quot;WorkerGlobalScope.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Notification::Notification()
-    : ActiveDOMObject(nullptr)
-{
-}
</del><ins>+#if ENABLE(LEGACY_NOTIFICATIONS)
</ins><span class="cx"> 
</span><del>-#if ENABLE(LEGACY_NOTIFICATIONS)
-Notification::Notification(const String&amp; title, const String&amp; body, const String&amp; iconURI, ScriptExecutionContext&amp; context, ExceptionCode&amp; ec, PassRefPtr&lt;NotificationCenter&gt; provider)
</del><ins>+Notification::Notification(const String&amp; title, const String&amp; body, const String&amp; iconURI, ScriptExecutionContext&amp; context, ExceptionCode&amp; ec, NotificationCenter&amp; notificationCenter)
</ins><span class="cx">     : ActiveDOMObject(&amp;context)
</span><span class="cx">     , m_title(title)
</span><span class="cx">     , m_body(body)
</span><del>-    , m_state(Idle)
-    , m_notificationCenter(provider)
</del><ins>+    , m_notificationCenter(&amp;notificationCenter)
</ins><span class="cx"> {
</span><span class="cx">     if (m_notificationCenter-&gt;checkPermission() != NotificationClient::PermissionAllowed) {
</span><span class="cx">         ec = SECURITY_ERR;
</span><span class="lines">@@ -77,20 +67,24 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-Notification::Notification(ScriptExecutionContext&amp; context, const String&amp; title)
-    : ActiveDOMObject(&amp;context)
</del><ins>+
+Notification::Notification(Document&amp; document, const String&amp; title)
+    : ActiveDOMObject(&amp;document)
</ins><span class="cx">     , m_title(title)
</span><span class="cx">     , m_state(Idle)
</span><del>-    , m_taskTimer(std::make_unique&lt;Timer&gt;(*this, &amp;Notification::taskTimerFired))
</del><ins>+    , m_notificationCenter(DOMWindowNotifications::webkitNotifications(*document.domWindow()))
+    , m_taskTimer(std::make_unique&lt;Timer&gt;([this] () { show(); }))
</ins><span class="cx"> {
</span><del>-    m_notificationCenter = DOMWindowNotifications::webkitNotifications(*downcast&lt;Document&gt;(context).domWindow());
-    
</del><ins>+    // FIXME: Seems that m_notificationCenter can be null so should not be changed from RefPtr to Ref.
+    // But the rest of the code in this class isn't trying to handle that case.
</ins><span class="cx">     ASSERT(m_notificationCenter-&gt;client());
</span><span class="cx">     m_taskTimer-&gt;startOneShot(0);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> Notification::~Notification() 
</span><span class="lines">@@ -98,36 +92,50 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_NOTIFICATIONS)
</span><del>-Ref&lt;Notification&gt; Notification::create(const String&amp; title, const String&amp; body, const String&amp; iconURI, ScriptExecutionContext&amp; context, ExceptionCode&amp; ec, PassRefPtr&lt;NotificationCenter&gt; provider) 
</del><ins>+
+Ref&lt;Notification&gt; Notification::create(const String&amp; title, const String&amp; body, const String&amp; iconURI, ScriptExecutionContext&amp; context, ExceptionCode&amp; ec, NotificationCenter&amp; provider)
</ins><span class="cx"> { 
</span><span class="cx">     auto notification = adoptRef(*new Notification(title, body, iconURI, context, ec, provider));
</span><span class="cx">     notification.get().suspendIfNeeded();
</span><span class="cx">     return notification;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-Ref&lt;Notification&gt; Notification::create(Document&amp; context, const String&amp; title, const Dictionary&amp; options)
</del><ins>+
+static String directionString(Notification::Direction direction)
</ins><span class="cx"> {
</span><ins>+    // FIXME: Storing this as a string is not the right way to do it.
+    // FIXME: Seems highly unlikely that this does the right thing for Auto.
+    switch (direction) {
+    case Notification::Direction::Auto:
+        return ASCIILiteral(&quot;auto&quot;);
+    case Notification::Direction::Ltr:
+        return ASCIILiteral(&quot;ltr&quot;);
+    case Notification::Direction::Rtl:
+        return ASCIILiteral(&quot;rtl&quot;);
+    }
+    ASSERT_NOT_REACHED();
+    return { };
+}
+
+Ref&lt;Notification&gt; Notification::create(Document&amp; context, const String&amp; title, const Options&amp; options)
+{
</ins><span class="cx">     auto notification = adoptRef(*new Notification(context, title));
</span><del>-    String argument;
-    if (options.get(&quot;body&quot;, argument))
-        notification.get().setBody(argument);
-    if (options.get(&quot;tag&quot;, argument))
-        notification.get().setTag(argument);
-    if (options.get(&quot;lang&quot;, argument))
-        notification.get().setLang(argument);
-    if (options.get(&quot;dir&quot;, argument))
-        notification.get().setDir(argument);
-    if (options.get(&quot;icon&quot;, argument)) {
-        URL iconURI = argument.isEmpty() ? URL() : context.completeURL(argument);
-        if (!iconURI.isEmpty() &amp;&amp; iconURI.isValid())
-            notification.get().setIconURL(iconURI);
</del><ins>+    notification.get().m_body = options.body;
+    notification.get().m_tag = options.tag;
+    notification.get().m_lang = options.lang;
+    notification.get().m_direction = directionString(options.dir);
+    if (!options.icon.isEmpty()) {
+        auto iconURL = context.completeURL(options.icon);
+        if (iconURL.isValid())
+            notification.get().m_icon = iconURL;
</ins><span class="cx">     }
</span><del>-
</del><span class="cx">     notification.get().suspendIfNeeded();
</span><span class="cx">     return notification;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void Notification::show() 
</span><span class="lines">@@ -135,9 +143,10 @@
</span><span class="cx">     // prevent double-showing
</span><span class="cx">     if (m_state == Idle &amp;&amp; m_notificationCenter-&gt;client()) {
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-        if (!downcast&lt;Document&gt;(*scriptExecutionContext()).page())
</del><ins>+        auto* page = downcast&lt;Document&gt;(*scriptExecutionContext()).page();
+        if (!page)
</ins><span class="cx">             return;
</span><del>-        if (NotificationController::from(downcast&lt;Document&gt;(*scriptExecutionContext()).page())-&gt;client()-&gt;checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) {
</del><ins>+        if (NotificationController::from(page)-&gt;client()-&gt;checkPermission(scriptExecutionContext()) != NotificationClient::PermissionAllowed) {
</ins><span class="cx">             dispatchErrorEvent();
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -212,21 +221,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-void Notification::taskTimerFired()
-{
-    ASSERT(scriptExecutionContext()-&gt;isDocument());
-    show();
-}
-#endif
</del><span class="cx"> 
</span><del>-
-#if ENABLE(NOTIFICATIONS)
-const String Notification::permission(Document&amp; document)
</del><ins>+String Notification::permission(Document&amp; document)
</ins><span class="cx"> {
</span><span class="cx">     return permissionString(NotificationController::from(document.page())-&gt;client()-&gt;checkPermission(&amp;document));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const String Notification::permissionString(NotificationClient::Permission permission)
</del><ins>+String Notification::permissionString(NotificationClient::Permission permission)
</ins><span class="cx"> {
</span><span class="cx">     switch (permission) {
</span><span class="cx">     case NotificationClient::PermissionAllowed:
</span><span class="lines">@@ -236,15 +237,15 @@
</span><span class="cx">     case NotificationClient::PermissionNotAllowed:
</span><span class="cx">         return ASCIILiteral(&quot;default&quot;);
</span><span class="cx">     }
</span><del>-    
</del><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return String();
</del><ins>+    return { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Notification::requestPermission(Document&amp; document, RefPtr&lt;NotificationPermissionCallback&gt;&amp;&amp; callback)
</span><span class="cx"> {
</span><span class="cx">     NotificationController::from(document.page())-&gt;client()-&gt;requestPermission(&amp;document, WTFMove(callback));
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/Notification.h (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/Notification.h        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/Modules/notifications/Notification.h        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2011, 2012, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -29,131 +29,106 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef Notification_h  
-#define Notification_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><ins>+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
</ins><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><del>-#include &quot;EventNames.h&quot;
</del><span class="cx"> #include &quot;EventTarget.h&quot;
</span><span class="cx"> #include &quot;NotificationClient.h&quot;
</span><del>-#include &quot;ThreadableLoaderClient.h&quot;
</del><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &quot;WritingMode.h&quot;
</span><del>-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/text/AtomicStringHash.h&gt;
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class Dictionary;
</del><span class="cx"> class Document;
</span><span class="cx"> class NotificationCenter;
</span><span class="cx"> class NotificationPermissionCallback;
</span><del>-class ResourceError;
-class ResourceResponse;
-class ThreadableLoader;
</del><span class="cx"> 
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx"> 
</span><span class="cx"> class Notification final : public RefCounted&lt;Notification&gt;, public ActiveDOMObject, public EventTargetWithInlineData {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    WEBCORE_EXPORT Notification();
</del><span class="cx"> #if ENABLE(LEGACY_NOTIFICATIONS)
</span><del>-    static Ref&lt;Notification&gt; create(const String&amp; title, const String&amp; body, const String&amp; iconURI, ScriptExecutionContext&amp;, ExceptionCode&amp;, PassRefPtr&lt;NotificationCenter&gt; provider);
</del><ins>+    static Ref&lt;Notification&gt; create(const String&amp; title, const String&amp; body, const String&amp; iconURL, ScriptExecutionContext&amp;, ExceptionCode&amp;, NotificationCenter&amp;);
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-    static Ref&lt;Notification&gt; create(Document&amp;, const String&amp; title, const Dictionary&amp; options);
</del><ins>+    enum class Direction { Auto, Ltr, Rtl };
+    struct Options {
+        Direction dir;
+        String lang;
+        String body;
+        String tag;
+        String icon;
+    };
+    static Ref&lt;Notification&gt; create(Document&amp;, const String&amp; title, const Options&amp;);
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><del>-    WEBCORE_EXPORT virtual ~Notification();
</del><ins>+    virtual ~Notification();
</ins><span class="cx"> 
</span><span class="cx">     void show();
</span><del>-#if ENABLE(LEGACY_NOTIFICATIONS)
-    void cancel() { close(); }
-#endif
</del><span class="cx">     void close();
</span><span class="cx"> 
</span><del>-    URL iconURL() const { return m_icon; }
-    void setIconURL(const URL&amp; url) { m_icon = url; }
</del><ins>+    const URL&amp; iconURL() const { return m_icon; }
+    const String&amp; title() const { return m_title; }
+    const String&amp; body() const { return m_body; }
+    const String&amp; lang() const { return m_lang; }
</ins><span class="cx"> 
</span><del>-    String title() const { return m_title; }
-    String body() const { return m_body; }
-
-    String lang() const { return m_lang; }
-    void setLang(const String&amp; lang) { m_lang = lang; }
-
-    String dir() const { return m_direction; }
</del><ins>+#if ENABLE(LEGACY_NOTIFICATIONS)
+    const String&amp; dir() const { return m_direction; }
</ins><span class="cx">     void setDir(const String&amp; dir) { m_direction = dir; }
</span><span class="cx"> 
</span><del>-#if ENABLE(LEGACY_NOTIFICATIONS)
-    String replaceId() const { return tag(); }
-    void setReplaceId(const String&amp; replaceId) { setTag(replaceId); }
</del><ins>+    const String&amp; replaceId() const { return m_tag; }
+    void setReplaceId(const String&amp; replaceId) { m_tag = replaceId; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    String tag() const { return m_tag; }
</del><ins>+    const String&amp; tag() const { return m_tag; }
</ins><span class="cx">     void setTag(const String&amp; tag) { m_tag = tag; }
</span><span class="cx"> 
</span><del>-    TextDirection direction() const { return dir() == &quot;rtl&quot; ? RTL : LTR; }
</del><ins>+    TextDirection direction() const { return m_direction == &quot;rtl&quot; ? RTL : LTR; }
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void dispatchClickEvent();
</span><span class="cx">     WEBCORE_EXPORT void dispatchCloseEvent();
</span><span class="cx">     WEBCORE_EXPORT void dispatchErrorEvent();
</span><span class="cx">     WEBCORE_EXPORT void dispatchShowEvent();
</span><span class="cx"> 
</span><del>-    using RefCounted&lt;Notification&gt;::ref;
-    using RefCounted&lt;Notification&gt;::deref;
-
-    // EventTarget interface
-    EventTargetInterface eventTargetInterface() const override { return NotificationEventTargetInterfaceType; }
-    ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
-
-    void stopLoadingIcon();
-
-    // Deprecated. Use functions from NotificationCenter.
-    void detachPresenter() { }
-
</del><span class="cx">     WEBCORE_EXPORT void finalize();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-    static const String permission(Document&amp;);
-    WEBCORE_EXPORT static const String permissionString(NotificationClient::Permission);
</del><ins>+    static String permission(Document&amp;);
+    WEBCORE_EXPORT static String permissionString(NotificationClient::Permission);
</ins><span class="cx">     static void requestPermission(Document&amp;, RefPtr&lt;NotificationPermissionCallback&gt;&amp;&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
+
+    using RefCounted::ref;
+    using RefCounted::deref;
+
</ins><span class="cx"> private:
</span><span class="cx"> #if ENABLE(LEGACY_NOTIFICATIONS)
</span><del>-    Notification(const String&amp; title, const String&amp; body, const String&amp; iconURI, ScriptExecutionContext&amp;, ExceptionCode&amp;, PassRefPtr&lt;NotificationCenter&gt;);
</del><ins>+    Notification(const String&amp; title, const String&amp; body, const String&amp; iconURL, ScriptExecutionContext&amp;, ExceptionCode&amp;, NotificationCenter&amp;);
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-    Notification(ScriptExecutionContext&amp;, const String&amp; title);
</del><ins>+    Notification(Document&amp;, const String&amp; title);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void setBody(const String&amp; body) { m_body = body; }
</del><ins>+    EventTargetInterface eventTargetInterface() const final { return NotificationEventTargetInterfaceType; }
</ins><span class="cx"> 
</span><del>-    // ActiveDOMObject API.
-    void contextDestroyed() override;
-    const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
</del><ins>+    void contextDestroyed() final;
+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
</ins><span class="cx"> 
</span><del>-    // EventTarget API.
-    void refEventTarget() override { ref(); }
-    void derefEventTarget() override { deref(); }
</del><ins>+    void refEventTarget() final { ref(); }
+    void derefEventTarget() final { deref(); }
</ins><span class="cx"> 
</span><del>-    void startLoadingIcon();
-    void finishLoadingIcon();
-
-#if ENABLE(NOTIFICATIONS)
-    void taskTimerFired();
-#endif
-
-    // Text notifications.
</del><span class="cx">     URL m_icon;
</span><span class="cx">     String m_title;
</span><span class="cx">     String m_body;
</span><span class="lines">@@ -161,14 +136,9 @@
</span><span class="cx">     String m_lang;
</span><span class="cx">     String m_tag;
</span><span class="cx"> 
</span><del>-    enum NotificationState {
-        Idle = 0,
-        Showing = 1,
-        Closed = 2,
-    };
</del><ins>+    enum State { Idle, Showing, Closed };
+    State m_state { Idle };
</ins><span class="cx"> 
</span><del>-    NotificationState m_state;
-
</del><span class="cx">     RefPtr&lt;NotificationCenter&gt; m_notificationCenter;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><span class="lines">@@ -179,5 +149,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
</span><del>-
-#endif // Notifications_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/Notification.idl (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/Notification.idl        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/Modules/notifications/Notification.idl        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -34,12 +34,12 @@
</span><span class="cx">     ActiveDOMObject,
</span><span class="cx">     ExportMacro=WEBCORE_EXPORT,
</span><span class="cx"> #if defined(ENABLE_NOTIFICATIONS) &amp;&amp; ENABLE_NOTIFICATIONS
</span><del>-    Constructor(DOMString title, optional Dictionary options),
</del><ins>+    Constructor(DOMString title, optional NotificationOptions options),
</ins><span class="cx">     ConstructorCallWith=Document,
</span><span class="cx"> #endif
</span><span class="cx"> ] interface Notification : EventTarget {
</span><span class="cx">     void show();
</span><del>-    [Conditional=LEGACY_NOTIFICATIONS] void cancel();
</del><ins>+    [Conditional=LEGACY_NOTIFICATIONS, ImplementedAs=close] void cancel();
</ins><span class="cx">     [Conditional=NOTIFICATIONS] void close();
</span><span class="cx"> 
</span><span class="cx">     [Conditional=NOTIFICATIONS, CallWith=Document] static readonly attribute DOMString permission;
</span><span class="lines">@@ -53,6 +53,16 @@
</span><span class="cx"> 
</span><span class="cx">     [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString dir;
</span><span class="cx">     [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString replaceId;
</span><ins>+
</ins><span class="cx">     [Conditional=NOTIFICATIONS] attribute DOMString tag;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+[Conditional=NOTIFICATIONS] enum NotificationDirection { &quot;auto&quot;, &quot;ltr&quot;, &quot;rtl&quot; };
+
+[Conditional=NOTIFICATIONS] dictionary NotificationOptions {
+    NotificationDirection dir = &quot;auto&quot;;
+    DOMString lang = &quot;&quot;;
+    DOMString body = &quot;&quot;;
+    DOMString tag = &quot;&quot;;
+    DOMString icon;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationCentercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/NotificationCenter.cpp (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/NotificationCenter.cpp        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/Modules/notifications/NotificationCenter.cpp        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;Notification.h&quot;
</span><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><ins>+#include &quot;VoidCallback.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -63,7 +64,7 @@
</span><span class="cx">         ec = INVALID_STATE_ERR;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-    return Notification::create(title, body, iconURI, *scriptExecutionContext(), ec, this);
</del><ins>+    return Notification::create(title, body, iconURI, *scriptExecutionContext(), ec, *this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int NotificationCenter::checkPermission()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/NotificationClient.h (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/NotificationClient.h        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/Modules/notifications/NotificationClient.h        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -29,23 +29,19 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef NotificationClient_h
-#define NotificationClient_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#include &quot;NotificationPermissionCallback.h&quot;
-#include &quot;VoidCallback.h&quot;
-#include &lt;wtf/PassRefPtr.h&gt;
</del><ins>+#include &lt;wtf/Forward.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class Document;
-class URL;
</del><span class="cx"> class Notification;
</span><ins>+class NotificationPermissionCallback;
</ins><span class="cx"> class Page;
</span><span class="cx"> class ScriptExecutionContext;
</span><ins>+class VoidCallback;
</ins><span class="cx"> 
</span><span class="cx"> class NotificationClient {
</span><del>-
</del><span class="cx"> public:
</span><span class="cx">     enum Permission {
</span><span class="cx">         PermissionAllowed, // User has allowed notifications
</span><span class="lines">@@ -71,10 +67,10 @@
</span><span class="cx">     // Informs the presenter the controller attached to the page has been destroyed.
</span><span class="cx">     virtual void notificationControllerDestroyed() = 0;
</span><span class="cx"> 
</span><del>-#if ENABLE(LEGACY_NOTIFICATIONS)
</del><span class="cx">     // Requests user permission to show desktop notifications from a particular
</span><span class="cx">     // script context. The callback parameter should be run when the user has
</span><span class="cx">     // made a decision.
</span><ins>+#if ENABLE(LEGACY_NOTIFICATIONS)
</ins><span class="cx">     virtual void requestPermission(ScriptExecutionContext*, RefPtr&lt;VoidCallback&gt;&amp;&amp;) = 0;
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><span class="lines">@@ -96,5 +92,3 @@
</span><span class="cx"> WEBCORE_EXPORT void provideNotification(Page*, NotificationClient*);
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // NotificationClient_h
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -32,156 +32,200 @@
</span><span class="cx"> 
</span><span class="cx"> enum class ShouldAllowNonFinite { No, Yes };
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt; struct Converter;
+
</ins><span class="cx"> template&lt;typename T&gt; T convert(JSC::ExecState&amp;, JSC::JSValue);
</span><ins>+template&lt;typename T&gt; T convert(JSC::ExecState&amp;, JSC::JSValue, IntegerConversionConfiguration);
</ins><span class="cx"> template&lt;typename T&gt; T convert(JSC::ExecState&amp;, JSC::JSValue, ShouldAllowNonFinite);
</span><del>-template&lt;typename T&gt; T convert(JSC::ExecState&amp;, JSC::JSValue, IntegerConversionConfiguration);
</del><span class="cx"> 
</span><del>-template&lt;typename T&gt; Optional&lt;T&gt; convertOptional(JSC::ExecState&amp;, JSC::JSValue);
</del><ins>+template&lt;typename T&gt; typename Converter&lt;T&gt;::OptionalValue convertOptional(JSC::ExecState&amp;, JSC::JSValue);
</ins><span class="cx"> template&lt;typename T, typename U&gt; T convertOptional(JSC::ExecState&amp;, JSC::JSValue, U&amp;&amp; defaultValue);
</span><span class="cx"> 
</span><del>-template&lt;typename T&gt; Optional&lt;T&gt; inline convertOptional(JSC::ExecState&amp; state, JSC::JSValue value)
-{
-    return value.isUndefined() ? Optional&lt;T&gt;() : convert&lt;T&gt;(state, value);
-}
</del><ins>+// This is where the implementation of the things declared above begins:
</ins><span class="cx"> 
</span><del>-template&lt;typename T, typename U&gt; inline T convertOptional(JSC::ExecState&amp; state, JSC::JSValue value, U&amp;&amp; defaultValue)
</del><ins>+template&lt;typename T&gt; T convert(JSC::ExecState&amp; state, JSC::JSValue value)
</ins><span class="cx"> {
</span><del>-    return value.isUndefined() ? std::forward&lt;U&gt;(defaultValue) : convert&lt;T&gt;(state, value);
</del><ins>+    return Converter&lt;T&gt;::convert(state, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; inline bool convert&lt;bool&gt;(JSC::ExecState&amp; state, JSC::JSValue value)
</del><ins>+template&lt;typename T&gt; T convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</ins><span class="cx"> {
</span><del>-    return value.toBoolean(&amp;state);
</del><ins>+    return Converter&lt;T&gt;::convert(state, value, configuration);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; inline String convert&lt;String&gt;(JSC::ExecState&amp; state, JSC::JSValue value)
</del><ins>+template&lt;typename T&gt; inline T convert(JSC::ExecState&amp; state, JSC::JSValue value, ShouldAllowNonFinite allow)
</ins><span class="cx"> {
</span><del>-    return value.toWTFString(&amp;state);
-}
-
-template&lt;typename T&gt; inline T convert(JSC::ExecState&amp; state, JSC::JSValue value, ShouldAllowNonFinite allowNonFinite)
-{
-    static_assert(std::is_same&lt;T, float&gt;::value || std::is_same&lt;T, double&gt;::value, &quot;Should be called with converting to float or double&quot;);
</del><ins>+    static_assert(std::is_same&lt;T, float&gt;::value || std::is_same&lt;T, double&gt;::value, &quot;ShouldAllowNonFinite can only be used with float or double&quot;);
</ins><span class="cx">     double number = value.toNumber(&amp;state);
</span><del>-    if (allowNonFinite == ShouldAllowNonFinite::No &amp;&amp; UNLIKELY(!std::isfinite(number)))
</del><ins>+    if (allow == ShouldAllowNonFinite::No &amp;&amp; UNLIKELY(!std::isfinite(number)))
</ins><span class="cx">         throwNonFiniteTypeError(state);
</span><span class="cx">     return static_cast&lt;T&gt;(number);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; inline Vector&lt;String&gt; convert&lt;Vector&lt;String&gt;&gt;(JSC::ExecState&amp; state, JSC::JSValue value)
</del><ins>+template&lt;typename T&gt; typename Converter&lt;T&gt;::OptionalValue inline convertOptional(JSC::ExecState&amp; state, JSC::JSValue value)
</ins><span class="cx"> {
</span><del>-    // FIXME: The toNativeArray function doesn't throw a type error if the value is not an object. Is that really OK?
-    return toNativeArray&lt;String&gt;(&amp;state, value);
</del><ins>+    return value.isUndefined() ? typename Converter&lt;T&gt;::OptionalValue() : convert&lt;T&gt;(state, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; inline int8_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+template&lt;typename T, typename U&gt; inline T convertOptional(JSC::ExecState&amp; state, JSC::JSValue value, U&amp;&amp; defaultValue)
</ins><span class="cx"> {
</span><del>-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toInt8EnforceRange(state, value);
-    case Clamp:
-        return toInt8Clamp(state, value);
-    }
-    return toInt8(state, value);
</del><ins>+    return value.isUndefined() ? std::forward&lt;U&gt;(defaultValue) : convert&lt;T&gt;(state, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; inline uint8_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toUInt8EnforceRange(state, value);
-    case Clamp:
-        return toUInt8Clamp(state, value);
</del><ins>+template&lt;typename T&gt; struct DefaultConverter {
+    using OptionalValue = Optional&lt;T&gt;;
+};
+
+template&lt;typename T&gt; struct Converter : DefaultConverter&lt;T&gt; {
+};
+
+template&lt;&gt; struct Converter&lt;bool&gt; : DefaultConverter&lt;bool&gt; {
+    static bool convert(JSC::ExecState&amp; state, JSC::JSValue value)
+    {
+        return value.toBoolean(&amp;state);
</ins><span class="cx">     }
</span><del>-    return toUInt8(state, value);
-}
</del><ins>+};
</ins><span class="cx"> 
</span><del>-template&lt;&gt; inline int16_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toInt16EnforceRange(state, value);
-    case Clamp:
-        return toInt16Clamp(state, value);
</del><ins>+template&lt;&gt; struct Converter&lt;String&gt; : DefaultConverter&lt;String&gt; {
+    using OptionalValue = String; // Use null string to mean an optional value was not present.
+    static String convert(JSC::ExecState&amp; state, JSC::JSValue value)
+    {
+        return value.toWTFString(&amp;state);
</ins><span class="cx">     }
</span><del>-    return toInt16(state, value);
-}
</del><ins>+};
</ins><span class="cx"> 
</span><del>-template&lt;&gt; inline uint16_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toUInt16EnforceRange(state, value);
-    case Clamp:
-        return toUInt16Clamp(state, value);
</del><ins>+template&lt;typename T&gt; struct Converter&lt;Vector&lt;T&gt;&gt; : DefaultConverter&lt;Vector&lt;T&gt;&gt; {
+    static Vector&lt;T&gt; convert(JSC::ExecState&amp; state, JSC::JSValue value)
+    {
+        // FIXME: The toNativeArray function doesn't throw a type error if the value is not an object. Is that OK?
+        return toNativeArray&lt;T&gt;(&amp;state, value);
</ins><span class="cx">     }
</span><del>-    return toUInt16(state, value);
-}
</del><ins>+};
</ins><span class="cx"> 
</span><del>-template&lt;&gt; inline int32_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toInt32EnforceRange(state, value);
-    case Clamp:
-        return toInt32Clamp(state, value);
</del><ins>+template&lt;&gt; struct Converter&lt;int8_t&gt; : DefaultConverter&lt;int8_t&gt; {
+    static int8_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toInt8EnforceRange(state, value);
+        case Clamp:
+            return toInt8Clamp(state, value);
+        }
+        return toInt8(state, value);
</ins><span class="cx">     }
</span><del>-    return value.toInt32(&amp;state);
-}
</del><ins>+};
</ins><span class="cx"> 
</span><del>-template&lt;&gt; inline uint32_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toUInt32EnforceRange(state, value);
-    case Clamp:
-        return toUInt32Clamp(state, value);
</del><ins>+template&lt;&gt; struct Converter&lt;uint8_t&gt; : DefaultConverter&lt;uint8_t&gt; {
+    static uint8_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toUInt8EnforceRange(state, value);
+        case Clamp:
+            return toUInt8Clamp(state, value);
+        }
+        return toUInt8(state, value);
</ins><span class="cx">     }
</span><del>-    return value.toUInt32(&amp;state);
-}
</del><ins>+};
</ins><span class="cx"> 
</span><del>-template&lt;&gt; inline int64_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    if (value.isInt32())
-        return value.asInt32();
</del><ins>+template&lt;&gt; struct Converter&lt;int16_t&gt; : DefaultConverter&lt;int16_t&gt; {
+    static int16_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toInt16EnforceRange(state, value);
+        case Clamp:
+            return toInt16Clamp(state, value);
+        }
+        return toInt16(state, value);
+    }
+};
</ins><span class="cx"> 
</span><del>-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toInt64EnforceRange(state, value);
-    case Clamp:
-        return toInt64Clamp(state, value);
</del><ins>+template&lt;&gt; struct Converter&lt;uint16_t&gt; : DefaultConverter&lt;uint16_t&gt; {
+    static uint16_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toUInt16EnforceRange(state, value);
+        case Clamp:
+            return toUInt16Clamp(state, value);
+        }
+        return toUInt16(state, value);
</ins><span class="cx">     }
</span><del>-    return toInt64(state, value);
-}
</del><ins>+};
</ins><span class="cx"> 
</span><del>-template&lt;&gt; inline uint64_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    if (value.isUInt32())
-        return value.asUInt32();
</del><ins>+template&lt;&gt; struct Converter&lt;int32_t&gt; : DefaultConverter&lt;int32_t&gt; {
+    static int32_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toInt32EnforceRange(state, value);
+        case Clamp:
+            return toInt32Clamp(state, value);
+        }
+        return value.toInt32(&amp;state);
+    }
+};
</ins><span class="cx"> 
</span><del>-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toUInt64EnforceRange(state, value);
-    case Clamp:
-        return toUInt64Clamp(state, value);
</del><ins>+template&lt;&gt; struct Converter&lt;uint32_t&gt; : DefaultConverter&lt;uint32_t&gt; {
+    static uint32_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toUInt32EnforceRange(state, value);
+        case Clamp:
+            return toUInt32Clamp(state, value);
+        }
+        return value.toUInt32(&amp;state);
</ins><span class="cx">     }
</span><del>-    return toUInt64(state, value);
-}
</del><ins>+};
</ins><span class="cx"> 
</span><ins>+template&lt;&gt; struct Converter&lt;int64_t&gt; : DefaultConverter&lt;int64_t&gt; {
+    static int64_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        if (value.isInt32())
+            return value.asInt32();
+
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toInt64EnforceRange(state, value);
+        case Clamp:
+            return toInt64Clamp(state, value);
+        }
+        return toInt64(state, value);
+    }
+};
+
+template&lt;&gt; struct Converter&lt;uint64_t&gt; : DefaultConverter&lt;uint64_t&gt; {
+    static uint64_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+    {
+        if (value.isUInt32())
+            return value.asUInt32();
+
+        switch (configuration) {
+        case NormalConversion:
+            break;
+        case EnforceRange:
+            return toUInt64EnforceRange(state, value);
+        case Clamp:
+            return toUInt64Clamp(state, value);
+        }
+        return toUInt64(state, value);
+    }
+};
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> # Copyright (C) 2006 Anders Carlsson &lt;andersca@mac.com&gt;
</span><span class="cx"> # Copyright (C) 2006, 2007 Samuel Weinig &lt;sam@webkit.org&gt;
</span><span class="cx"> # Copyright (C) 2006 Alexey Proskuryakov &lt;ap@webkit.org&gt;
</span><del>-# Copyright (C) 2006, 2007-2010, 2013-2016 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2006-2010, 2013-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> # Copyright (C) 2009 Cameron McCormack &lt;cam@mcc.id.au&gt;
</span><span class="cx"> # Copyright (C) Research In Motion Limited 2010. All rights reserved.
</span><span class="cx"> # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="lines">@@ -861,16 +861,15 @@
</span><span class="cx">         my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($enumeration);
</span><span class="cx">         $result .= &quot;#if ${conditionalString}\n\n&quot; if $conditionalString;
</span><span class="cx"> 
</span><del>-        # Declare this instead of using &quot;static&quot; because it may be unused and we don't
-        # want to get warnings about it.
-        $result .= &quot;JSString* jsStringWithCache(ExecState*, $className);\n&quot;;
</del><ins>+        # Declare this instead of using &quot;static&quot; because it may be unused and we don't want warnings about that.
+        $result .= &quot;JSString* jsStringWithCache(ExecState*, $className);\n\n&quot;;
</ins><span class="cx"> 
</span><span class="cx">         # Take an ExecState* instead of an ExecState&amp; to match the jsStringWithCache from JSString.h.
</span><span class="cx">         # FIXME: Change to take VM&amp; instead of ExecState*.
</span><span class="cx">         $result .= &quot;JSString* jsStringWithCache(ExecState* state, $className enumerationValue)\n&quot;;
</span><span class="cx">         $result .= &quot;{\n&quot;;
</span><span class="cx">         # FIXME: Might be nice to make this global be &quot;const&quot;, but NeverDestroyed does not currently support that.
</span><del>-        # FIXME: Might be nice to make the entire array be NeverDestroyed instead of each value, but not sure the syntax for that.
</del><ins>+        # FIXME: Might be nice to make the entire array be NeverDestroyed instead of each value, but not sure what the syntax for that is.
</ins><span class="cx">         $result .= &quot;    static NeverDestroyed&lt;const String&gt; values[] = {\n&quot;;
</span><span class="cx">         foreach my $value (@{$enumeration-&gt;values}) {
</span><span class="cx">             if ($value eq &quot;&quot;) {
</span><span class="lines">@@ -942,6 +941,31 @@
</span><span class="cx">     return GetNestedClassName($interface, $name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GenerateDefaultValue
+{
+    my ($interface, $member) = @_;
+
+    my $value = $member-&gt;default;
+
+    if ($codeGenerator-&gt;IsEnumType($member-&gt;type)) {
+        # FIXME: Would be nice to report an error if the value does not have quote marks around it.
+        # FIXME: Would be nice to report an error if the value is not one of the enumeration values.
+        my $className = GetEnumerationClassName($interface, $member-&gt;type);
+        my $enumerationValueName = GetEnumerationValueName(substr($value, 1, -1));
+        $value = $className . &quot;::&quot; . $enumerationValueName;
+    }
+
+    return $value;
+}
+
+sub GenerateDefaultValueWithLeadingComma
+{
+    my ($interface, $member) = @_;
+
+    return &quot;&quot; unless $member-&gt;isOptional &amp;&amp; defined $member-&gt;default;
+    return &quot;, &quot; . GenerateDefaultValue($interface, $member);
+}
+
</ins><span class="cx"> sub GenerateDictionaryImplementationContent
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $dictionaries) = @_;
</span><span class="lines">@@ -965,7 +989,7 @@
</span><span class="cx">                 $defaultValues = &quot;&quot;;
</span><span class="cx">                 last;
</span><span class="cx">             }
</span><del>-            $defaultValues .= $comma . (defined $member-&gt;default ? $member-&gt;default : &quot;Nullopt&quot;);
</del><ins>+            $defaultValues .= $comma . (defined $member-&gt;default ? GenerateDefaultValue($interface, $member) : &quot;{ }&quot;);
</ins><span class="cx">             $comma = &quot;, &quot;;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -985,11 +1009,12 @@
</span><span class="cx">                 $result .= &quot;    if (UNLIKELY(state.hadException()))\n&quot;;
</span><span class="cx">                 $result .= &quot;        return { };\n&quot;;
</span><span class="cx">             }
</span><del>-            # FIXME: Eventually we will want this to call JSValueToNative.
</del><ins>+            # FIXME: Eventually we will want this to share a lot more code with JSValueToNative.
</ins><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, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, \&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;
+                . GenerateDefaultValueWithLeadingComma($interface, $member) . &quot;);\n&quot;;
</ins><span class="cx">             $needExceptionCheck = 1;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -3716,12 +3741,13 @@
</span><span class="cx">             push(@$outputArray, &quot;    $nativeType $name;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             if ($parameter-&gt;isOptional) {
</span><del>-                push(@$outputArray, &quot;    if (${name}Value.isUndefined()) {\n&quot;);
-                if (defined($parameter-&gt;default)) {
-                    my $enumerationValueName = GetEnumerationValueName(substr($parameter-&gt;default, 1, -1));
-                    push(@$outputArray, &quot;        $name = ${className}::${enumerationValueName};\n&quot;);
</del><ins>+                if (!defined $parameter-&gt;default) {
+                    push(@$outputArray, &quot;    if (!${name}Value.isUndefined()) {\n&quot;);
+                } else {
+                    push(@$outputArray, &quot;    if (${name}Value.isUndefined()) {\n&quot;);
+                    push(@$outputArray, &quot;        $name = &quot; . GenerateDefaultValue($interface, $parameter) . &quot;;\n&quot;);
+                    push(@$outputArray, &quot;    } else {\n&quot;);
</ins><span class="cx">                 }
</span><del>-                push(@$outputArray, &quot;    } else {\n&quot;);
</del><span class="cx">                 $indent = &quot;    &quot;;
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> #include &quot;WebKitDOMNodePrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitDOMPrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitDOMSVGPointPrivate.h&quot;
</span><del>-#include &quot;WebKitDOMShadowRootInitPrivate.h&quot;
</del><ins>+#include &quot;WebKitDOMTestDictionaryPrivate.h&quot;
</ins><span class="cx"> #include &quot;WebKitDOMTestEnumTypePrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitDOMTestNodePrivate.h&quot;
</span><span class="cx"> #include &quot;WebKitDOMTestObjPrivate.h&quot;
</span><span class="lines">@@ -1413,6 +1413,16 @@
</span><span class="cx">     item-&gt;methodWithEnumArg(convertedEnumArg);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void webkit_dom_test_obj_method_with_optional_enum_arg(WebKitDOMTestObj* self, WebKitDOMTestEnumType* enumArg)
+{
+    WebCore::JSMainThreadNullState state;
+    g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+    g_return_if_fail(WEBKIT_DOM_IS_TEST_ENUM_TYPE(enumArg));
+    WebCore::TestObj* item = WebKit::core(self);
+    WebCore::TestEnumType* convertedEnumArg = WebKit::core(enumArg);
+    item-&gt;methodWithOptionalEnumArg(convertedEnumArg);
+}
+
</ins><span class="cx"> void webkit_dom_test_obj_method_with_optional_enum_arg_and_default_value(WebKitDOMTestObj* self, WebKitDOMTestEnumType* enumArg)
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -2022,13 +2032,13 @@
</span><span class="cx">     item-&gt;any(a, b);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void webkit_dom_test_obj_attach_shadow_root(WebKitDOMTestObj* self, WebKitDOMShadowRootInit* init)
</del><ins>+void webkit_dom_test_obj_attach_shadow_root(WebKitDOMTestObj* self, WebKitDOMTestDictionary* init)
</ins><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
</span><del>-    g_return_if_fail(WEBKIT_DOM_IS_SHADOW_ROOT_INIT(init));
</del><ins>+    g_return_if_fail(WEBKIT_DOM_IS_TEST_DICTIONARY(init));
</ins><span class="cx">     WebCore::TestObj* item = WebKit::core(self);
</span><del>-    WebCore::ShadowRootInit* convertedInit = WebKit::core(init);
</del><ins>+    WebCore::TestDictionary* convertedInit = WebKit::core(init);
</ins><span class="cx">     item-&gt;attachShadowRoot(convertedInit);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -320,6 +320,16 @@
</span><span class="cx"> webkit_dom_test_obj_method_with_enum_arg(WebKitDOMTestObj* self, WebKitDOMTestEnumType* enumArg);
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_method_with_optional_enum_arg:
+ * @self: A #WebKitDOMTestObj
+ * @enumArg: A #WebKitDOMTestEnumType
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_method_with_optional_enum_arg(WebKitDOMTestObj* self, WebKitDOMTestEnumType* enumArg);
+
+/**
</ins><span class="cx">  * webkit_dom_test_obj_method_with_optional_enum_arg_and_default_value:
</span><span class="cx">  * @self: A #WebKitDOMTestObj
</span><span class="cx">  * @enumArg: A #WebKitDOMTestEnumType
</span><span class="lines">@@ -935,12 +945,12 @@
</span><span class="cx"> /**
</span><span class="cx">  * webkit_dom_test_obj_attach_shadow_root:
</span><span class="cx">  * @self: A #WebKitDOMTestObj
</span><del>- * @init: A #WebKitDOMShadowRootInit
</del><ins>+ * @init: A #WebKitDOMTestDictionary
</ins><span class="cx">  *
</span><span class="cx">  * Stability: Unstable
</span><span class="cx"> **/
</span><span class="cx"> WEBKIT_API void
</span><del>-webkit_dom_test_obj_attach_shadow_root(WebKitDOMTestObj* self, WebKitDOMShadowRootInit* init);
</del><ins>+webkit_dom_test_obj_attach_shadow_root(WebKitDOMTestObj* self, WebKitDOMTestDictionary* init);
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * webkit_dom_test_obj_get_read_only_long_attr:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -93,11 +93,12 @@
</span><span class="cx"> template&lt;typename T&gt; const char* expectedEnumerationValues();
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::EnumType);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::EnumType enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="cx">         emptyString(),
</span><del>-        ASCIILiteral(&quot;EnumValue1&quot;),
</del><ins>+        ASCIILiteral(&quot;enumValue1&quot;),
</ins><span class="cx">         ASCIILiteral(&quot;EnumValue2&quot;),
</span><span class="cx">         ASCIILiteral(&quot;EnumValue3&quot;),
</span><span class="cx">     };
</span><span class="lines">@@ -118,7 +119,7 @@
</span><span class="cx">     auto stringValue = value.toWTFString(&amp;state);
</span><span class="cx">     if (stringValue.isEmpty())
</span><span class="cx">         return TestObj::EnumType::EmptyString;
</span><del>-    if (stringValue == &quot;EnumValue1&quot;)
</del><ins>+    if (stringValue == &quot;enumValue1&quot;)
</ins><span class="cx">         return TestObj::EnumType::EnumValue1;
</span><span class="cx">     if (stringValue == &quot;EnumValue2&quot;)
</span><span class="cx">         return TestObj::EnumType::EnumValue2;
</span><span class="lines">@@ -139,10 +140,11 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt; inline const char* expectedEnumerationValues&lt;TestObj::EnumType&gt;()
</span><span class="cx"> {
</span><del>-    return &quot;\&quot;\&quot;, \&quot;EnumValue1\&quot;, \&quot;EnumValue2\&quot;, \&quot;EnumValue3\&quot;&quot;;
</del><ins>+    return &quot;\&quot;\&quot;, \&quot;enumValue1\&quot;, \&quot;EnumValue2\&quot;, \&quot;EnumValue3\&quot;&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::Optional);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::Optional enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="lines">@@ -195,6 +197,7 @@
</span><span class="cx"> #if ENABLE(Condition1)
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::EnumA);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::EnumA enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="lines">@@ -237,6 +240,7 @@
</span><span class="cx"> #if ENABLE(Condition1) &amp;&amp; ENABLE(Condition2)
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::EnumB);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::EnumB enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="lines">@@ -279,6 +283,7 @@
</span><span class="cx"> #if ENABLE(Condition1) || ENABLE(Condition2)
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::EnumC);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::EnumC enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="lines">@@ -319,6 +324,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::Kind);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::Kind enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="lines">@@ -361,6 +367,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::Size);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::Size enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="lines">@@ -403,6 +410,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSString* jsStringWithCache(ExecState*, TestObj::Confidence);
</span><ins>+
</ins><span class="cx"> JSString* jsStringWithCache(ExecState* state, TestObj::Confidence enumerationValue)
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="lines">@@ -444,92 +452,68 @@
</span><span class="cx">     return &quot;\&quot;high\&quot;, \&quot;kinda-low\&quot;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSString* jsStringWithCache(ExecState*, TestObj::ShadowRootMode);
-JSString* jsStringWithCache(ExecState* state, TestObj::ShadowRootMode enumerationValue)
</del><ins>+template&lt;&gt; TestObj::Dictionary convert&lt;TestObj::Dictionary&gt;(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;const String&gt; values[] = {
-        ASCIILiteral(&quot;open&quot;),
-        ASCIILiteral(&quot;closed&quot;),
-    };
-    static_assert(static_cast&lt;size_t&gt;(TestObj::ShadowRootMode::Open) == 0, &quot;TestObj::ShadowRootMode::Open is not 0 as expected&quot;);
-    static_assert(static_cast&lt;size_t&gt;(TestObj::ShadowRootMode::Closed) == 1, &quot;TestObj::ShadowRootMode::Closed is not 1 as expected&quot;);
-    ASSERT(static_cast&lt;size_t&gt;(enumerationValue) &lt; WTF_ARRAY_LENGTH(values));
-    return jsStringWithCache(state, values[static_cast&lt;size_t&gt;(enumerationValue)]);
-}
-
-template&lt;&gt; struct JSValueTraits&lt;TestObj::ShadowRootMode&gt; {
-    static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, TestObj::ShadowRootMode value) { return jsStringWithCache(state, value); }
-};
-
-template&lt;&gt; Optional&lt;TestObj::ShadowRootMode&gt; parse&lt;TestObj::ShadowRootMode&gt;(ExecState&amp; state, JSValue value)
-{
-    auto stringValue = value.toWTFString(&amp;state);
-    if (stringValue == &quot;open&quot;)
-        return TestObj::ShadowRootMode::Open;
-    if (stringValue == &quot;closed&quot;)
-        return TestObj::ShadowRootMode::Closed;
-    return Nullopt;
-}
-
-template&lt;&gt; TestObj::ShadowRootMode convert&lt;TestObj::ShadowRootMode&gt;(ExecState&amp; state, JSValue value)
-{
-    auto result = parse&lt;TestObj::ShadowRootMode&gt;(state, value);
-    if (UNLIKELY(!result)) {
-        throwTypeError(&amp;state);
-        return { };
-    }
-    return result.value();
-}
-
-template&lt;&gt; inline const char* expectedEnumerationValues&lt;TestObj::ShadowRootMode&gt;()
-{
-    return &quot;\&quot;open\&quot;, \&quot;closed\&quot;&quot;;
-}
-
-template&lt;&gt; TestObj::ShadowRootInit convert&lt;TestObj::ShadowRootInit&gt;(ExecState&amp; state, JSValue value)
-{
</del><ins>+    if (value.isUndefinedOrNull())
+        return { { }, TestObj::EnumType::EnumValue1, TestObj::EnumType::EmptyString, &quot;defaultString&quot;, { }, false, { }, { } };
</ins><span class="cx">     auto* object = value.getObject();
</span><span class="cx">     if (UNLIKELY(!object || object-&gt;type() == RegExpObjectType)) {
</span><span class="cx">         throwTypeError(&amp;state);
</span><span class="cx">         return { };
</span><span class="cx">     }
</span><del>-    auto mode = convert&lt;TestObj::ShadowRootMode&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;mode&quot;)));
-    return { WTFMove(mode) };
</del><ins>+    auto enumerationValueWithoutDefault = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithoutDefault&quot;)));
+    if (UNLIKELY(state.hadException()))
+        return { };
+    auto enumerationValueWithDefault = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithDefault&quot;)), TestObj::EnumType::EnumValue1);
+    if (UNLIKELY(state.hadException()))
+        return { };
+    auto enumerationValueWithEmptyStringDefault = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithEmptyStringDefault&quot;)), TestObj::EnumType::EmptyString);
+    if (UNLIKELY(state.hadException()))
+        return { };
+    auto stringWithDefault = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithDefault&quot;)), &quot;defaultString&quot;);
+    if (UNLIKELY(state.hadException()))
+        return { };
+    auto stringWithoutDefault = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithoutDefault&quot;)));
+    if (UNLIKELY(state.hadException()))
+        return { };
+    auto booleanWithDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithDefault&quot;)), false);
+    if (UNLIKELY(state.hadException()))
+        return { };
+    auto booleanWithoutDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;)));
+    if (UNLIKELY(state.hadException()))
+        return { };
+    auto sequenceOfStrings = convertOptional&lt;Vector&lt;String&gt;&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;sequenceOfStrings&quot;)));
+    return { WTFMove(enumerationValueWithoutDefault), WTFMove(enumerationValueWithDefault), WTFMove(enumerationValueWithEmptyStringDefault), WTFMove(stringWithDefault), WTFMove(stringWithoutDefault), WTFMove(booleanWithDefault), WTFMove(booleanWithoutDefault), WTFMove(sequenceOfStrings) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; TestObj::FontFaceDescriptors convert&lt;TestObj::FontFaceDescriptors&gt;(ExecState&amp; state, JSValue value)
</del><ins>+template&lt;&gt; TestObj::DictionaryThatShouldNotTolerateNull convert&lt;TestObj::DictionaryThatShouldNotTolerateNull&gt;(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    if (value.isUndefinedOrNull())
-        return { &quot;normal&quot;, &quot;U+0-10FFFF&quot; };
</del><span class="cx">     auto* object = value.getObject();
</span><span class="cx">     if (UNLIKELY(!object || object-&gt;type() == RegExpObjectType)) {
</span><span class="cx">         throwTypeError(&amp;state);
</span><span class="cx">         return { };
</span><span class="cx">     }
</span><del>-    auto style = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;style&quot;)), &quot;normal&quot;);
</del><ins>+    auto requiredEnumerationValue = convert&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;requiredEnumerationValue&quot;)));
</ins><span class="cx">     if (UNLIKELY(state.hadException()))
</span><span class="cx">         return { };
</span><del>-    auto unicodeRange = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unicodeRange&quot;)), &quot;U+0-10FFFF&quot;);
-    return { WTFMove(style), WTFMove(unicodeRange) };
</del><ins>+    auto booleanWithoutDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;)));
+    return { WTFMove(requiredEnumerationValue), WTFMove(booleanWithoutDefault) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; TestObj::MutationObserverInit convert&lt;TestObj::MutationObserverInit&gt;(ExecState&amp; state, JSValue value)
</del><ins>+template&lt;&gt; TestObj::DictionaryThatShouldTolerateNull convert&lt;TestObj::DictionaryThatShouldTolerateNull&gt;(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (value.isUndefinedOrNull())
</span><del>-        return { false, Nullopt, Nullopt };
</del><ins>+        return { { }, { } };
</ins><span class="cx">     auto* object = value.getObject();
</span><span class="cx">     if (UNLIKELY(!object || object-&gt;type() == RegExpObjectType)) {
</span><span class="cx">         throwTypeError(&amp;state);
</span><span class="cx">         return { };
</span><span class="cx">     }
</span><del>-    auto childList = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;childList&quot;)), false);
</del><ins>+    auto enumerationValue = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValue&quot;)));
</ins><span class="cx">     if (UNLIKELY(state.hadException()))
</span><span class="cx">         return { };
</span><del>-    auto attributes = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;attributes&quot;)));
-    if (UNLIKELY(state.hadException()))
-        return { };
-    auto attributeFilter = convertOptional&lt;Vector&lt;String&gt;&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;attributeFilter&quot;)));
-    return { WTFMove(childList), WTFMove(attributes), WTFMove(attributeFilter) };
</del><ins>+    auto booleanWithoutDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;)));
+    return { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Functions
</span><span class="lines">@@ -556,6 +540,7 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithEnumArg(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalEnumArg(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(JSC::ExecState*);
</span><span class="lines">@@ -1127,6 +1112,7 @@
</span><span class="cx">     { &quot;methodWithSequenceArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithSequenceArg), (intptr_t) (1) } },
</span><span class="cx">     { &quot;methodReturningSequence&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodReturningSequence), (intptr_t) (1) } },
</span><span class="cx">     { &quot;methodWithEnumArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithEnumArg), (intptr_t) (1) } },
</span><ins>+    { &quot;methodWithOptionalEnumArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithOptionalEnumArg), (intptr_t) (0) } },
</ins><span class="cx">     { &quot;methodWithOptionalEnumArgAndDefaultValue&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue), (intptr_t) (0) } },
</span><span class="cx">     { &quot;methodThatRequiresAllArgsAndThrows&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t) (2) } },
</span><span class="cx">     { &quot;serializedValue&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionSerializedValue), (intptr_t) (1) } },
</span><span class="lines">@@ -4210,6 +4196,27 @@
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalEnumArg(ExecState* state)
+{
+    JSValue thisValue = state-&gt;thisValue();
+    auto castedThis = jsDynamicCast&lt;JSTestObj*&gt;(thisValue);
+    if (UNLIKELY(!castedThis))
+        return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalEnumArg&quot;);
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+    auto&amp; impl = castedThis-&gt;wrapped();
+    auto enumArgValue = state-&gt;argument(0);
+    Optional&lt;TestObj::EnumType&gt; enumArg;
+    if (!enumArgValue.isUndefined()) {
+        enumArg = parse&lt;TestObj::EnumType&gt;(*state, enumArgValue);
+        if (UNLIKELY(state-&gt;hadException()))
+            return JSValue::encode(jsUndefined());
+        if (UNLIKELY(!enumArg))
+            return throwArgumentMustBeEnumError(*state, 0, &quot;enumArg&quot;, &quot;TestObj&quot;, &quot;methodWithOptionalEnumArg&quot;, expectedEnumerationValues&lt;TestObj::EnumType&gt;());
+    }
+    impl.methodWithOptionalEnumArg(enumArg);
+    return JSValue::encode(jsUndefined());
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     JSValue thisValue = state-&gt;thisValue();
</span><span class="lines">@@ -6127,7 +6134,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>-    auto init = convert&lt;TestObj::ShadowRootInit&gt;(*state, state-&gt;argument(0));
</del><ins>+    auto init = convert&lt;TestObj::Dictionary&gt;(*state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.attachShadowRoot(WTFMove(init));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> @class DOMNode;
</span><span class="cx"> @class DOMSVGDocument;
</span><span class="cx"> @class DOMSVGPoint;
</span><del>-@class DOMShadowRootInit;
</del><ins>+@class DOMTestDictionary;
</ins><span class="cx"> @class DOMTestEnumType;
</span><span class="cx"> @class DOMTestNode;
</span><span class="cx"> @class DOMTestObj;
</span><span class="lines">@@ -155,6 +155,7 @@
</span><span class="cx"> - (NSString *)nullableStringStaticMethod;
</span><span class="cx"> - (NSString *)nullableStringSpecialMethod:(unsigned)index;
</span><span class="cx"> - (void)methodWithEnumArg:(DOMTestEnumType *)enumArg;
</span><ins>+- (void)methodWithOptionalEnumArg:(DOMTestEnumType *)enumArg;
</ins><span class="cx"> - (void)methodWithOptionalEnumArgAndDefaultValue:(DOMTestEnumType *)enumArg;
</span><span class="cx"> - (DOMTestObj *)methodThatRequiresAllArgsAndThrows:(NSString *)strArg objArg:(DOMTestObj *)objArg;
</span><span class="cx"> - (void)serializedValue:(NSString *)serializedArg;
</span><span class="lines">@@ -217,5 +218,5 @@
</span><span class="cx"> - (void)variadicDoubleMethod:(double)head tail:(double)tail;
</span><span class="cx"> - (void)variadicNodeMethod:(DOMNode *)head tail:(DOMNode *)tail;
</span><span class="cx"> - (void)any:(float)a b:(int)b;
</span><del>-- (void)attachShadowRoot:(DOMShadowRootInit *)init;
</del><ins>+- (void)attachShadowRoot:(DOMTestDictionary *)init;
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #import &quot;DOMNodeInternal.h&quot;
</span><span class="cx"> #import &quot;DOMSVGDocumentInternal.h&quot;
</span><span class="cx"> #import &quot;DOMSVGPointInternal.h&quot;
</span><del>-#import &quot;DOMShadowRootInitInternal.h&quot;
</del><ins>+#import &quot;DOMTestDictionaryInternal.h&quot;
</ins><span class="cx"> #import &quot;DOMTestEnumTypeInternal.h&quot;
</span><span class="cx"> #import &quot;DOMTestNodeInternal.h&quot;
</span><span class="cx"> #import &quot;DOMTestObjInternal.h&quot;
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> #import &quot;SVGDocument.h&quot;
</span><span class="cx"> #import &quot;SVGPoint.h&quot;
</span><span class="cx"> #import &quot;SerializedScriptValue.h&quot;
</span><del>-#import &quot;ShadowRootInit.h&quot;
</del><ins>+#import &quot;TestDictionary.h&quot;
</ins><span class="cx"> #import &quot;TestEnumType.h&quot;
</span><span class="cx"> #import &quot;TestNode.h&quot;
</span><span class="cx"> #import &quot;TestObj.h&quot;
</span><span class="lines">@@ -1154,6 +1154,12 @@
</span><span class="cx">     IMPL-&gt;methodWithEnumArg(core(enumArg));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)methodWithOptionalEnumArg:(DOMTestEnumType *)enumArg
+{
+    WebCore::JSMainThreadNullState state;
+    IMPL-&gt;methodWithOptionalEnumArg(core(enumArg));
+}
+
</ins><span class="cx"> - (void)methodWithOptionalEnumArgAndDefaultValue:(DOMTestEnumType *)enumArg
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -1641,7 +1647,7 @@
</span><span class="cx">     IMPL-&gt;any(a, b);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)attachShadowRoot:(DOMShadowRootInit *)init
</del><ins>+- (void)attachShadowRoot:(DOMTestDictionary *)init
</ins><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span><span class="cx">     IMPL-&gt;attachShadowRoot(core(init));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (200606 => 200607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-05-10 02:01:28 UTC (rev 200606)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-05-10 02:31:03 UTC (rev 200607)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> // This IDL file is for testing the bindings code generator and for tracking
</span><span class="cx"> // changes in its ouput.
</span><span class="cx"> 
</span><del>-enum TestEnumType { &quot;&quot;, &quot;EnumValue1&quot;, &quot;EnumValue2&quot;, &quot;EnumValue3&quot; };
</del><ins>+enum TestEnumType { &quot;&quot;, &quot;enumValue1&quot;, &quot;EnumValue2&quot;, &quot;EnumValue3&quot; };
</ins><span class="cx"> 
</span><span class="cx"> // Leading underscore on an enum should be removed.
</span><span class="cx"> enum _optional { &quot;&quot;, &quot;OptionalValue1&quot;, &quot;OptionalValue2&quot;, &quot;OptionalValue3&quot; };
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx">     sequence&lt;ScriptProfile&gt; methodReturningSequence(long longArg);
</span><span class="cx"> 
</span><span class="cx">     void methodWithEnumArg(TestEnumType enumArg);
</span><ins>+    void methodWithOptionalEnumArg(optional TestEnumType enumArg);
</ins><span class="cx">     void methodWithOptionalEnumArgAndDefaultValue(optional TestEnumType enumArg = &quot;EnumValue1&quot;);
</span><span class="cx">     [RaisesException] TestObj methodThatRequiresAllArgsAndThrows(DOMString strArg, TestObj objArg);
</span><span class="cx"> 
</span><span class="lines">@@ -375,24 +376,29 @@
</span><span class="cx">     [InvokesCustomElementLifecycleCallbacks] void methodWithNeedsLifecycleProcessingStack();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void attachShadowRoot(ShadowRootInit init);
</del><ins>+    void attachShadowRoot(TestDictionary init);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // The following comment should not generate any code.
</span><span class="cx"> // TestObj implements TestImplements;
</span><span class="cx"> 
</span><del>-enum ShadowRootMode { &quot;open&quot;, &quot;closed&quot; };
-dictionary ShadowRootInit {
-    required ShadowRootMode mode;
</del><ins>+dictionary TestDictionary {
+    TestEnumType enumerationValueWithoutDefault;
+    TestEnumType enumerationValueWithDefault = &quot;enumValue1&quot;;
+    TestEnumType enumerationValueWithEmptyStringDefault = &quot;&quot;;
+    DOMString stringWithDefault = &quot;defaultString&quot;;
+    DOMString stringWithoutDefault;
+    boolean booleanWithDefault = false;
+    boolean booleanWithoutDefault;
+    sequence&lt;DOMString&gt; sequenceOfStrings;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-dictionary FontFaceDescriptors {
-    DOMString style = &quot;normal&quot;;
-    DOMString unicodeRange = &quot;U+0-10FFFF&quot;;
</del><ins>+dictionary TestDictionaryThatShouldNotTolerateNull {
+    required TestEnumType requiredEnumerationValue;
+    boolean booleanWithoutDefault;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-dictionary MutationObserverInit {
-    boolean childList = false;
-    boolean attributes;
-    sequence&lt;DOMString&gt; attributeFilter;
</del><ins>+dictionary TestDictionaryThatShouldTolerateNull {
+    TestEnumType enumerationValue;
+    boolean booleanWithoutDefault;
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>