Title: [168786] branches/safari-538.34-branch/Source

Diff

Modified: branches/safari-538.34-branch/Source/WebCore/ChangeLog (168785 => 168786)


--- branches/safari-538.34-branch/Source/WebCore/ChangeLog	2014-05-14 06:14:20 UTC (rev 168785)
+++ branches/safari-538.34-branch/Source/WebCore/ChangeLog	2014-05-14 06:17:57 UTC (rev 168786)
@@ -1,5 +1,21 @@
 2014-04-17  Lucas Forschler  <[email protected]>
 
+        Merge r168473
+
+    2014-05-08  Antti Koivisto  <[email protected]>
+
+            [iOS WebKit2] Can't activate text fields on Facebook
+            https://bugs.webkit.org/show_bug.cgi?id=132682
+
+            Reviewed by Enrica Casucci.
+
+            * page/DOMTimer.cpp:
+            (WebCore::DOMTimer::fired):
+
+                The isDocument() test here had reversed in the merge breaking content change observer callback.
+
+2014-04-17  Lucas Forschler  <[email protected]>
+
         Merge r168452
 
     2014-05-07  Pratik Solanki  <[email protected]>

Modified: branches/safari-538.34-branch/Source/WebCore/page/DOMTimer.cpp (168785 => 168786)


--- branches/safari-538.34-branch/Source/WebCore/page/DOMTimer.cpp	2014-05-14 06:14:20 UTC (rev 168785)
+++ branches/safari-538.34-branch/Source/WebCore/page/DOMTimer.cpp	2014-05-14 06:17:57 UTC (rev 168786)
@@ -125,7 +125,7 @@
     ASSERT(context);
 #if PLATFORM(IOS)
     Document* document = nullptr;
-    if (!context->isDocument()) {
+    if (context->isDocument()) {
         document = toDocument(context);
         ASSERT(!document->frame()->timersPaused());
     }

Modified: branches/safari-538.34-branch/Source/WebKit2/ChangeLog (168785 => 168786)


--- branches/safari-538.34-branch/Source/WebKit2/ChangeLog	2014-05-14 06:14:20 UTC (rev 168785)
+++ branches/safari-538.34-branch/Source/WebKit2/ChangeLog	2014-05-14 06:17:57 UTC (rev 168786)
@@ -1,5 +1,36 @@
 2014-04-17  Lucas Forschler  <[email protected]>
 
+        Merge r168473
+
+    2014-05-08  Antti Koivisto  <[email protected]>
+
+            [iOS WebKit2] Can't activate text fields on Facebook
+            https://bugs.webkit.org/show_bug.cgi?id=132682
+
+            Reviewed by Enrica Casucci.
+
+            * 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.
+
+2014-04-17  Lucas Forschler  <[email protected]>
+
         Merge r168447
 
     2014-05-07  Enrica Casucci  <[email protected]>

Modified: branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (168785 => 168786)


--- branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm	2014-05-14 06:14:20 UTC (rev 168785)
+++ branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm	2014-05-14 06:17:57 UTC (rev 168786)
@@ -65,7 +65,7 @@
 
 void WebChromeClient::observedContentChange(WebCore::Frame*)
 {
-    notImplemented();
+    m_page->completePendingSyntheticClickForContentChangeObserver();
 }
 
 void WebChromeClient::clearContentChangeObservers(WebCore::Frame*)

Modified: branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (168785 => 168786)


--- branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-05-14 06:14:20 UTC (rev 168785)
+++ branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-05-14 06:17:57 UTC (rev 168786)
@@ -715,6 +715,7 @@
     void applicationDidBecomeActive();
     void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
     void dispatchTouchEvent(const WebTouchEvent&, bool& handled);
+    void completePendingSyntheticClickForContentChangeObserver();
 #endif
 
 #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
@@ -824,6 +825,7 @@
     void getAssistedNodeInformation(AssistedNodeInformation&);
     void platformInitializeAccessibility();
     void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
+    void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
     void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
 #endif
 #if !PLATFORM(COCOA)
@@ -1193,6 +1195,8 @@
     WebCore::FloatSize m_minimumLayoutSizeForMinimalUI;
     bool m_inDynamicSizeUpdate;
     HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
+    RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
+    WebCore::FloatPoint m_pendingSyntheticClickLocation;
 #endif
 
     WebInspectorClient* m_inspectorClient;

Modified: branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (168785 => 168786)


--- branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-05-14 06:14:20 UTC (rev 168785)
+++ branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-05-14 06:17:57 UTC (rev 168786)
@@ -325,12 +325,48 @@
     Frame& mainframe = m_page->mainFrame();
 
     WKBeginObservingContentChanges(true);
+
     mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0));
     mainframe.document()->updateStyleIfNeeded();
+
     WKStopObservingContentChanges();
-    if (WKObservedContentChange() != WKContentNoChange)
+
+    m_pendingSyntheticClickNode = nullptr;
+    m_pendingSyntheticClickLocation = FloatPoint();
+
+    switch (WKObservedContentChange()) {
+    case WKContentVisibilityChange:
+        // The move event caused new contents to appear. Don't send the click event.
         return;
+    case WKContentIndeterminateChange:
+        // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event.
+        m_pendingSyntheticClickNode = nodeRespondingToClick;
+        m_pendingSyntheticClickLocation = location;
+        return;
+    case WKContentNoChange:
+        completeSyntheticClick(nodeRespondingToClick, location);
+        return;
+    }
+    ASSERT_NOT_REACHED();
+}
 
+void WebPage::completePendingSyntheticClickForContentChangeObserver()
+{
+    if (!m_pendingSyntheticClickNode)
+        return;
+    // Only dispatch the click if the document didn't get changed by any timers started by the move event.
+    if (WKObservedContentChange() == WKContentNoChange)
+        completeSyntheticClick(m_pendingSyntheticClickNode.get(), m_pendingSyntheticClickLocation);
+
+    m_pendingSyntheticClickNode = nullptr;
+    m_pendingSyntheticClickLocation = FloatPoint();
+}
+
+void WebPage::completeSyntheticClick(Node* nodeRespondingToClick, const WebCore::FloatPoint& location)
+{
+    IntPoint roundedAdjustedPoint = roundedIntPoint(location);
+    Frame& mainframe = m_page->mainFrame();
+
     RefPtr<Frame> oldFocusedFrame = m_page->focusController().focusedFrame();
     RefPtr<Element> oldFocusedElement = oldFocusedFrame ? oldFocusedFrame->document()->focusedElement() : nullptr;
     m_userIsInteracting = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to