PAGE_POPUP: window.setValueAndClosePopup should be moved to a
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2012 06:50:38 +0000 (06:50 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2012 06:50:38 +0000 (06:50 +0000)
commitf36f9b685ec9bb74d500cde76cc18d9bf0b538f6
tree165b7953d87634f3c95f6150c603cd1ed5a75ba0
parente292f92533c4646f59ce5991b1b001cb505cc96d
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.

Source/WebCore:

- 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.

Source/WebKit/chromium:

* 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.

LayoutTests:

* fast/forms/date/no-page-popup-controller-expected.txt: Added.
* fast/forms/date/no-page-popup-controller.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/forms/date/no-page-popup-controller-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/date/no-page-popup-controller.html [new file with mode: 0644]
ManualTests/forms/calendar-picker.html
Source/WebCore/ChangeLog
Source/WebCore/Resources/calendarPicker.js
Source/WebCore/WebCore.gypi
Source/WebCore/bindings/generic/ContextEnabledFeatures.cpp
Source/WebCore/bindings/generic/ContextEnabledFeatures.h
Source/WebCore/bindings/v8/ScriptController.cpp
Source/WebCore/bindings/v8/ScriptController.h
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/page/DOMWindowPagePopup.cpp
Source/WebCore/page/DOMWindowPagePopup.h
Source/WebCore/page/DOMWindowPagePopup.idl [new file with mode: 0644]
Source/WebCore/page/PagePopupController.cpp [new file with mode: 0644]
Source/WebCore/page/PagePopupController.h [new file with mode: 0644]
Source/WebCore/page/PagePopupController.idl [new file with mode: 0644]
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebPagePopupImpl.cpp