Changeset 122364 in webkit


Ignore:
Timestamp:
Jul 11, 2012, 1:20:54 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Implement Date/Time picker
https://bugs.webkit.org/show_bug.cgi?id=90911

Patch by Crystal Zhang <haizhang@rim.com> on 2012-07-11
Reviewed by Rob Buis.

Source/WebKit:

Add files into make file.

  • PlatformBlackBerry.cmake:

Source/WebKit/blackberry:

Implement HTML Date/Time picker, also should delete popup when closing popup.

  • WebCoreSupport/ChromeClientBlackBerry.cpp:

(WebCore::ChromeClientBlackBerry::closePagePopup):

  • WebCoreSupport/DatePickerClient.cpp: Added.

(WebCore):
(WebCore::DatePickerClient::DatePickerClient):
(WebCore::DatePickerClient::~DatePickerClient):
(WebCore::DatePickerClient::generateHTML):
(WebCore::DatePickerClient::closePopup):
(WebCore::DatePickerClient::contentSize):
(WebCore::DatePickerClient::htmlSource):
(WebCore::DatePickerClient::setValueAndClosePopup):
(WebCore::DatePickerClient::didClosePopup):
(WebCore::DatePickerClient::writeDocument):

  • WebCoreSupport/DatePickerClient.h: Added.

(WebKit):
(WebCore):
(DatePickerClient):

  • WebKitSupport/InputHandler.cpp:

(BlackBerry::WebKit::InputHandler::openDatePopup):

Location:
trunk/Source/WebKit
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r122197 r122364  
     12012-07-11  Crystal Zhang  <haizhang@rim.com>
     2
     3        [BlackBerry] Implement Date/Time picker
     4        https://bugs.webkit.org/show_bug.cgi?id=90911
     5
     6        Reviewed by Rob Buis.
     7
     8        Add files into make file.
     9
     10        * PlatformBlackBerry.cmake:
     11
    1122012-07-09  Christophe Dumez  <christophe.dumez@intel.com>
    213
  • trunk/Source/WebKit/PlatformBlackBerry.cmake

    r121725 r122364  
    9292    blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
    9393    blackberry/WebCoreSupport/SelectPopupClient.cpp
     94    blackberry/WebCoreSupport/DatePickerClient.cpp
    9495    blackberry/WebKitSupport/BackingStoreCompositingSurface.cpp
    9596    blackberry/WebKitSupport/BackingStoreTile.cpp
  • trunk/Source/WebKit/blackberry/ChangeLog

    r122280 r122364  
     12012-07-11  Crystal Zhang  <haizhang@rim.com>
     2
     3        [BlackBerry] Implement Date/Time picker
     4        https://bugs.webkit.org/show_bug.cgi?id=90911
     5
     6        Reviewed by Rob Buis.
     7
     8        Implement HTML Date/Time picker, also should delete popup when closing popup.
     9
     10        * WebCoreSupport/ChromeClientBlackBerry.cpp:
     11        (WebCore::ChromeClientBlackBerry::closePagePopup):
     12        * WebCoreSupport/DatePickerClient.cpp: Added.
     13        (WebCore):
     14        (WebCore::DatePickerClient::DatePickerClient):
     15        (WebCore::DatePickerClient::~DatePickerClient):
     16        (WebCore::DatePickerClient::generateHTML):
     17        (WebCore::DatePickerClient::closePopup):
     18        (WebCore::DatePickerClient::contentSize):
     19        (WebCore::DatePickerClient::htmlSource):
     20        (WebCore::DatePickerClient::setValueAndClosePopup):
     21        (WebCore::DatePickerClient::didClosePopup):
     22        (WebCore::DatePickerClient::writeDocument):
     23        * WebCoreSupport/DatePickerClient.h: Added.
     24        (WebKit):
     25        (WebCore):
     26        (DatePickerClient):
     27        * WebKitSupport/InputHandler.cpp:
     28        (BlackBerry::WebKit::InputHandler::openDatePopup):
     29
    1302012-07-10  Adam Barth  <abarth@webkit.org>
    231
  • trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp

    r122162 r122364  
    322322    PagePopupBlackBerry* webPopup = m_webPagePrivate->m_webPage->popup();
    323323    webPopup->closePopup();
     324    delete webPopup;
    324325}
    325326
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

    r121281 r122364  
    2626#include "Chrome.h"
    2727#include "DOMSupport.h"
     28#include "DatePickerClient.h"
    2829#include "Document.h"
    2930#include "DocumentLoader.h"
     
    496497        clearCurrentFocusElement();
    497498
    498     m_currentFocusElement = element;
    499     m_currentFocusElementType = TextPopup;
    500 
    501     WTF::String value = element->value();
    502     WTF::String min = element->getAttribute(HTMLNames::minAttr).string();
    503     WTF::String max = element->getAttribute(HTMLNames::maxAttr).string();
    504     double step = element->getAttribute(HTMLNames::stepAttr).toDouble();
    505     m_webPage->m_client->openDateTimePopup(type, value, min, max, step);
    506     return true;
     499    switch (type) {
     500    case BlackBerry::Platform::InputTypeDate:
     501    case BlackBerry::Platform::InputTypeTime:
     502    case BlackBerry::Platform::InputTypeDateTime:
     503    case BlackBerry::Platform::InputTypeDateTimeLocal: {
     504        // Check if popup already exists, close it if does.
     505        m_webPage->m_page->chrome()->client()->closePagePopup(0);
     506        String value = element->value();
     507        String min = element->getAttribute(HTMLNames::minAttr).string();
     508        String max = element->getAttribute(HTMLNames::maxAttr).string();
     509        double step = element->getAttribute(HTMLNames::stepAttr).toDouble();
     510
     511        DatePickerClient* client = new DatePickerClient(type, value, min, max, step,  m_webPage, element);
     512        // Fail to create HTML popup, use the old path
     513        if (!m_webPage->m_page->chrome()->client()->openPagePopup(client,  WebCore::IntRect()))
     514            m_webPage->m_client->openDateTimePopup(type, value, min, max, step);
     515
     516        return true;
     517        }
     518    default: // Other types not supported
     519        return false;
     520    }
    507521}
    508522
Note: See TracChangeset for help on using the changeset viewer.