Diff
Modified: trunk/ChangeLog (118481 => 118482)
--- trunk/ChangeLog 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/ChangeLog 2012-05-25 06:50:38 UTC (rev 118482)
@@ -1,3 +1,14 @@
+2012-05-24 Kent Tamura <[email protected]>
+
+ PAGE_POPUP: window.setValueAndClosePopup should be moved to a
+ per-context property of DOMWindow.
+ https://bugs.webkit.org/show_bug.cgi?id=87086
+
+ Reviewed by Adam Barth.
+
+ * ManualTests/forms/calendar-picker.html:
+ Introduce pseudo window.pagePopupController.
+
2012-05-24 Philippe Normand <[email protected]>
[GTK] Add --enable-css3-flexbox configure option after r118304.
Modified: trunk/LayoutTests/ChangeLog (118481 => 118482)
--- trunk/LayoutTests/ChangeLog 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/LayoutTests/ChangeLog 2012-05-25 06:50:38 UTC (rev 118482)
@@ -1,3 +1,14 @@
+2012-05-24 Kent Tamura <[email protected]>
+
+ PAGE_POPUP: window.setValueAndClosePopup should be moved to a
+ per-context property of DOMWindow.
+ https://bugs.webkit.org/show_bug.cgi?id=87086
+
+ Reviewed by Adam Barth.
+
+ * fast/forms/date/no-page-popup-controller-expected.txt: Added.
+ * fast/forms/date/no-page-popup-controller.html: Added.
+
2012-05-24 Zan Dobersek <[email protected]>
Unreviewed GTK gardening, rebaselining fast/multicol/span/clone-flexbox.html.
Added: trunk/LayoutTests/fast/forms/date/no-page-popup-controller-expected.txt (0 => 118482)
--- trunk/LayoutTests/fast/forms/date/no-page-popup-controller-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/date/no-page-popup-controller-expected.txt 2012-05-25 06:50:38 UTC (rev 118482)
@@ -0,0 +1,10 @@
+Confirm that the main window doesn't have pagePopupController, which should be present only in a calendar picker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.pagePopupController === undefined is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/date/no-page-popup-controller.html (0 => 118482)
--- trunk/LayoutTests/fast/forms/date/no-page-popup-controller.html (rev 0)
+++ trunk/LayoutTests/fast/forms/date/no-page-popup-controller.html 2012-05-25 06:50:38 UTC (rev 118482)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<input type=date>
+<script>
+description('Confirm that the main window doesn\'t have pagePopupController, which should be present only in a calendar picker.');
+shouldBeTrue('window.pagePopupController === undefined');
+</script>
+<script src=""
+</body>
Modified: trunk/ManualTests/forms/calendar-picker.html (118481 => 118482)
--- trunk/ManualTests/forms/calendar-picker.html 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/ManualTests/forms/calendar-picker.html 2012-05-25 06:50:38 UTC (rev 118482)
@@ -80,13 +80,17 @@
script.src = '' + (new Date()).getTime();
doc.body.appendChild(script);
- setTimeout(function() {
- frame.contentWindow.postMessage(JSON.stringify(args), "*");
- frame.contentWindow.setValueAndClosePopup = function(numValue, stringValue) {
+ var pagePopupController = {
+ setValueAndClosePopup: function(numValue, stringValue) {
window.log('number=' + numValue + ', string="' + stringValue + '"');
if (numValue == 0)
window.document.getElementById('date').value = stringValue;
- };
+ }
+ }
+
+ setTimeout(function() {
+ frame.contentWindow.postMessage(JSON.stringify(args), "*");
+ frame.contentWindow.pagePopupController = pagePopupController;
}, 100);
}
Modified: trunk/Source/WebCore/ChangeLog (118481 => 118482)
--- trunk/Source/WebCore/ChangeLog 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/ChangeLog 2012-05-25 06:50:38 UTC (rev 118482)
@@ -1,3 +1,47 @@
+2012-05-24 Kent Tamura <[email protected]>
+
+ PAGE_POPUP: window.setValueAndClosePopup should be moved to a
+ per-context property of DOMWindow.
+ https://bugs.webkit.org/show_bug.cgi?id=87086
+
+ Reviewed by Adam Barth.
+
+ - Introduce window.pagePagePopupController property as V8EnabledPerContext.
+ - Move window.setValueAndClosePopup() to window.pagePopupController.
+ So, we can remove ad-hoc ScriptController::installFunctionsForPagePopup().
+
+ No behavior change.
+
+ Test: fast/forms/date/no-page-popup-controller.html
+
+ * Resources/calendarPicker.js:
+ (submitValue): Use window.pagePopupController.
+ (handleCancel): ditto.
+ * WebCore.gypi: Add new files.
+ * bindings/generic/ContextEnabledFeatures.cpp:
+ (WebCore::ContextEnabledFeatures::pagePopupEnabled): Added.
+ * bindings/generic/ContextEnabledFeatures.h:
+ (ContextEnabledFeatures): Added.
+ * bindings/v8/ScriptController.cpp: Remove installFunctionsForPagePopup().
+ * bindings/v8/ScriptController.h: ditto.
+ * loader/FrameLoaderClient.h:
+ (WebCore::FrameLoaderClient::allowPagePopup): Added.
+ * page/DOMWindowPagePopup.cpp:
+ (WebCore::DOMWindowPagePopup::DOMWindowPagePopup):
+ Creates a PagePopupController object for the specified PagePopupClient.
+ (WebCore::DOMWindowPagePopup::~DOMWindowPagePopup):
+ Empty destructor to generate the RefPtr<PagePopupController> destructor.
+ (WebCore::DOMWindowPagePopup::pagePopupController):
+ * page/DOMWindowPagePopup.h:
+ (DOMWindowPagePopup):
+ - Remove setValueAndClosePopup()
+ - Add pagePopupController()
+ - Change the data member from PagePopupClient to PagePopupController.
+ * page/DOMWindowPagePopup.idl: Supply per-context window.pagePopupController.
+ * page/PagePopupController.cpp: Added. This object is attached to window.
+ * page/PagePopupController.h: ditto.
+ * page/PagePopupController.idl: ditto.
+
2012-05-21 Kinuko Yasuda <[email protected]>
Cleanup: add a file system call which captures the file metadata at once.
Modified: trunk/Source/WebCore/Resources/calendarPicker.js (118481 => 118482)
--- trunk/Source/WebCore/Resources/calendarPicker.js 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/Resources/calendarPicker.js 2012-05-25 06:50:38 UTC (rev 118482)
@@ -1080,11 +1080,11 @@
* @param {string} value
*/
function submitValue(value) {
- window.setValueAndClosePopup(0, value);
+ window.pagePopupController.setValueAndClosePopup(0, value);
}
function handleCancel() {
- window.setValueAndClosePopup(-1, "");
+ window.pagePopupController.setValueAndClosePopup(-1, "");
}
/**
Modified: trunk/Source/WebCore/WebCore.gypi (118481 => 118482)
--- trunk/Source/WebCore/WebCore.gypi 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/WebCore.gypi 2012-05-25 06:50:38 UTC (rev 118482)
@@ -1144,12 +1144,14 @@
'page/Crypto.idl',
'page/DOMSelection.idl',
'page/DOMWindow.idl',
+ 'page/DOMWindowPagePopup.idl',
'page/EventSource.idl',
'page/History.idl',
'page/Location.idl',
'page/MemoryInfo.idl',
'page/Navigator.idl',
'page/NavigatorRegisterProtocolHandler.idl',
+ 'page/PagePopupController.idl',
'page/Performance.idl',
'page/PerformanceEntry.idl',
'page/PerformanceEntryList.idl',
@@ -3038,6 +3040,8 @@
'page/PageGroup.cpp',
'page/PageGroupLoadDeferrer.cpp',
'page/PageGroupLoadDeferrer.h',
+ 'page/PagePopupController.cpp',
+ 'page/PagePopupController.h',
'page/PageSerializer.cpp',
'page/PageVisibilityState.cpp',
'page/Performance.cpp',
Modified: trunk/Source/WebCore/bindings/generic/ContextEnabledFeatures.cpp (118481 => 118482)
--- trunk/Source/WebCore/bindings/generic/ContextEnabledFeatures.cpp 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/bindings/generic/ContextEnabledFeatures.cpp 2012-05-25 06:50:38 UTC (rev 118482)
@@ -59,8 +59,18 @@
if (Frame* frame = document->frame())
return frame->loader()->client()->allowStyleScoped(RuntimeEnabledFeatures::styleScopedEnabled());
return false;
-
}
+#endif
+
+#if ENABLE(PAGE_POPUP)
+bool ContextEnabledFeatures::pagePopupEnabled(DOMWindow* window)
+{
+ if (!window)
+ return false;
+ if (Frame* frame = window->frame())
+ return frame->loader()->client()->allowPagePopup();
+ return false;
+}
#endif
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/generic/ContextEnabledFeatures.h (118481 => 118482)
--- trunk/Source/WebCore/bindings/generic/ContextEnabledFeatures.h 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/bindings/generic/ContextEnabledFeatures.h 2012-05-25 06:50:38 UTC (rev 118482)
@@ -48,6 +48,9 @@
#if ENABLE(STYLE_SCOPED)
static bool styleScopedEnabled(Document*);
#endif
+#if ENABLE(PAGE_POPUP)
+ static bool pagePopupEnabled(DOMWindow*);
+#endif
};
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (118481 => 118482)
--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp 2012-05-25 06:50:38 UTC (rev 118482)
@@ -38,7 +38,6 @@
#include "ScriptCallStackFactory.h"
#include "ScriptableDocumentParser.h"
#include "DOMWindow.h"
-#include "DOMWindowPagePopup.h"
#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
@@ -250,36 +249,6 @@
global->Set(v8String(key), value);
}
-#if ENABLE(PAGE_POPUP)
-static v8::Handle<v8::Value> setValueAndClosePopupCallback(const v8::Arguments& args)
-{
- if (args.Length() < 2)
- return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate());
- DOMWindow* imp = V8DOMWindow::toNative(args.Data()->ToObject());
- EXCEPTION_BLOCK(int, intValue, toInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, stringValue, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
- DOMWindowPagePopup::setValueAndClosePopup(imp, intValue, stringValue);
- // setValueAndClosePopup() deletes the window. Do not access it.
- return v8::Undefined();
-}
-
-void ScriptController::installFunctionsForPagePopup(Frame* frame, PagePopupClient* popupClient)
-{
- ASSERT(frame);
- ASSERT(popupClient);
- v8::HandleScope handleScope;
- v8::Handle<v8::Context> context = V8Proxy::mainWorldContext(frame);
- if (context.IsEmpty()) {
- ASSERT_NOT_REACHED();
- return;
- }
- v8::Context::Scope scope(context);
- DOMWindowPagePopup::install(frame->existingDOMWindow(), popupClient);
- v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(setValueAndClosePopupCallback, V8DOMWindow::wrap(frame->existingDOMWindow()));
- context->Global()->Set(v8::String::New("setValueAndClosePopup"), v8::Handle<v8::Function>(templ->GetFunction()));
-}
-#endif
-
void ScriptController::collectGarbage()
{
v8::HandleScope handleScope;
Modified: trunk/Source/WebCore/bindings/v8/ScriptController.h (118481 => 118482)
--- trunk/Source/WebCore/bindings/v8/ScriptController.h 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.h 2012-05-25 06:50:38 UTC (rev 118482)
@@ -122,9 +122,6 @@
void bindToWindowObject(Frame*, const String& key, NPObject*);
PassScriptInstance createScriptInstanceForWidget(Widget*);
-#if ENABLE(PAGE_POPUP)
- void installFunctionsForPagePopup(Frame*, PagePopupClient*);
-#endif
// Check if the _javascript_ engine has been initialized.
bool haveInterpreter() const;
Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (118481 => 118482)
--- trunk/Source/WebCore/loader/FrameLoaderClient.h 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h 2012-05-25 06:50:38 UTC (rev 118482)
@@ -313,6 +313,9 @@
virtual bool shadowDOMAllowed(bool enabledAsRuntimeFeatures) { return enabledAsRuntimeFeatures; }
virtual bool allowStyleScoped(bool enabledAsRuntimeFeatures) { return enabledAsRuntimeFeatures; }
+#if ENABLE(PAGE_POPUP)
+ virtual bool allowPagePopup() { return false; }
+#endif
// This callback notifies the client that the frame was about to run
// _javascript_ but did not because allowScript returned false. We
Modified: trunk/Source/WebCore/page/DOMWindowPagePopup.cpp (118481 => 118482)
--- trunk/Source/WebCore/page/DOMWindowPagePopup.cpp 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/page/DOMWindowPagePopup.cpp 2012-05-25 06:50:38 UTC (rev 118482)
@@ -33,28 +33,31 @@
#if ENABLE(PAGE_POPUP)
#include "DOMWindow.h"
-#include "PagePopupClient.h"
+#include "PagePopupController.h"
namespace WebCore {
DOMWindowPagePopup::DOMWindowPagePopup(PagePopupClient* popupClient)
- : m_popupClient(popupClient)
+ : m_controller(PagePopupController::create(popupClient))
{
ASSERT(popupClient);
}
+DOMWindowPagePopup::~DOMWindowPagePopup()
+{
+}
+
const AtomicString& DOMWindowPagePopup::supplementName()
{
DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowPagePopup"));
return name;
}
-void DOMWindowPagePopup::setValueAndClosePopup(DOMWindow* window, int intValue, const String& stringValue)
+PagePopupController* DOMWindowPagePopup::pagePopupController(DOMWindow* window)
{
DOMWindowPagePopup* supplement = static_cast<DOMWindowPagePopup*>(from(window, supplementName()));
ASSERT(supplement);
- supplement->m_popupClient->setValueAndClosePopup(intValue, stringValue);
- // setValueAndClosePopup() deletes the window and this object. Do not access them.
+ return supplement->m_controller.get();
}
void DOMWindowPagePopup::install(DOMWindow* window, PagePopupClient* popupClient)
Modified: trunk/Source/WebCore/page/DOMWindowPagePopup.h (118481 => 118482)
--- trunk/Source/WebCore/page/DOMWindowPagePopup.h 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebCore/page/DOMWindowPagePopup.h 2012-05-25 06:50:38 UTC (rev 118482)
@@ -38,17 +38,19 @@
class DOMWindow;
class PagePopupClient;
+class PagePopupController;
class DOMWindowPagePopup : public Supplement<DOMWindow> {
public:
- static void setValueAndClosePopup(DOMWindow*, int intValue, const String& stringValue);
+ static PagePopupController* pagePopupController(DOMWindow*);
static void install(DOMWindow*, PagePopupClient*);
+ ~DOMWindowPagePopup();
private:
explicit DOMWindowPagePopup(PagePopupClient*);
static const AtomicString& supplementName();
- PagePopupClient* m_popupClient;
+ RefPtr<PagePopupController> m_controller;
};
}
Copied: trunk/Source/WebCore/page/DOMWindowPagePopup.idl (from rev 118481, trunk/Source/WebCore/page/DOMWindowPagePopup.h) (0 => 118482)
--- trunk/Source/WebCore/page/DOMWindowPagePopup.idl (rev 0)
+++ trunk/Source/WebCore/page/DOMWindowPagePopup.idl 2012-05-25 06:50:38 UTC (rev 118482)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module window {
+ interface [
+ Conditional=PAGE_POPUP,
+ Supplemental=DOMWindow
+ ] DOMWindowPagePopup {
+ readonly attribute [V8EnabledPerContext=pagePopup] PagePopupController pagePopupController;
+ };
+}
Copied: trunk/Source/WebCore/page/PagePopupController.cpp (from rev 118481, trunk/Source/WebCore/page/DOMWindowPagePopup.h) (0 => 118482)
--- trunk/Source/WebCore/page/PagePopupController.cpp (rev 0)
+++ trunk/Source/WebCore/page/PagePopupController.cpp 2012-05-25 06:50:38 UTC (rev 118482)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PagePopupController.h"
+
+#if ENABLE(PAGE_POPUP)
+#include "PagePopupClient.h"
+
+namespace WebCore {
+
+PagePopupController::PagePopupController(PagePopupClient* client)
+ : m_popupClient(client)
+{
+ ASSERT(client);
+}
+
+PassRefPtr<PagePopupController> PagePopupController::create(PagePopupClient* client)
+{
+ return adoptRef(new PagePopupController(client));
+}
+
+void PagePopupController::setValueAndClosePopup(int numValue, const String& stringValue)
+{
+ m_popupClient->setValueAndClosePopup(numValue, stringValue);
+}
+
+}
+#endif
Copied: trunk/Source/WebCore/page/PagePopupController.h (from rev 118481, trunk/Source/WebCore/page/DOMWindowPagePopup.h) (0 => 118482)
--- trunk/Source/WebCore/page/PagePopupController.h (rev 0)
+++ trunk/Source/WebCore/page/PagePopupController.h 2012-05-25 06:50:38 UTC (rev 118482)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PagePopupController_h
+#define PagePopupController_h
+
+#if ENABLE(PAGE_POPUP)
+
+#include <wtf/Forward.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class PagePopupClient;
+
+class PagePopupController : public RefCounted<PagePopupController> {
+public:
+ static PassRefPtr<PagePopupController> create(PagePopupClient*);
+ void setValueAndClosePopup(int numValue, const String& stringValue);
+
+private:
+ explicit PagePopupController(PagePopupClient*);
+
+ PagePopupClient* m_popupClient;
+};
+
+}
+#endif
+#endif
Copied: trunk/Source/WebCore/page/PagePopupController.idl (from rev 118481, trunk/Source/WebCore/page/DOMWindowPagePopup.h) (0 => 118482)
--- trunk/Source/WebCore/page/PagePopupController.idl (rev 0)
+++ trunk/Source/WebCore/page/PagePopupController.idl 2012-05-25 06:50:38 UTC (rev 118482)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module window {
+ interface [
+ Conditional=PAGE_POPUP
+ ] PagePopupController {
+ void setValueAndClosePopup(in long numberValue, in DOMString stringValue);
+ };
+}
Modified: trunk/Source/WebKit/chromium/ChangeLog (118481 => 118482)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-05-25 06:50:38 UTC (rev 118482)
@@ -1,3 +1,19 @@
+2012-05-24 Kent Tamura <[email protected]>
+
+ PAGE_POPUP: window.setValueAndClosePopup should be moved to a
+ per-context property of DOMWindow.
+ https://bugs.webkit.org/show_bug.cgi?id=87086
+
+ Reviewed by Adam Barth.
+
+ * src/WebPagePopupImpl.cpp:
+ (WebKit): Add PagePopupFrameLoaderClient, which allows window.pagePopupController.
+ (WebKit::WebPagePopupImpl::initPage):
+ - Use PagePopupFrameLoaderClient
+ - Remove the call of ScriptController::installFunctionsForPagePopup().
+ - Call DOMWindowPagePopup::install() to inform m_popupClient to a
+ DOMWindowPagePopup object for the DOMWindow.
+
2012-05-21 Kinuko Yasuda <[email protected]>
Cleanup: add a file system call which captures the file metadata at once.
Modified: trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp (118481 => 118482)
--- trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp 2012-05-25 06:40:17 UTC (rev 118481)
+++ trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp 2012-05-25 06:50:38 UTC (rev 118482)
@@ -32,6 +32,7 @@
#include "WebPagePopupImpl.h"
#include "Chrome.h"
+#include "DOMWindowPagePopup.h"
#include "EmptyClients.h"
#include "FileChooser.h"
#include "FocusController.h"
@@ -127,6 +128,10 @@
WebPagePopupImpl* m_popup;
};
+class PagePopupFrameLoaderClient : public EmptyFrameLoaderClient {
+ virtual bool allowPagePopup() OVERRIDE { return true; }
+};
+
// WebPagePopupImpl ----------------------------------------------------------------
WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client)
@@ -181,8 +186,8 @@
m_page->settings()->setScriptEnabled(true);
m_page->settings()->setAllowScriptsToCloseWindows(true);
- static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClient;
- RefPtr<Frame> frame = Frame::create(m_page.get(), 0, emptyFrameLoaderClient);
+ static FrameLoaderClient* pagePopupFrameLoaderClient = new PagePopupFrameLoaderClient;
+ RefPtr<Frame> frame = Frame::create(m_page.get(), 0, pagePopupFrameLoaderClient);
frame->setView(FrameView::create(frame.get()));
frame->init();
frame->view()->resize(m_popupClient->contentSize());
@@ -195,7 +200,8 @@
m_popupClient->writeDocument(*writer);
writer->end();
- frame->script()->installFunctionsForPagePopup(frame.get(), m_popupClient);
+ ASSERT(frame->existingDOMWindow());
+ DOMWindowPagePopup::install(frame->existingDOMWindow(), m_popupClient);
return true;
}