Title: [205928] trunk/Source/WebKit2
Revision
205928
Author
[email protected]
Date
2016-09-14 13:56:20 -0700 (Wed, 14 Sep 2016)

Log Message

Add needsHiddenContentEditableQuirk and send it to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=161984
-and corresponding-
rdar://problem/26013388

Reviewed by Anders Carlsson.

Keep track of m_needsHiddenContentEditableQuirk in WebPageProxy.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setNeedsHiddenContentEditableQuirk):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::needsHiddenContentEditableQuirk):
(WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction): Deleted.
* UIProcess/WebPageProxy.messages.in:

If m_needsHiddenContentEditableQuirk is true, set it back to false on page 
transition.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didStartPageTransition):

Google Docs and iCloud Pages are the sites that need this quirk.
(WebKit::needsHiddenContentEditableQuirk):
(WebKit::WebPage::didChangeSelection):
* WebProcess/WebPage/WebPage.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (205927 => 205928)


--- trunk/Source/WebKit2/ChangeLog	2016-09-14 20:51:41 UTC (rev 205927)
+++ trunk/Source/WebKit2/ChangeLog	2016-09-14 20:56:20 UTC (rev 205928)
@@ -1,3 +1,30 @@
+2016-09-14  Beth Dakin  <[email protected]>
+
+        Add needsHiddenContentEditableQuirk and send it to the UIProcess
+        https://bugs.webkit.org/show_bug.cgi?id=161984
+        -and corresponding-
+        rdar://problem/26013388
+
+        Reviewed by Anders Carlsson.
+
+        Keep track of m_needsHiddenContentEditableQuirk in WebPageProxy.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setNeedsHiddenContentEditableQuirk):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::needsHiddenContentEditableQuirk):
+        (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction): Deleted.
+        * UIProcess/WebPageProxy.messages.in:
+
+        If m_needsHiddenContentEditableQuirk is true, set it back to false on page 
+        transition.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didStartPageTransition):
+
+        Google Docs and iCloud Pages are the sites that need this quirk.
+        (WebKit::needsHiddenContentEditableQuirk):
+        (WebKit::WebPage::didChangeSelection):
+        * WebProcess/WebPage/WebPage.h:
+
 2016-09-14  Megan Gardner  <[email protected]>
 
         Long tap menu on an image link no longer includes "Save Image" button

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (205927 => 205928)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-09-14 20:51:41 UTC (rev 205927)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-09-14 20:56:20 UTC (rev 205928)
@@ -4289,6 +4289,11 @@
     m_hasHadSelectionChangesFromUserInteraction = hasHadUserSelectionChanges;
 }
 
+void WebPageProxy::setNeedsHiddenContentEditableQuirk(bool needsHiddenContentEditableQuirk)
+{
+    m_needsHiddenContentEditableQuirk = needsHiddenContentEditableQuirk;
+}
+
 // BackForwardList
 
 void WebPageProxy::backForwardAddItem(uint64_t itemID)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (205927 => 205928)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-09-14 20:51:41 UTC (rev 205927)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-09-14 20:56:20 UTC (rev 205928)
@@ -1118,6 +1118,7 @@
     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
 
     bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
+    bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
 
     bool isAlwaysOnLoggingAllowed() const;
 
@@ -1286,6 +1287,7 @@
     void editorStateChanged(const EditorState&);
     void compositionWasCanceled(const EditorState&);
     void setHasHadSelectionChangesFromUserInteraction(bool);
+    void setNeedsHiddenContentEditableQuirk(bool);
 
     // Back/Forward list management
     void backForwardAddItem(uint64_t itemID);
@@ -1854,6 +1856,7 @@
     bool m_isResourceCachingDisabled { false };
 
     bool m_hasHadSelectionChangesFromUserInteraction { false };
+    bool m_needsHiddenContentEditableQuirk { false };
 
 #if ENABLE(MEDIA_SESSION)
     bool m_hasMediaSessionWithActiveMediaElements { false };

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (205927 => 205928)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-09-14 20:51:41 UTC (rev 205927)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2016-09-14 20:56:20 UTC (rev 205928)
@@ -235,6 +235,7 @@
     EditorStateChanged(struct WebKit::EditorState editorState)
     CompositionWasCanceled(struct WebKit::EditorState editorState)
     SetHasHadSelectionChangesFromUserInteraction(bool hasHadUserSelectionChanges)
+    SetNeedsHiddenContentEditableQuirk(bool needsHiddenContentEditableQuirk)
 
     # Find messages
     DidCountStringMatches(String string, uint32_t matchCount)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (205927 => 205928)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-09-14 20:51:41 UTC (rev 205927)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-09-14 20:56:20 UTC (rev 205928)
@@ -2646,6 +2646,10 @@
 #if PLATFORM(MAC)
     if (hasPreviouslyFocusedDueToUserInteraction)
         send(Messages::WebPageProxy::SetHasHadSelectionChangesFromUserInteraction(m_hasEverFocusedElementDueToUserInteractionSincePageTransition));
+    if (m_needsHiddenContentEditableQuirk) {
+        m_needsHiddenContentEditableQuirk = false;
+        send(Messages::WebPageProxy::SetNeedsHiddenContentEditableQuirk(m_needsHiddenContentEditableQuirk));
+    }
 #endif
 }
 
@@ -4791,6 +4795,18 @@
 }
 #endif
 
+#if PLATFORM(MAC)
+static bool needsHiddenContentEditableQuirk(bool needsQuirks, const URL& url)
+{
+    if (!needsQuirks)
+        return false;
+
+    String host = url.host();
+    String path = url.path();
+    return equalLettersIgnoringASCIICase(host, "docs.google.com") || (equalLettersIgnoringASCIICase(host, "www.icloud.com") && path.contains("/pages/"));
+}
+#endif
+
 void WebPage::didChangeSelection()
 {
     Frame& frame = m_page->focusController().focusedOrMainFrame();
@@ -4806,8 +4822,13 @@
     bool hasPreviouslyFocusedDueToUserInteraction = m_hasEverFocusedElementDueToUserInteractionSincePageTransition;
     m_hasEverFocusedElementDueToUserInteractionSincePageTransition |= m_userIsInteracting;
 
-    if (!hasPreviouslyFocusedDueToUserInteraction && m_hasEverFocusedElementDueToUserInteractionSincePageTransition)
+    if (!hasPreviouslyFocusedDueToUserInteraction && m_hasEverFocusedElementDueToUserInteractionSincePageTransition) {
+        if (needsHiddenContentEditableQuirk(m_page->settings().needsSiteSpecificQuirks(), m_page->mainFrame().document()->url())) {
+            m_needsHiddenContentEditableQuirk = true;
+            send(Messages::WebPageProxy::SetNeedsHiddenContentEditableQuirk(m_needsHiddenContentEditableQuirk));
+        }
         send(Messages::WebPageProxy::SetHasHadSelectionChangesFromUserInteraction(m_hasEverFocusedElementDueToUserInteractionSincePageTransition));
+    }
 
     // Abandon the current inline input session if selection changed for any other reason but an input method direct action.
     // FIXME: This logic should be in WebCore.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (205927 => 205928)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-09-14 20:51:41 UTC (rev 205927)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-09-14 20:56:20 UTC (rev 205928)
@@ -1407,6 +1407,7 @@
     bool m_userIsInteracting;
     bool m_isAssistingNodeDueToUserInteraction { false };
     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
+    bool m_needsHiddenContentEditableQuirk { false };
 
 #if ENABLE(CONTEXT_MENUS)
     bool m_isShowingContextMenu;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to