Changeset 142987 in webkit


Ignore:
Timestamp:
Feb 15, 2013 5:36:51 AM (11 years ago)
Author:
keishi@webkit.org
Message:

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.

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):

Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r142977 r142987  
     12013-02-15  Keishi Hattori  <keishi@webkit.org>
     2
     3        Add setValue and closePopup methods to PagePopupController
     4        https://bugs.webkit.org/show_bug.cgi?id=109897
     5
     6        Reviewed by Kent Tamura.
     7
     8        * ManualTests/forms/calendar-picker.html: Added mock setValue and closePopup implementation.
     9        * ManualTests/forms/color-suggestion-picker.html: Ditto.
     10
    1112013-02-15  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    212
  • trunk/ManualTests/forms/calendar-picker.html

    r140778 r142987  
    295295                window.document.getElementById('date').value = stringValue;
    296296        },
     297        setValue: function(value) {
     298            window.log('value="' + value + '"');
     299            window.document.getElementById('date').value = value;
     300        },
     301        closePopup: function() {
     302        },
    297303        localizeNumberString: function(numString) {
    298304            if (typeof numString == "number")
  • trunk/ManualTests/forms/color-suggestion-picker.html

    r125641 r142987  
    5757            if (numValue === 0)
    5858                window.document.getElementById('color').value = stringValue;
    59         }
     59        },
     60        setValue: function(value) {
     61            window.log('value="' + value + '"');
     62            window.document.getElementById('color').value = value;
     63        },
     64        closePopup: function() {
     65        },
    6066    }
    6167
  • trunk/Source/WebCore/ChangeLog

    r142984 r142987  
     12013-02-15  Keishi Hattori  <keishi@webkit.org>
     2
     3        Add setValue and closePopup methods to PagePopupController
     4        https://bugs.webkit.org/show_bug.cgi?id=109897
     5
     6        Reviewed by Kent Tamura.
     7
     8        The new calendar picker (Bug 109439) needs to set a value without
     9        closing the popup. We can't do that with the existing
     10        setValueAndClosePopup.
     11
     12        No new tests. Existing calendar picker and color suggestion picker tests
     13        that closing and setting values work properly.
     14
     15        * Resources/pagepopups/pickerCommon.js:
     16        (Picker.prototype.submitValue): Stop using setValueAndClosePopup.
     17        (Picker.prototype.handleCancel): Ditto.
     18        * page/PagePopupClient.h:
     19        (PagePopupClient):
     20        * page/PagePopupController.cpp:
     21        (WebCore::PagePopupController::setValue): Sets value to element without closing popup.
     22        (WebCore):
     23        (WebCore::PagePopupController::closePopup): Just closes popup.
     24        * page/PagePopupController.h:
     25        (PagePopupController):
     26        * page/PagePopupController.idl:
     27
    1282013-02-15  Mihnea Ovidenie  <mihnea@adobe.com>
    229
  • trunk/Source/WebCore/Resources/pagepopups/pickerCommon.js

    r139055 r142987  
    243243 */
    244244Picker.prototype.submitValue = function(value) {
    245     window.pagePopupController.setValueAndClosePopup(Picker.Actions.SetValue, value);
     245    window.pagePopupController.setValue(value);
     246    window.pagePopupController.closePopup();
    246247}
    247248
    248249Picker.prototype.handleCancel = function() {
    249     window.pagePopupController.setValueAndClosePopup(Picker.Actions.Cancel, "");
     250    window.pagePopupController.closePopup();
    250251}
    251252
  • trunk/Source/WebCore/page/PagePopupClient.h

    r132774 r142987  
    6161    virtual void setValueAndClosePopup(int numValue, const String& stringValue) = 0;
    6262
     63    // This is called by the content HTML of a PagePopup.
     64    virtual void setValue(const String&) = 0;
     65
     66    // This is called by the content HTML of a PagePopup.
     67    virtual void closePopup() = 0;
     68
    6369    // This is called whenever a PagePopup was closed.
    6470    virtual void didClosePopup() = 0;
  • trunk/Source/WebCore/page/PagePopupController.cpp

    r137281 r142987  
    5656}
    5757
     58void PagePopupController::setValue(const String& value)
     59{
     60    if (m_popupClient)
     61        m_popupClient->setValue(value);
     62}
     63
     64void PagePopupController::closePopup()
     65{
     66    if (m_popupClient)
     67        m_popupClient->closePopup();
     68}
     69
    5870String PagePopupController::localizeNumberString(const String& numberString)
    5971{
  • trunk/Source/WebCore/page/PagePopupController.h

    r137281 r142987  
    4545    static PassRefPtr<PagePopupController> create(PagePopupClient*);
    4646    void setValueAndClosePopup(int numValue, const String& stringValue);
     47    void setValue(const String&);
     48    void closePopup();
    4749    String localizeNumberString(const String&);
    4850#if ENABLE(CALENDAR_PICKER)
  • trunk/Source/WebCore/page/PagePopupController.idl

    r141034 r142987  
    3434] interface PagePopupController {
    3535    void setValueAndClosePopup(in long numberValue, in DOMString stringValue);
     36    void setValue(DOMString value);
     37    void closePopup();
    3638    DOMString localizeNumberString(in DOMString numberString);
    3739    [Conditional=CALENDAR_PICKER] DOMString formatMonth(in long year, in long zeroBaseMonth);
  • trunk/Source/WebKit/blackberry/ChangeLog

    r142977 r142987  
     12013-02-15  Keishi Hattori  <keishi@webkit.org>
     2
     3        Add setValue and closePopup methods to PagePopupController
     4        https://bugs.webkit.org/show_bug.cgi?id=109897
     5
     6        Reviewed by Kent Tamura.
     7
     8        * WebCoreSupport/ColorPickerClient.cpp:
     9        (WebCore::ColorPickerClient::setValue): Added empty implementation.
     10        (WebCore):
     11        * WebCoreSupport/ColorPickerClient.h:
     12        (ColorPickerClient):
     13        * WebCoreSupport/DatePickerClient.cpp:
     14        (WebCore::DatePickerClient::setValue): Ditto.
     15        (WebCore):
     16        * WebCoreSupport/DatePickerClient.h:
     17        (DatePickerClient):
     18        * WebCoreSupport/SelectPopupClient.cpp:
     19        (WebCore::SelectPopupClient::setValue): Ditto.
     20        (WebCore):
     21        * WebCoreSupport/SelectPopupClient.h:
     22        (SelectPopupClient):
     23
    1242013-02-15  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    225
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ColorPickerClient.cpp

    r131316 r142987  
    2525#include "DocumentWriter.h"
    2626#include "HTMLInputElement.h"
     27#include "NotImplemented.h"
    2728#include "Page.h"
    2829#include "PagePopup.h"
     
    99100}
    100101
     102void ColorPickerClient::setValue(const String&)
     103{
     104    notImplemented();
     105}
     106
    101107void ColorPickerClient::didClosePopup()
    102108{
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ColorPickerClient.h

    r133102 r142987  
    4747    virtual Localizer& localizer();
    4848    void setValueAndClosePopup(int, const String&);
     49    void setValue(const String&);
     50    void closePopup();
    4951    void didClosePopup();
    5052
    5153private:
    52     void closePopup();
    53 
    5454    String m_source;
    5555    BlackBerry::WebKit::WebPagePrivate* m_webPage;
  • trunk/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp

    r133952 r142987  
    2626#include "Frame.h"
    2727#include "HTMLInputElement.h"
     28#include "NotImplemented.h"
    2829#include "Page.h"
    2930#include "PagePopup.h"
     
    138139}
    139140
     141void DatePickerClient::setValue(int, const String& value)
     142{
     143    notImplemented();
     144}
     145
    140146void DatePickerClient::didClosePopup()
    141147{
  • trunk/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.h

    r133102 r142987  
    4949    virtual Localizer& localizer();
    5050    void setValueAndClosePopup(int, const String&);
     51    void setValue(const String&);
    5152    void didClosePopup();
    5253    void closePopup();
  • trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp

    r133999 r142987  
    2727#include "HTMLOptionElement.h"
    2828#include "HTMLSelectElement.h"
     29#include "NotImplemented.h"
    2930#include "Page.h"
    3031#include "PagePopup.h"
     
    196197}
    197198
     199void SelectPopupClient::setValue(const String&)
     200{
     201    notImplemented();
     202}
     203
    198204void SelectPopupClient::didClosePopup()
    199205{
  • trunk/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.h

    r133102 r142987  
    5656    virtual Localizer& localizer();
    5757    virtual void setValueAndClosePopup(int, const String&);
     58    virtual void setValue(const String&);
     59    virtual void closePopup();
    5860    virtual void didClosePopup();
    59     void closePopup();
    6061
    6162    bool m_multiple;
  • trunk/Source/WebKit/chromium/ChangeLog

    r142977 r142987  
     12013-02-15  Keishi Hattori  <keishi@webkit.org>
     2
     3        Add setValue and closePopup methods to PagePopupController
     4        https://bugs.webkit.org/show_bug.cgi?id=109897
     5
     6        Reviewed by Kent Tamura.
     7
     8        * src/ColorChooserPopupUIController.cpp:
     9        (WebKit::ColorChooserPopupUIController::setValue):
     10        (WebKit):
     11        * src/ColorChooserPopupUIController.h:
     12        (ColorChooserPopupUIController):
     13        * src/DateTimeChooserImpl.cpp:
     14        (WebKit::DateTimeChooserImpl::setValueAndClosePopup): Use setValue and closePopup.
     15        (WebKit):
     16        (WebKit::DateTimeChooserImpl::setValue):
     17        (WebKit::DateTimeChooserImpl::closePopup):
     18        * src/DateTimeChooserImpl.h:
     19        (DateTimeChooserImpl):
     20
    1212013-02-15  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    222
  • trunk/Source/WebKit/chromium/src/ColorChooserPopupUIController.cpp

    r139055 r142987  
    123123}
    124124
     125void ColorChooserPopupUIController::setValue(const String& value)
     126{
     127    ASSERT(m_client);
     128    m_client->didChooseColor(Color(value));
     129}
     130
    125131void ColorChooserPopupUIController::didClosePopup()
    126132{
  • trunk/Source/WebKit/chromium/src/ColorChooserPopupUIController.h

    r135197 r142987  
    5555    virtual WebCore::Locale& locale() OVERRIDE;
    5656    virtual void setValueAndClosePopup(int, const String&) OVERRIDE;
     57    virtual void setValue(const String&) OVERRIDE;
     58    virtual void closePopup() OVERRIDE;
    5759    virtual void didClosePopup() OVERRIDE;
    5860
    5961private:
    6062    void openPopup();
    61     void closePopup();
    6263
    6364    ChromeClientImpl* m_chromeClient;
  • trunk/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp

    r140778 r142987  
    170170    RefPtr<DateTimeChooserImpl> protector(this);
    171171    if (numValue >= 0)
    172         m_client->didChooseValue(stringValue);
     172        setValue(stringValue);
     173    endChooser();
     174}
     175
     176void DateTimeChooserImpl::setValue(const String& value)
     177{
     178    m_client->didChooseValue(value);
     179}
     180
     181void DateTimeChooserImpl::closePopup()
     182{
    173183    endChooser();
    174184}
  • trunk/Source/WebKit/chromium/src/DateTimeChooserImpl.h

    r133284 r142987  
    6060    virtual WebCore::Locale& locale() OVERRIDE;
    6161    virtual void setValueAndClosePopup(int, const String&) OVERRIDE;
     62    virtual void setValue(const String&) OVERRIDE;
     63    virtual void closePopup() OVERRIDE;
    6264    virtual void didClosePopup() OVERRIDE;
    6365
Note: See TracChangeset for help on using the changeset viewer.