<!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>[198102] 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/198102">198102</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-03-14 02:44:44 -0700 (Mon, 14 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Introduce CallWith=Document in binding generator
https://bugs.webkit.org/show_bug.cgi?id=155358
Reviewed by Darin Adler.
Covered by existing tests and binding test.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::permission): Taking a Document& instead of ScriptExecutionContext&.
(WebCore::Notification::requestPermission): Ditto.
* Modules/notifications/Notification.h:
* Modules/notifications/Notification.idl: Using CallWith=Document.
* bindings/scripts/CodeGeneratorJS.pm: Adding support for CallWith=Document and changed name from scriptContext to context.
(GenerateCallWith):
(GenerateConstructorDefinition):
* bindings/scripts/IDLAttributes.txt: Adding support for CallWith=Document.
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_with_document_argument):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjWithScriptExecutionContextAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
(WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj withDocumentArgument]):
* bindings/scripts/test/TestObj.idl: Adding binding test.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus): Taking a Document& instead of ScriptExecutionContext&.
(WebCore::DOMWindow::close): Ditto.
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/History.cpp:
(WebCore::History::back): Ditto.
(WebCore::History::forward): Ditto.
(WebCore::History::go): Ditto.
* page/History.h:
* page/History.idl:
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::closeWindow): Calling DOMWindow::close() directly.</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="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#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="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</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="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowidl">trunk/Source/WebCore/page/DOMWindow.idl</a></li>
<li><a href="#trunkSourceWebCorepageHistorycpp">trunk/Source/WebCore/page/History.cpp</a></li>
<li><a href="#trunkSourceWebCorepageHistoryh">trunk/Source/WebCore/page/History.h</a></li>
<li><a href="#trunkSourceWebCorepageHistoryidl">trunk/Source/WebCore/page/History.idl</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/ChangeLog        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2016-03-14 Youenn Fablet <youenn.fablet@crf.canon.fr>
+
+ Introduce CallWith=Document in binding generator
+ https://bugs.webkit.org/show_bug.cgi?id=155358
+
+ Reviewed by Darin Adler.
+
+ Covered by existing tests and binding test.
+
+ * Modules/notifications/Notification.cpp:
+ (WebCore::Notification::permission): Taking a Document& instead of ScriptExecutionContext&.
+ (WebCore::Notification::requestPermission): Ditto.
+ * Modules/notifications/Notification.h:
+ * Modules/notifications/Notification.idl: Using CallWith=Document.
+ * bindings/scripts/CodeGeneratorJS.pm: Adding support for CallWith=Document and changed name from scriptContext to context.
+ (GenerateCallWith):
+ (GenerateConstructorDefinition):
+ * bindings/scripts/IDLAttributes.txt: Adding support for CallWith=Document.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_with_document_argument):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
+ (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjWithScriptExecutionContextAttribute):
+ (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
+ (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
+ (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
+ (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
+ (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
+ (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
+ (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
+ (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
+ (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
+ (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
+ (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
+ (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
+ (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
+ (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ (-[DOMTestObj withDocumentArgument]):
+ * bindings/scripts/test/TestObj.idl: Adding binding test.
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::focus): Taking a Document& instead of ScriptExecutionContext&.
+ (WebCore::DOMWindow::close): Ditto.
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+ * page/History.cpp:
+ (WebCore::History::back): Ditto.
+ (WebCore::History::forward): Ditto.
+ (WebCore::History::go): Ditto.
+ * page/History.h:
+ * page/History.idl:
+ * testing/Internals.cpp:
+ (WebCore::InspectorStubFrontend::closeWindow): Calling DOMWindow::close() directly.
+
</ins><span class="cx"> 2016-03-13 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/Notification.cpp (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/Notification.cpp        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/Modules/notifications/Notification.cpp        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -221,10 +221,9 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>-const String Notification::permission(ScriptExecutionContext& context)
</del><ins>+const String Notification::permission(Document& document)
</ins><span class="cx"> {
</span><del>- ASSERT(downcast<Document>(context).page());
- return permissionString(NotificationController::from(downcast<Document>(context).page())->client()->checkPermission(&context));
</del><ins>+ return permissionString(NotificationController::from(document.page())->client()->checkPermission(&document));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const String Notification::permissionString(NotificationClient::Permission permission)
</span><span class="lines">@@ -242,10 +241,9 @@
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Notification::requestPermission(ScriptExecutionContext& context, PassRefPtr<NotificationPermissionCallback> callback)
</del><ins>+void Notification::requestPermission(Document& document, PassRefPtr<NotificationPermissionCallback> callback)
</ins><span class="cx"> {
</span><del>- ASSERT(downcast<Document>(context).page());
- NotificationController::from(downcast<Document>(context).page())->client()->requestPermission(&context, callback);
</del><ins>+ NotificationController::from(document.page())->client()->requestPermission(&document, callback);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/Notification.h (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/Notification.h        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/Modules/notifications/Notification.h        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -52,11 +52,11 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class Dictionary;
</span><ins>+class Document;
</ins><span class="cx"> class NotificationCenter;
</span><span class="cx"> class NotificationPermissionCallback;
</span><span class="cx"> class ResourceError;
</span><span class="cx"> class ResourceResponse;
</span><del>-class ScriptExecutionContext;
</del><span class="cx"> class ThreadableLoader;
</span><span class="cx">
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="lines">@@ -122,9 +122,9 @@
</span><span class="cx"> WEBCORE_EXPORT void finalize();
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NOTIFICATIONS)
</span><del>- static const String permission(ScriptExecutionContext&);
</del><ins>+ static const String permission(Document&);
</ins><span class="cx"> WEBCORE_EXPORT static const String permissionString(NotificationClient::Permission);
</span><del>- static void requestPermission(ScriptExecutionContext&, PassRefPtr<NotificationPermissionCallback> = nullptr);
</del><ins>+ static void requestPermission(Document&, PassRefPtr<NotificationPermissionCallback> = nullptr);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/Notification.idl (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/Notification.idl        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/Modules/notifications/Notification.idl        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -41,8 +41,8 @@
</span><span class="cx"> [Conditional=LEGACY_NOTIFICATIONS] void cancel();
</span><span class="cx"> [Conditional=NOTIFICATIONS] void close();
</span><span class="cx">
</span><del>- [Conditional=NOTIFICATIONS, CallWith=ScriptExecutionContext] static readonly attribute DOMString permission;
- [Conditional=NOTIFICATIONS, CallWith=ScriptExecutionContext] static void requestPermission(optional NotificationPermissionCallback callback);
</del><ins>+ [Conditional=NOTIFICATIONS, CallWith=Document] static readonly attribute DOMString permission;
+ [Conditional=NOTIFICATIONS, CallWith=Document] static void requestPermission(optional NotificationPermissionCallback callback);
</ins><span class="cx">
</span><span class="cx"> attribute EventHandler onclick;
</span><span class="cx"> attribute EventHandler onclose;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -3289,11 +3289,20 @@
</span><span class="cx"> my @callWithArgs;
</span><span class="cx"> push(@callWithArgs, "*state") if $codeGenerator->ExtendedAttributeContains($callWith, "ScriptState");
</span><span class="cx"> if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptExecutionContext")) {
</span><del>- push(@$outputArray, " auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();\n");
- push(@$outputArray, " if (!scriptContext)\n");
</del><ins>+ push(@$outputArray, " auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();\n");
+ push(@$outputArray, " if (!context)\n");
</ins><span class="cx"> push(@$outputArray, " return" . ($returnValue ? " " . $returnValue : "") . ";\n");
</span><del>- push(@callWithArgs, "*scriptContext");
</del><ins>+ push(@callWithArgs, "*context");
</ins><span class="cx"> }
</span><ins>+ if ($codeGenerator->ExtendedAttributeContains($callWith, "Document")) {
+ $implIncludes{"Document.h"} = 1;
+ push(@$outputArray, " auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();\n");
+ push(@$outputArray, " if (!context)\n");
+ push(@$outputArray, " return" . ($returnValue ? " " . $returnValue : "") . ";\n");
+ push(@$outputArray, " ASSERT(context->isDocument());\n");
+ push(@$outputArray, " auto& document = downcast<Document>(*context);\n");
+ push(@callWithArgs, "document");
+ }
</ins><span class="cx"> if ($function and $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments")) {
</span><span class="cx"> push(@$outputArray, " RefPtr<Inspector::ScriptArguments> scriptArguments(Inspector::createScriptArguments(state, " . @{$function->parameters} . "));\n");
</span><span class="cx"> $implIncludes{"<inspector/ScriptArguments.h>"} = 1;
</span><span class="lines">@@ -4925,6 +4934,7 @@
</span><span class="cx"> push(@$outputArray, " ScriptExecutionContext* context = castedThis->scriptExecutionContext();\n");
</span><span class="cx"> push(@$outputArray, " if (!context)\n");
</span><span class="cx"> push(@$outputArray, " return throwConstructorDocumentUnavailableError(*state, \"${interfaceName}\");\n");
</span><ins>+ push(@$outputArray, " ASSERT(context->isDocument());\n");
</ins><span class="cx"> push(@$outputArray, " auto& document = downcast<Document>(*context);\n");
</span><span class="cx"> }
</span><span class="cx"> if ($generatingNamedConstructor) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> CachedAttribute
</span><span class="cx"> CallbackNeedsOperatorEqual
</span><span class="cx"> Callback=FunctionOnly
</span><del>-CallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow
</del><ins>+CallWith=Document|ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow
</ins><span class="cx"> CheckSecurity
</span><span class="cx"> CheckSecurityForNode
</span><span class="cx"> Clamp
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -1465,6 +1465,14 @@
</span><span class="cx"> return WebKit::kit(gobjectResult.get());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void webkit_dom_test_obj_with_document_argument(WebKitDOMTestObj* self)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+ WebCore::TestObj* item = WebKit::core(self);
+ item->withDocumentArgument();
+}
+
</ins><span class="cx"> void webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt)
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -437,6 +437,15 @@
</span><span class="cx"> webkit_dom_test_obj_with_script_execution_context_and_script_state_with_spaces(WebKitDOMTestObj* self);
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_with_document_argument:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_with_document_argument(WebKitDOMTestObj* self);
+
+/**
</ins><span class="cx"> * webkit_dom_test_obj_method_with_optional_arg:
</span><span class="cx"> * @self: A #WebKitDOMTestObj
</span><span class="cx"> * @opt: A #glong
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -792,8 +792,8 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> String strArg = state->argument(0).toString(state)->value(state);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="lines">@@ -801,7 +801,7 @@
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(*scriptContext, strArg, objArg, ec)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(*context, strArg, objArg, ec)));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -858,8 +858,8 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> String strArg = state->argument(0).toString(state)->value(state);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="lines">@@ -867,7 +867,7 @@
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(impl, *scriptContext, strArg, objArg, ec)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(impl, *context, strArg, objArg, ec)));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span><span class="cx"> return JSValue::encode(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -129,6 +129,7 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDocumentArgument(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(JSC::ExecState*);
</span><span class="lines">@@ -661,6 +662,7 @@
</span><span class="cx"> { "withScriptExecutionContextAndScriptStateObjException", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException), (intptr_t) (0) } },
</span><span class="cx"> { "withScriptExecutionContextAndScriptStateWithSpaces", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces), (intptr_t) (0) } },
</span><span class="cx"> { "withScriptArgumentsAndCallStack", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack), (intptr_t) (0) } },
</span><ins>+ { "withDocumentArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDocumentArgument), (intptr_t) (0) } },
</ins><span class="cx"> { "methodWithOptionalArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithOptionalArgAndDefaultValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue), (intptr_t) (0) } },
</span><span class="cx"> { "methodWithNonOptionalArgAndOptionalArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t) (1) } },
</span><span class="lines">@@ -1474,11 +1476,11 @@
</span><span class="cx"> if (UNLIKELY(!castedThis)) {
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAttribute");
</span><span class="cx"> }
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttribute(*scriptContext)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttribute(*context)));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1510,11 +1512,11 @@
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAttributeRaises");
</span><span class="cx"> }
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttributeRaises(*scriptContext, ec)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttributeRaises(*context, ec)));
</ins><span class="cx"> setDOMException(state, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -1529,11 +1531,11 @@
</span><span class="cx"> if (UNLIKELY(!castedThis)) {
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateAttribute");
</span><span class="cx"> }
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttribute(*state, *scriptContext)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttribute(*state, *context)));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1548,11 +1550,11 @@
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateAttributeRaises");
</span><span class="cx"> }
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttributeRaises(*state, *scriptContext, ec)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttributeRaises(*state, *context, ec)));
</ins><span class="cx"> setDOMException(state, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -1567,11 +1569,11 @@
</span><span class="cx"> if (UNLIKELY(!castedThis)) {
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateWithSpacesAttribute");
</span><span class="cx"> }
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *scriptContext)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *context)));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2694,10 +2696,10 @@
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return false;
</span><del>- impl.setWithScriptExecutionContextAttribute(*scriptContext, nativeValue);
</del><ins>+ impl.setWithScriptExecutionContextAttribute(*context, nativeValue);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2731,10 +2733,10 @@
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return false;
</span><del>- impl.setWithScriptExecutionContextAttributeRaises(*scriptContext, nativeValue);
</del><ins>+ impl.setWithScriptExecutionContextAttributeRaises(*context, nativeValue);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2751,10 +2753,10 @@
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return false;
</span><del>- impl.setWithScriptExecutionContextAndScriptStateAttribute(*state, *scriptContext, nativeValue);
</del><ins>+ impl.setWithScriptExecutionContextAndScriptStateAttribute(*state, *context, nativeValue);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2771,10 +2773,10 @@
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return false;
</span><del>- impl.setWithScriptExecutionContextAndScriptStateAttributeRaises(*state, *scriptContext, nativeValue);
</del><ins>+ impl.setWithScriptExecutionContextAndScriptStateAttributeRaises(*state, *context, nativeValue);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2791,10 +2793,10 @@
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return false;
</span><del>- impl.setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *scriptContext, nativeValue);
</del><ins>+ impl.setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *context, nativeValue);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3698,10 +3700,10 @@
</span><span class="cx"> return throwThisTypeError(*state, "TestObj", "withScriptExecutionContext");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- impl.withScriptExecutionContext(*scriptContext);
</del><ins>+ impl.withScriptExecutionContext(*context);
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3713,10 +3715,10 @@
</span><span class="cx"> return throwThisTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptState");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- impl.withScriptExecutionContextAndScriptState(*state, *scriptContext);
</del><ins>+ impl.withScriptExecutionContextAndScriptState(*state, *context);
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3729,10 +3731,10 @@
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateObjException(*state, *scriptContext, ec)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateObjException(*state, *context, ec)));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="lines">@@ -3748,10 +3750,10 @@
</span><span class="cx"> return throwThisTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateWithSpaces");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto* scriptContext = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
- if (!scriptContext)
</del><ins>+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpaces(*state, *scriptContext)));
</del><ins>+ JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpaces(*state, *context)));
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -3770,6 +3772,23 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDocumentArgument(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestObj", "withDocumentArgument");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+ auto& impl = castedThis->wrapped();
+ auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
+ if (!context)
+ return JSValue::encode(jsUndefined());
+ ASSERT(context->isDocument());
+ auto& document = downcast<Document>(*context);
+ impl.withDocumentArgument(document);
+ return JSValue::encode(jsUndefined());
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(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 (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -168,6 +168,7 @@
</span><span class="cx"> - (DOMTestObj *)withScriptExecutionContextAndScriptStateObjException;
</span><span class="cx"> - (DOMTestObj *)withScriptExecutionContextAndScriptStateWithSpaces;
</span><span class="cx"> - (void)withScriptArgumentsAndCallStack;
</span><ins>+- (void)withDocumentArgument;
</ins><span class="cx"> - (void)methodWithOptionalArg:(int)opt;
</span><span class="cx"> - (void)methodWithOptionalArgAndDefaultValue:(int)opt;
</span><span class="cx"> - (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -1172,6 +1172,12 @@
</span><span class="cx"> IMPL->withScriptArgumentsAndCallStack();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)withDocumentArgument
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->withDocumentArgument();
+}
+
</ins><span class="cx"> - (void)methodWithOptionalArg:(int)opt
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -159,6 +159,7 @@
</span><span class="cx"> [CallWith=ScriptExecutionContext&ScriptState, RaisesException] TestObj withScriptExecutionContextAndScriptStateObjException();
</span><span class="cx"> [CallWith= ScriptExecutionContext & ScriptState ] TestObj withScriptExecutionContextAndScriptStateWithSpaces();
</span><span class="cx"> [CallWith=ScriptArguments&CallStack] void withScriptArgumentsAndCallStack();
</span><ins>+ [CallWith=Document] void withDocumentArgument();
</ins><span class="cx">
</span><span class="cx"> [CallWith=ScriptState] attribute long withScriptStateAttribute;
</span><span class="cx"> [CallWith=ScriptState, SetterCallWith=ActiveWindow&FirstWindow] attribute long withCallWithAndSetterCallWithAttribute;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -962,8 +962,13 @@
</span><span class="cx"> return m_frame->ownerElement();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DOMWindow::focus(ScriptExecutionContext* context)
</del><ins>+void DOMWindow::focus(Document& document)
</ins><span class="cx"> {
</span><ins>+ focus(opener() && opener() != this && document.domWindow() == opener());
+}
+
+void DOMWindow::focus(bool allowFocus)
+{
</ins><span class="cx"> if (!m_frame)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -971,13 +976,7 @@
</span><span class="cx"> if (!page)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- bool allowFocus = WindowFocusAllowedIndicator::windowFocusAllowed() || !m_frame->settings().windowFocusRestricted();
- if (context) {
- ASSERT(isMainThread());
- Document& activeDocument = downcast<Document>(*context);
- if (opener() && opener() != this && activeDocument.domWindow() == opener())
- allowFocus = true;
- }
</del><ins>+ allowFocus = allowFocus || WindowFocusAllowedIndicator::windowFocusAllowed() || !m_frame->settings().windowFocusRestricted();
</ins><span class="cx">
</span><span class="cx"> // If we're a top level window, bring the window to the front.
</span><span class="cx"> if (m_frame->isMainFrame() && allowFocus)
</span><span class="lines">@@ -1012,8 +1011,15 @@
</span><span class="cx"> page->chrome().unfocus();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DOMWindow::close(ScriptExecutionContext* context)
</del><ins>+void DOMWindow::close(Document& document)
</ins><span class="cx"> {
</span><ins>+ if (!document.canNavigate(m_frame))
+ return;
+ close();
+}
+
+void DOMWindow::close()
+{
</ins><span class="cx"> if (!m_frame)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -1024,12 +1030,6 @@
</span><span class="cx"> if (!m_frame->isMainFrame())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (context) {
- ASSERT(isMainThread());
- if (!downcast<Document>(*context).canNavigate(m_frame))
- return;
- }
-
</del><span class="cx"> bool allowScriptsToCloseWindows = m_frame->settings().allowScriptsToCloseWindows();
</span><span class="cx">
</span><span class="cx"> if (!(page->openedByDOM() || page->backForward().count() <= 1 || allowScriptsToCloseWindows)) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/page/DOMWindow.h        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -160,11 +160,11 @@
</span><span class="cx">
</span><span class="cx"> Element* frameElement() const;
</span><span class="cx">
</span><del>- void focus(ScriptExecutionContext* = nullptr);
- void focus(ScriptExecutionContext& context) { focus(&context); }
</del><ins>+ void focus(bool allowFocus = false);
+ void focus(Document&);
</ins><span class="cx"> void blur();
</span><del>- WEBCORE_EXPORT void close(ScriptExecutionContext* = nullptr);
- void close(ScriptExecutionContext& context) { close(&context); }
</del><ins>+ WEBCORE_EXPORT void close();
+ void close(Document&);
</ins><span class="cx"> void print();
</span><span class="cx"> void stop();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.idl (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.idl        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/page/DOMWindow.idl        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -57,9 +57,9 @@
</span><span class="cx">
</span><span class="cx"> [CheckSecurityForNode] readonly attribute Element frameElement;
</span><span class="cx">
</span><del>- [DoNotCheckSecurity, CallWith=ScriptExecutionContext, ForwardDeclareInHeader] void focus();
</del><ins>+ [DoNotCheckSecurity, CallWith=Document, ForwardDeclareInHeader] void focus();
</ins><span class="cx"> [DoNotCheckSecurity, ForwardDeclareInHeader] void blur();
</span><del>- [DoNotCheckSecurity, CallWith=ScriptExecutionContext, ForwardDeclareInHeader] void close();
</del><ins>+ [DoNotCheckSecurity, CallWith=Document, ForwardDeclareInHeader] void close();
</ins><span class="cx">
</span><span class="cx"> void print();
</span><span class="cx"> void stop();
</span></span></pre></div>
<a id="trunkSourceWebCorepageHistorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/History.cpp (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/History.cpp        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/page/History.cpp        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -91,9 +91,9 @@
</span><span class="cx"> go(-1);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void History::back(ScriptExecutionContext* context)
</del><ins>+void History::back(Document& document)
</ins><span class="cx"> {
</span><del>- go(context, -1);
</del><ins>+ go(document, -1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void History::forward()
</span><span class="lines">@@ -101,9 +101,9 @@
</span><span class="cx"> go(1);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void History::forward(ScriptExecutionContext* context)
</del><ins>+void History::forward(Document& document)
</ins><span class="cx"> {
</span><del>- go(context, 1);
</del><ins>+ go(document, 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void History::go(int distance)
</span><span class="lines">@@ -114,17 +114,14 @@
</span><span class="cx"> m_frame->navigationScheduler().scheduleHistoryNavigation(distance);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void History::go(ScriptExecutionContext* context, int distance)
</del><ins>+void History::go(Document& document, int distance)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_frame)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> ASSERT(isMainThread());
</span><del>- Document* activeDocument = downcast<Document>(context);
- if (!activeDocument)
- return;
</del><span class="cx">
</span><del>- if (!activeDocument->canNavigate(m_frame))
</del><ins>+ if (!document.canNavigate(m_frame))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_frame->navigationScheduler().scheduleHistoryNavigation(distance);
</span></span></pre></div>
<a id="trunkSourceWebCorepageHistoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/History.h (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/History.h        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/page/History.h        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class Document;
</ins><span class="cx"> class Frame;
</span><del>-class ScriptExecutionContext;
</del><span class="cx"> struct ExceptionCodeWithMessage;
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx">
</span><span class="lines">@@ -49,16 +49,12 @@
</span><span class="cx"> PassRefPtr<SerializedScriptValue> state();
</span><span class="cx"> void back();
</span><span class="cx"> void forward();
</span><del>- void go(int distance);
</del><ins>+ void go(int);
</ins><span class="cx">
</span><del>- void back(ScriptExecutionContext& context) { back(&context); }
- void forward(ScriptExecutionContext& context) { forward(&context); }
- void go(ScriptExecutionContext& context, int distance) { go(&context, distance); }
</del><ins>+ void back(Document&);
+ void forward(Document&);
+ void go(Document&, int);
</ins><span class="cx">
</span><del>- void back(ScriptExecutionContext*);
- void forward(ScriptExecutionContext*);
- void go(ScriptExecutionContext*, int distance);
-
</del><span class="cx"> bool stateChanged() const;
</span><span class="cx"> bool isSameAsCurrentState(SerializedScriptValue*) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageHistoryidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/History.idl (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/History.idl        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/page/History.idl        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -29,9 +29,9 @@
</span><span class="cx"> readonly attribute unsigned long length;
</span><span class="cx"> [CachedAttribute, Custom] readonly attribute SerializedScriptValue state;
</span><span class="cx">
</span><del>- [CallWith=ScriptExecutionContext, ForwardDeclareInHeader] void back();
- [CallWith=ScriptExecutionContext, ForwardDeclareInHeader] void forward();
- [CallWith=ScriptExecutionContext, ForwardDeclareInHeader] void go([Default=Undefined] optional long distance);
</del><ins>+ [CallWith=Document, ForwardDeclareInHeader] void back();
+ [CallWith=Document, ForwardDeclareInHeader] void forward();
+ [CallWith=Document, ForwardDeclareInHeader] void go([Default=Undefined] optional long distance);
</ins><span class="cx">
</span><span class="cx"> [Custom, RaisesException] void pushState(any data, DOMString title, optional DOMString url);
</span><span class="cx"> [Custom, RaisesException] void replaceState(any data, DOMString title, optional DOMString url);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (198101 => 198102)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-03-14 09:21:56 UTC (rev 198101)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-03-14 09:44:44 UTC (rev 198102)
</span><span class="lines">@@ -296,7 +296,7 @@
</span><span class="cx"> m_frontendController.setInspectorFrontendClient(nullptr);
</span><span class="cx"> inspectedPage()->inspectorController().disconnectFrontend(this);
</span><span class="cx">
</span><del>- m_frontendWindow->close(m_frontendWindow->scriptExecutionContext());
</del><ins>+ m_frontendWindow->close();
</ins><span class="cx"> m_frontendWindow = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>