Changeset 168473 in webkit


Ignore:
Timestamp:
May 8, 2014, 9:42:35 AM (11 years ago)
Author:
Antti Koivisto
Message:

[iOS WebKit2] Can't activate text fields on Facebook
https://bugs.webkit.org/show_bug.cgi?id=132682

Reviewed by Enrica Casucci.

Source/WebCore:

  • page/DOMTimer.cpp:

(WebCore::DOMTimer::fired):

The isDocument() test here had reversed in the merge breaking content change observer callback.

Source/WebKit2:

  • WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:

(WebKit::WebChromeClient::observedContentChange):

Implement content change observer callback.

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::handleSyntheticClick):

If the event gets canceled by a potential change (a started short-duration timer)
save the position and node so we can continue later.

(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):

If it turns out the observed timer changed nothing continue the click event.

(WebKit::WebPage::completeSyntheticClick):

Factored click event dispatch part of handleSyntheticClick here.

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r168469 r168473  
     12014-05-08  Antti Koivisto  <antti@apple.com>
     2
     3        [iOS WebKit2] Can't activate text fields on Facebook
     4        https://bugs.webkit.org/show_bug.cgi?id=132682
     5
     6        Reviewed by Enrica Casucci.
     7
     8        * page/DOMTimer.cpp:
     9        (WebCore::DOMTimer::fired):
     10       
     11            The isDocument() test here had reversed in the merge breaking content change observer callback.
     12
    1132014-05-07  Sergio Villar Senin  <svillar@igalia.com>
    214
  • trunk/Source/WebCore/page/DOMTimer.cpp

    r165676 r168473  
    126126#if PLATFORM(IOS)
    127127    Document* document = nullptr;
    128     if (!context->isDocument()) {
     128    if (context->isDocument()) {
    129129        document = toDocument(context);
    130130        ASSERT(!document->frame()->timersPaused());
  • trunk/Source/WebKit2/ChangeLog

    r168458 r168473  
     12014-05-08  Antti Koivisto  <antti@apple.com>
     2
     3        [iOS WebKit2] Can't activate text fields on Facebook
     4        https://bugs.webkit.org/show_bug.cgi?id=132682
     5
     6        Reviewed by Enrica Casucci.
     7
     8        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
     9        (WebKit::WebChromeClient::observedContentChange):
     10       
     11            Implement content change observer callback.
     12
     13        * WebProcess/WebPage/WebPage.h:
     14        * WebProcess/WebPage/ios/WebPageIOS.mm:
     15        (WebKit::WebPage::handleSyntheticClick):
     16       
     17            If the event gets canceled by a potential change (a started short-duration timer)
     18            save the position and node so we can continue later.
     19
     20        (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
     21       
     22            If it turns out the observed timer changed nothing continue the click event.
     23
     24        (WebKit::WebPage::completeSyntheticClick):
     25       
     26            Factored click event dispatch part of handleSyntheticClick here.
     27
    1282014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    229
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm

    r166384 r168473  
    6666void WebChromeClient::observedContentChange(WebCore::Frame*)
    6767{
    68     notImplemented();
     68    m_page->completePendingSyntheticClickForContentChangeObserver();
    6969}
    7070
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r168388 r168473  
    716716    void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
    717717    void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
     718    void completePendingSyntheticClickForContentChangeObserver();
    718719#endif
    719720
     
    825826    void platformInitializeAccessibility();
    826827    void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
     828    void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
    827829    void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
    828830#endif
     
    11941196    bool m_inDynamicSizeUpdate;
    11951197    HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
     1198    RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
     1199    WebCore::FloatPoint m_pendingSyntheticClickLocation;
    11961200#endif
    11971201
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r168447 r168473  
    326326
    327327    WKBeginObservingContentChanges(true);
     328
    328329    mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0));
    329330    mainframe.document()->updateStyleIfNeeded();
     331
    330332    WKStopObservingContentChanges();
    331     if (WKObservedContentChange() != WKContentNoChange)
     333
     334    m_pendingSyntheticClickNode = nullptr;
     335    m_pendingSyntheticClickLocation = FloatPoint();
     336
     337    switch (WKObservedContentChange()) {
     338    case WKContentVisibilityChange:
     339        // The move event caused new contents to appear. Don't send the click event.
    332340        return;
     341    case WKContentIndeterminateChange:
     342        // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event.
     343        m_pendingSyntheticClickNode = nodeRespondingToClick;
     344        m_pendingSyntheticClickLocation = location;
     345        return;
     346    case WKContentNoChange:
     347        completeSyntheticClick(nodeRespondingToClick, location);
     348        return;
     349    }
     350    ASSERT_NOT_REACHED();
     351}
     352
     353void WebPage::completePendingSyntheticClickForContentChangeObserver()
     354{
     355    if (!m_pendingSyntheticClickNode)
     356        return;
     357    // Only dispatch the click if the document didn't get changed by any timers started by the move event.
     358    if (WKObservedContentChange() == WKContentNoChange)
     359        completeSyntheticClick(m_pendingSyntheticClickNode.get(), m_pendingSyntheticClickLocation);
     360
     361    m_pendingSyntheticClickNode = nullptr;
     362    m_pendingSyntheticClickLocation = FloatPoint();
     363}
     364
     365void WebPage::completeSyntheticClick(Node* nodeRespondingToClick, const WebCore::FloatPoint& location)
     366{
     367    IntPoint roundedAdjustedPoint = roundedIntPoint(location);
     368    Frame& mainframe = m_page->mainFrame();
    333369
    334370    RefPtr<Frame> oldFocusedFrame = m_page->focusController().focusedFrame();
Note: See TracChangeset for help on using the changeset viewer.