<!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>[200242] 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/200242">200242</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-04-29 09:08:00 -0700 (Fri, 29 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Web IDL] Drop 'any' type handling from CanUseWTFOptionalForParameter()
https://bugs.webkit.org/show_bug.cgi?id=157152
Reviewed by Darin Adler.
Drop 'any' type handling from CanUseWTFOptionalForParameter(). Always
use undefined as default value for parameters of type 'any' unless
specified otherwise.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::continueFunction): Deleted.
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::add): Deleted.
(WebCore::IDBObjectStore::putOrAdd): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* bindings/scripts/CodeGeneratorJS.pm:
(WillConvertUndefinedToDefaultParameterValue):
Fix optimization for optional DOMString attributes whose default value
is the string "undefined". I also added bindings test coverage for it.
(GenerateParametersCheck):
(CanUseWTFOptionalForParameter): Deleted.
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_method_with_optional_string_is_undefined):
(webkit_dom_test_obj_method_with_optional_any):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj methodWithOptionalStringIsUndefined:]):
(-[DOMTestObj methodWithOptionalAny:]):
* bindings/scripts/test/TestObj.idl:
* testing/Internals.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBObjectStoreCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp</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>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/ChangeLog        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2016-04-29 Chris Dumez <cdumez@apple.com>
+
+ [Web IDL] Drop 'any' type handling from CanUseWTFOptionalForParameter()
+ https://bugs.webkit.org/show_bug.cgi?id=157152
+
+ Reviewed by Darin Adler.
+
+ Drop 'any' type handling from CanUseWTFOptionalForParameter(). Always
+ use undefined as default value for parameters of type 'any' unless
+ specified otherwise.
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::continueFunction): Deleted.
+ * Modules/indexeddb/IDBCursor.h:
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::add): Deleted.
+ (WebCore::IDBObjectStore::putOrAdd): Deleted.
+ * Modules/indexeddb/IDBObjectStore.h:
+ * bindings/scripts/CodeGeneratorJS.pm:
+
+ (WillConvertUndefinedToDefaultParameterValue):
+ Fix optimization for optional DOMString attributes whose default value
+ is the string "undefined". I also added bindings test coverage for it.
+
+ (GenerateParametersCheck):
+ (CanUseWTFOptionalForParameter): Deleted.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_method_with_optional_string_is_undefined):
+ (webkit_dom_test_obj_method_with_optional_any):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ (-[DOMTestObj methodWithOptionalStringIsUndefined:]):
+ (-[DOMTestObj methodWithOptionalAny:]):
+ * bindings/scripts/test/TestObj.idl:
+ * testing/Internals.h:
+
</ins><span class="cx"> 2016-04-29 Joanmarie Diggs <jdiggs@igalia.com>
</span><span class="cx">
</span><span class="cx"> AX: [ATK] Expose elements with ARIA's "text" role
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -255,11 +255,6 @@
</span><span class="cx"> uncheckedIterateCursor(IDBKeyData(), count);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBCursor::continueFunction(ScriptExecutionContext&, ExceptionCodeWithMessage& ec)
-{
- continueFunction(IDBKeyData(), ec);
-}
-
</del><span class="cx"> void IDBCursor::continueFunction(ScriptExecutionContext& context, JSValue keyValue, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<IDBKey> key;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -64,7 +64,6 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> update(JSC::ExecState&, JSC::JSValue, ExceptionCodeWithMessage&);
</span><span class="cx"> void advance(unsigned, ExceptionCodeWithMessage&);
</span><del>- void continueFunction(ScriptExecutionContext&, ExceptionCodeWithMessage&);
</del><span class="cx"> void continueFunction(ScriptExecutionContext&, JSC::JSValue key, ExceptionCodeWithMessage&);
</span><span class="cx"> RefPtr<IDBRequest> deleteFunction(ScriptExecutionContext&, ExceptionCodeWithMessage&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -203,11 +203,6 @@
</span><span class="cx"> return WTFMove(request);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBObjectStore::add(ExecState& state, JSValue value, ExceptionCodeWithMessage& ec)
-{
- return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, InlineKeyCheck::Perform, ec);
-}
-
</del><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::add(ExecState& execState, JSValue value, JSValue key, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<IDBKey> idbKey;
</span><span class="lines">@@ -224,11 +219,6 @@
</span><span class="cx"> return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform, ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBObjectStore::put(ExecState& state, JSValue value, ExceptionCodeWithMessage& ec)
-{
- return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform, ec);
-}
-
</del><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::putForCursorUpdate(ExecState& state, JSValue value, JSValue key, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> return putOrAdd(state, value, scriptValueToIDBKey(state, key), IndexedDB::ObjectStoreOverwriteMode::OverwriteForCursor, InlineKeyCheck::DoNotPerform, ec);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -62,8 +62,6 @@
</span><span class="cx"> RefPtr<IDBTransaction> transaction();
</span><span class="cx"> bool autoIncrement() const;
</span><span class="cx">
</span><del>- RefPtr<IDBRequest> add(JSC::ExecState&, JSC::JSValue, ExceptionCodeWithMessage&);
- RefPtr<IDBRequest> put(JSC::ExecState&, JSC::JSValue, ExceptionCodeWithMessage&);
</del><span class="cx"> RefPtr<IDBRequest> openCursor(ScriptExecutionContext&, IDBKeyRange*, const String& direction, ExceptionCodeWithMessage&);
</span><span class="cx"> RefPtr<IDBRequest> openCursor(ScriptExecutionContext&, JSC::JSValue key, const String& direction, ExceptionCodeWithMessage&);
</span><span class="cx"> RefPtr<IDBRequest> get(ScriptExecutionContext&, JSC::JSValue key, ExceptionCodeWithMessage&);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBObjectStoreCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -66,19 +66,7 @@
</span><span class="cx">
</span><span class="cx"> ExceptionCodeWithMessage ec;
</span><span class="cx"> auto value = state.uncheckedArgument(0);
</span><del>-
- if (argsCount == 1) {
- JSValue result;
- if (overwrite)
- result = toJS(&state, castedThis->globalObject(), wrapped.put(state, value, ec).get());
- else
- result = toJS(&state, castedThis->globalObject(), wrapped.add(state, value, ec).get());
-
- setDOMException(&state, ec);
- return result;
- }
-
- auto key = state.uncheckedArgument(1);
</del><ins>+ auto key = state.argument(1);
</ins><span class="cx"> JSValue result;
</span><span class="cx"> if (overwrite)
</span><span class="cx"> result = toJS(&state, castedThis->globalObject(), wrapped.put(state, value, key, ec).get());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -3381,7 +3381,6 @@
</span><span class="cx"> return 0 if $codeGenerator->IsCallbackInterface($type);
</span><span class="cx"> return 0 if $codeGenerator->IsEnumType($type);
</span><span class="cx"> return 0 if $codeGenerator->IsWrapperType($type);
</span><del>- return 0 if $type eq "any";
</del><span class="cx">
</span><span class="cx"> return 1;
</span><span class="cx"> }
</span><span class="lines">@@ -3400,8 +3399,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # toString() will convert undefined to the string "undefined";
</span><del>- return 1 if $parameterType eq "DOMString" and $defaultValue eq "undefined";
</del><ins>+ return 1 if $parameterType eq "DOMString" and $defaultValue eq "\"undefined\"";
</ins><span class="cx">
</span><ins>+ return 1 if $parameterType eq "any" and $defaultValue eq "undefined";
+
</ins><span class="cx"> # JSValue::toBoolean() will convert undefined to false.
</span><span class="cx"> return 1 if $parameterType eq "boolean" and $defaultValue eq "false";
</span><span class="cx">
</span><span class="lines">@@ -3474,6 +3475,9 @@
</span><span class="cx"> # We use the null string as default value for non-nullable parameters of type DOMString unless specified otherwise.
</span><span class="cx"> $parameter->default("null") if ($optional && !defined($parameter->default) && $argType eq "DOMString" && !$parameter->isNullable);
</span><span class="cx">
</span><ins>+ # We use undefined as default value for optional parameters of type 'any' unless specified otherwise.
+ $parameter->default("undefined") if ($optional && !defined($parameter->default) && $argType eq "any");
+
</ins><span class="cx"> # FIXME: We should eventually stop generating any early calls, and instead use either default parameter values or WTF::Optional<>.
</span><span class="cx"> if ($optional && !defined($parameter->default) && !CanUseWTFOptionalForParameter($parameter) && !$codeGenerator->IsCallbackInterface($argType)) {
</span><span class="cx"> # Generate early call if there are enough parameters.
</span><span class="lines">@@ -3643,6 +3647,7 @@
</span><span class="cx"> $defaultValue = "nullptr" if $defaultValue eq "null";
</span><span class="cx"> $defaultValue = "PNaN" if $defaultValue eq "NaN";
</span><span class="cx"> $defaultValue = "$nativeType()" if $defaultValue eq "[]";
</span><ins>+ $defaultValue = "JSValue::JSUndefined" if $defaultValue eq "undefined";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $outer = "state->argument($argsIndex).isUndefined() ? $defaultValue : ";
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -1636,6 +1636,16 @@
</span><span class="cx"> item->methodWithOptionalStringIsNull(convertedStr);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void webkit_dom_test_obj_method_with_optional_string_is_undefined(WebKitDOMTestObj* self, const gchar* str)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+ g_return_if_fail(str);
+ WebCore::TestObj* item = WebKit::core(self);
+ WTF::String convertedStr = WTF::String::fromUTF8(str);
+ item->methodWithOptionalStringIsUndefined(convertedStr);
+}
+
</ins><span class="cx"> void webkit_dom_test_obj_method_with_optional_atomic_string_is_null(WebKitDOMTestObj* self, const gchar* str)
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -1750,6 +1760,16 @@
</span><span class="cx"> item->methodWithOptionalBooleanIsFalse(b);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void webkit_dom_test_obj_method_with_optional_any(WebKitDOMTestObj* self, WebKitDOMany* a)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+ g_return_if_fail(WEBKIT_DOM_IS_ANY(a));
+ WebCore::TestObj* item = WebKit::core(self);
+ WebCore::any* convertedA = WebKit::core(a);
+ item->methodWithOptionalAny(convertedA);
+}
+
</ins><span class="cx"> gchar* webkit_dom_test_obj_conditional_method1(WebKitDOMTestObj* self)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(Condition1)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -559,6 +559,16 @@
</span><span class="cx"> webkit_dom_test_obj_method_with_optional_string_is_null(WebKitDOMTestObj* self, const gchar* str);
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_method_with_optional_string_is_undefined:
+ * @self: A #WebKitDOMTestObj
+ * @str: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_method_with_optional_string_is_undefined(WebKitDOMTestObj* self, const gchar* str);
+
+/**
</ins><span class="cx"> * webkit_dom_test_obj_method_with_optional_atomic_string_is_null:
</span><span class="cx"> * @self: A #WebKitDOMTestObj
</span><span class="cx"> * @str: A #gchar
</span><span class="lines">@@ -689,6 +699,16 @@
</span><span class="cx"> webkit_dom_test_obj_method_with_optional_boolean_is_false(WebKitDOMTestObj* self, gboolean b);
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_method_with_optional_any:
+ * @self: A #WebKitDOMTestObj
+ * @a: A #WebKitDOMany
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_method_with_optional_any(WebKitDOMTestObj* self, WebKitDOMany* a);
+
+/**
</ins><span class="cx"> * webkit_dom_test_obj_conditional_method1:
</span><span class="cx"> * @self: A #WebKitDOMTestObj
</span><span class="cx"> *
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -142,6 +142,7 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString(JSC::ExecState*);
</span><span class="lines">@@ -156,6 +157,7 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArrayIsEmpty(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalBoolean(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalAny(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg(JSC::ExecState*);
</span><span class="lines">@@ -716,6 +718,7 @@
</span><span class="cx"> { "methodWithOptionalStringAndDefaultValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithOptionalAtomicStringAndDefaultValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithOptionalStringIsNull", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull), (intptr_t) (0) } },
</span><ins>+ { "methodWithOptionalStringIsUndefined", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined), (intptr_t) (0) } },
</ins><span class="cx"> { "methodWithOptionalAtomicStringIsNull", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithOptionalStringIsEmptyString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithOptionalAtomicStringIsEmptyString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString), (intptr_t) (0) } },
</span><span class="lines">@@ -730,6 +733,7 @@
</span><span class="cx"> { "methodWithOptionalArrayIsEmpty", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArrayIsEmpty), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithOptionalBoolean", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalBoolean), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithOptionalBooleanIsFalse", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse), (intptr_t) (0) } },
</span><ins>+ { "methodWithOptionalAny", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalAny), (intptr_t) (0) } },
</ins><span class="cx"> { "methodWithCallbackArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t) (1) } },
</span><span class="cx"> { "methodWithNonCallbackArgAndCallbackArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg), (intptr_t) (2) } },
</span><span class="cx"> { "methodWithCallbackAndOptionalArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg), (intptr_t) (0) } },
</span><span class="lines">@@ -4199,6 +4203,21 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestObj", "methodWithOptionalStringIsUndefined");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ String str = state->argument(0).toString(state)->value(state);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.methodWithOptionalStringIsUndefined(str);
+ return JSValue::encode(jsUndefined());
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull(ExecState* state)
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = state->thisValue();
</span><span class="lines">@@ -4409,6 +4428,21 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalAny(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestObj", "methodWithOptionalAny");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ JSC::JSValue a = state->argument(0);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.methodWithOptionalAny(a);
+ return JSValue::encode(jsUndefined());
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(ExecState* state)
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = state->thisValue();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -181,6 +181,7 @@
</span><span class="cx"> - (void)methodWithOptionalStringAndDefaultValue:(NSString *)str;
</span><span class="cx"> - (void)methodWithOptionalAtomicStringAndDefaultValue:(NSString *)str;
</span><span class="cx"> - (void)methodWithOptionalStringIsNull:(NSString *)str;
</span><ins>+- (void)methodWithOptionalStringIsUndefined:(NSString *)str;
</ins><span class="cx"> - (void)methodWithOptionalAtomicStringIsNull:(NSString *)str;
</span><span class="cx"> - (void)methodWithOptionalStringIsEmptyString:(NSString *)str;
</span><span class="cx"> - (void)methodWithOptionalAtomicStringIsEmptyString:(NSString *)str;
</span><span class="lines">@@ -192,6 +193,7 @@
</span><span class="cx"> - (void)methodWithOptionalUnsignedLongLongIsZero:(unsigned long long)number;
</span><span class="cx"> - (void)methodWithOptionalBoolean:(BOOL)b;
</span><span class="cx"> - (void)methodWithOptionalBooleanIsFalse:(BOOL)b;
</span><ins>+- (void)methodWithOptionalAny:(DOMany *)a;
</ins><span class="cx"> - (void)classMethod;
</span><span class="cx"> - (int)classMethodWithOptional:(int)arg;
</span><span class="cx"> - (void)classMethod2:(int)arg;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -1310,6 +1310,12 @@
</span><span class="cx"> IMPL->methodWithOptionalStringIsNull(str);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)methodWithOptionalStringIsUndefined:(NSString *)str
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->methodWithOptionalStringIsUndefined(str);
+}
+
</ins><span class="cx"> - (void)methodWithOptionalAtomicStringIsNull:(NSString *)str
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -1376,7 +1382,13 @@
</span><span class="cx"> IMPL->methodWithOptionalBooleanIsFalse(b);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)methodWithOptionalAny:(DOMany *)a
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->methodWithOptionalAny(core(a));
+}
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> #if ENABLE(Condition1)
</span><span class="cx"> - (NSString *)conditionalMethod1
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -185,6 +185,7 @@
</span><span class="cx"> void methodWithOptionalStringAndDefaultValue(optional DOMString str = "foo");
</span><span class="cx"> void methodWithOptionalAtomicStringAndDefaultValue([AtomicString] optional DOMString str = "foo");
</span><span class="cx"> void methodWithOptionalStringIsNull(optional DOMString str = null);
</span><ins>+ void methodWithOptionalStringIsUndefined(optional DOMString str = "undefined");
</ins><span class="cx"> void methodWithOptionalAtomicStringIsNull([AtomicString] optional DOMString str = null);
</span><span class="cx"> void methodWithOptionalStringIsEmptyString(optional DOMString str = "");
</span><span class="cx"> void methodWithOptionalAtomicStringIsEmptyString([AtomicString] optional DOMString str = "");
</span><span class="lines">@@ -199,6 +200,7 @@
</span><span class="cx"> void methodWithOptionalArrayIsEmpty(optional DOMString[] array = []);
</span><span class="cx"> void methodWithOptionalBoolean(optional boolean b);
</span><span class="cx"> void methodWithOptionalBooleanIsFalse(optional boolean b = false);
</span><ins>+ void methodWithOptionalAny(optional any a);
</ins><span class="cx">
</span><span class="cx"> #if defined(TESTING_JS)
</span><span class="cx"> // Callback interface parameters.
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (200241 => 200242)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-04-29 13:10:04 UTC (rev 200241)
+++ trunk/Source/WebCore/testing/Internals.h        2016-04-29 16:08:00 UTC (rev 200242)
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx"> RefPtr<NodeList> nodesFromRect(Document&, int x, int y, unsigned topPadding, unsigned rightPadding,
</span><span class="cx"> unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode&) const;
</span><span class="cx">
</span><del>- String parserMetaData(JSC::JSValue = { });
</del><ins>+ String parserMetaData(JSC::JSValue = JSC::JSValue::JSUndefined);
</ins><span class="cx">
</span><span class="cx"> void updateEditorUINowIfScheduled();
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>