https://bugs.webkit.org/show_bug.cgi?id=109897
Reviewed by Kent Tamura.
.:
* ManualTests/forms/calendar-picker.html: Added mock setValue and closePopup implementation.
* ManualTests/forms/color-suggestion-picker.html: Ditto.
Source/WebCore:
The new calendar picker (Bug 109439) needs to set a value without
closing the popup. We can't do that with the existing
setValueAndClosePopup.
No new tests. Existing calendar picker and color suggestion picker tests
that closing and setting values work properly.
* Resources/pagepopups/pickerCommon.js:
(Picker.prototype.submitValue): Stop using setValueAndClosePopup.
(Picker.prototype.handleCancel): Ditto.
* page/PagePopupClient.h:
(PagePopupClient):
* page/PagePopupController.cpp:
(WebCore::PagePopupController::setValue): Sets value to element without closing popup.
(WebCore):
(WebCore::PagePopupController::closePopup): Just closes popup.
* page/PagePopupController.h:
(PagePopupController):
* page/PagePopupController.idl:
Source/WebKit/blackberry:
* WebCoreSupport/ColorPickerClient.cpp:
(WebCore::ColorPickerClient::setValue): Added empty implementation.
(WebCore):
* WebCoreSupport/ColorPickerClient.h:
(ColorPickerClient):
* WebCoreSupport/DatePickerClient.cpp:
(WebCore::DatePickerClient::setValue): Ditto.
(WebCore):
* WebCoreSupport/DatePickerClient.h:
(DatePickerClient):
* WebCoreSupport/SelectPopupClient.cpp:
(WebCore::SelectPopupClient::setValue): Ditto.
(WebCore):
* WebCoreSupport/SelectPopupClient.h:
(SelectPopupClient):
Source/WebKit/chromium:
* src/ColorChooserPopupUIController.cpp:
(WebKit::ColorChooserPopupUIController::setValue):
(WebKit):
* src/ColorChooserPopupUIController.h:
(ColorChooserPopupUIController):
* src/DateTimeChooserImpl.cpp:
(WebKit::DateTimeChooserImpl::setValueAndClosePopup): Use setValue and closePopup.
(WebKit):
(WebKit::DateTimeChooserImpl::setValue):
(WebKit::DateTimeChooserImpl::closePopup):
* src/DateTimeChooserImpl.h:
(DateTimeChooserImpl):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142987
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-02-15 Keishi Hattori <keishi@webkit.org>
+
+ Add setValue and closePopup methods to PagePopupController
+ https://bugs.webkit.org/show_bug.cgi?id=109897
+
+ Reviewed by Kent Tamura.
+
+ * ManualTests/forms/calendar-picker.html: Added mock setValue and closePopup implementation.
+ * ManualTests/forms/color-suggestion-picker.html: Ditto.
+
2013-02-15 Allan Sandfeld Jensen <allan.jensen@digia.com>
Simplify hitTestResultAtPoint and nodesFromRect APIs
if (numValue == 0)
window.document.getElementById('date').value = stringValue;
},
+ setValue: function(value) {
+ window.log('value="' + value + '"');
+ window.document.getElementById('date').value = value;
+ },
+ closePopup: function() {
+ },
localizeNumberString: function(numString) {
if (typeof numString == "number")
return numString.toLocaleString();
window.log('number=' + numValue + ', string="' + stringValue + '"');
if (numValue === 0)
window.document.getElementById('color').value = stringValue;
- }
+ },
+ setValue: function(value) {
+ window.log('value="' + value + '"');
+ window.document.getElementById('color').value = value;
+ },
+ closePopup: function() {
+ },
}
setTimeout(function() {
+2013-02-15 Keishi Hattori <keishi@webkit.org>
+
+ Add setValue and closePopup methods to PagePopupController
+ https://bugs.webkit.org/show_bug.cgi?id=109897
+
+ Reviewed by Kent Tamura.
+
+ The new calendar picker (Bug 109439) needs to set a value without
+ closing the popup. We can't do that with the existing
+ setValueAndClosePopup.
+
+ No new tests. Existing calendar picker and color suggestion picker tests
+ that closing and setting values work properly.
+
+ * Resources/pagepopups/pickerCommon.js:
+ (Picker.prototype.submitValue): Stop using setValueAndClosePopup.
+ (Picker.prototype.handleCancel): Ditto.
+ * page/PagePopupClient.h:
+ (PagePopupClient):
+ * page/PagePopupController.cpp:
+ (WebCore::PagePopupController::setValue): Sets value to element without closing popup.
+ (WebCore):
+ (WebCore::PagePopupController::closePopup): Just closes popup.
+ * page/PagePopupController.h:
+ (PagePopupController):
+ * page/PagePopupController.idl:
+
2013-02-15 Mihnea Ovidenie <mihnea@adobe.com>
[CSS Regions] RenderRegion should inherit from RenderBlock
* @param {!string} value
*/
Picker.prototype.submitValue = function(value) {
- window.pagePopupController.setValueAndClosePopup(Picker.Actions.SetValue, value);
+ window.pagePopupController.setValue(value);
+ window.pagePopupController.closePopup();
}
Picker.prototype.handleCancel = function() {
- window.pagePopupController.setValueAndClosePopup(Picker.Actions.Cancel, "");
+ window.pagePopupController.closePopup();
}
Picker.prototype.chooseOtherColor = function() {
// An implementation of this function should call ChromeClient::closePagePopup().
virtual void setValueAndClosePopup(int numValue, const String& stringValue) = 0;
+ // This is called by the content HTML of a PagePopup.
+ virtual void setValue(const String&) = 0;
+
+ // This is called by the content HTML of a PagePopup.
+ virtual void closePopup() = 0;
+
// This is called whenever a PagePopup was closed.
virtual void didClosePopup() = 0;
m_popupClient->setValueAndClosePopup(numValue, stringValue);
}
+void PagePopupController::setValue(const String& value)
+{
+ if (m_popupClient)
+ m_popupClient->setValue(value);
+}
+
+void PagePopupController::closePopup()
+{
+ if (m_popupClient)
+ m_popupClient->closePopup();
+}
+
String PagePopupController::localizeNumberString(const String& numberString)
{
if (m_popupClient)
public:
static PassRefPtr<PagePopupController> create(PagePopupClient*);
void setValueAndClosePopup(int numValue, const String& stringValue);
+ void setValue(const String&);
+ void closePopup();
String localizeNumberString(const String&);
#if ENABLE(CALENDAR_PICKER)
String formatMonth(int year, int zeroBaseMonth);
ImplementationLacksVTable
] interface PagePopupController {
void setValueAndClosePopup(in long numberValue, in DOMString stringValue);
+ void setValue(DOMString value);
+ void closePopup();
DOMString localizeNumberString(in DOMString numberString);
[Conditional=CALENDAR_PICKER] DOMString formatMonth(in long year, in long zeroBaseMonth);
void histogramEnumeration(DOMString name, long sample, long boundaryValue);
+2013-02-15 Keishi Hattori <keishi@webkit.org>
+
+ Add setValue and closePopup methods to PagePopupController
+ https://bugs.webkit.org/show_bug.cgi?id=109897
+
+ Reviewed by Kent Tamura.
+
+ * WebCoreSupport/ColorPickerClient.cpp:
+ (WebCore::ColorPickerClient::setValue): Added empty implementation.
+ (WebCore):
+ * WebCoreSupport/ColorPickerClient.h:
+ (ColorPickerClient):
+ * WebCoreSupport/DatePickerClient.cpp:
+ (WebCore::DatePickerClient::setValue): Ditto.
+ (WebCore):
+ * WebCoreSupport/DatePickerClient.h:
+ (DatePickerClient):
+ * WebCoreSupport/SelectPopupClient.cpp:
+ (WebCore::SelectPopupClient::setValue): Ditto.
+ (WebCore):
+ * WebCoreSupport/SelectPopupClient.h:
+ (SelectPopupClient):
+
2013-02-15 Allan Sandfeld Jensen <allan.jensen@digia.com>
Simplify hitTestResultAtPoint and nodesFromRect APIs
#include "Document.h"
#include "DocumentWriter.h"
#include "HTMLInputElement.h"
+#include "NotImplemented.h"
#include "Page.h"
#include "PagePopup.h"
#include "PopupPicker.h"
closePopup();
}
+void ColorPickerClient::setValue(const String&)
+{
+ notImplemented();
+}
+
void ColorPickerClient::didClosePopup()
{
m_webPage = 0;
String htmlSource() const;
virtual Localizer& localizer();
void setValueAndClosePopup(int, const String&);
+ void setValue(const String&);
+ void closePopup();
void didClosePopup();
private:
- void closePopup();
-
String m_source;
BlackBerry::WebKit::WebPagePrivate* m_webPage;
RefPtr<HTMLInputElement> m_element;
#include "DocumentWriter.h"
#include "Frame.h"
#include "HTMLInputElement.h"
+#include "NotImplemented.h"
#include "Page.h"
#include "PagePopup.h"
#include "PopupPicker.h"
closePopup();
}
+void DatePickerClient::setValue(int, const String& value)
+{
+ notImplemented();
+}
+
void DatePickerClient::didClosePopup()
{
m_webPage = 0;
virtual String htmlSource();
virtual Localizer& localizer();
void setValueAndClosePopup(int, const String&);
+ void setValue(const String&);
void didClosePopup();
void closePopup();
#include "DocumentWriter.h"
#include "HTMLOptionElement.h"
#include "HTMLSelectElement.h"
+#include "NotImplemented.h"
#include "Page.h"
#include "PagePopup.h"
#include "PopupPicker.h"
m_notifyChangeTimer.startOneShot(0);
}
+void SelectPopupClient::setValue(const String&)
+{
+ notImplemented();
+}
+
void SelectPopupClient::didClosePopup()
{
m_webPage = 0;
virtual String htmlSource();
virtual Localizer& localizer();
virtual void setValueAndClosePopup(int, const String&);
+ virtual void setValue(const String&);
+ virtual void closePopup();
virtual void didClosePopup();
- void closePopup();
bool m_multiple;
unsigned m_size;
+2013-02-15 Keishi Hattori <keishi@webkit.org>
+
+ Add setValue and closePopup methods to PagePopupController
+ https://bugs.webkit.org/show_bug.cgi?id=109897
+
+ Reviewed by Kent Tamura.
+
+ * src/ColorChooserPopupUIController.cpp:
+ (WebKit::ColorChooserPopupUIController::setValue):
+ (WebKit):
+ * src/ColorChooserPopupUIController.h:
+ (ColorChooserPopupUIController):
+ * src/DateTimeChooserImpl.cpp:
+ (WebKit::DateTimeChooserImpl::setValueAndClosePopup): Use setValue and closePopup.
+ (WebKit):
+ (WebKit::DateTimeChooserImpl::setValue):
+ (WebKit::DateTimeChooserImpl::closePopup):
+ * src/DateTimeChooserImpl.h:
+ (DateTimeChooserImpl):
+
2013-02-15 Allan Sandfeld Jensen <allan.jensen@digia.com>
Simplify hitTestResultAtPoint and nodesFromRect APIs
closePopup();
}
+void ColorChooserPopupUIController::setValue(const String& value)
+{
+ ASSERT(m_client);
+ m_client->didChooseColor(Color(value));
+}
+
void ColorChooserPopupUIController::didClosePopup()
{
m_popup = 0;
virtual void writeDocument(WebCore::DocumentWriter&) OVERRIDE;
virtual WebCore::Locale& locale() OVERRIDE;
virtual void setValueAndClosePopup(int, const String&) OVERRIDE;
+ virtual void setValue(const String&) OVERRIDE;
+ virtual void closePopup() OVERRIDE;
virtual void didClosePopup() OVERRIDE;
private:
void openPopup();
- void closePopup();
ChromeClientImpl* m_chromeClient;
WebCore::ColorChooserClient* m_client;
{
RefPtr<DateTimeChooserImpl> protector(this);
if (numValue >= 0)
- m_client->didChooseValue(stringValue);
+ setValue(stringValue);
+ endChooser();
+}
+
+void DateTimeChooserImpl::setValue(const String& value)
+{
+ m_client->didChooseValue(value);
+}
+
+void DateTimeChooserImpl::closePopup()
+{
endChooser();
}
virtual void writeDocument(WebCore::DocumentWriter&) OVERRIDE;
virtual WebCore::Locale& locale() OVERRIDE;
virtual void setValueAndClosePopup(int, const String&) OVERRIDE;
+ virtual void setValue(const String&) OVERRIDE;
+ virtual void closePopup() OVERRIDE;
virtual void didClosePopup() OVERRIDE;
ChromeClientImpl* m_chromeClient;