Diff
Modified: branches/safari-602-branch/Source/WebKit2/ChangeLog (205947 => 205948)
--- branches/safari-602-branch/Source/WebKit2/ChangeLog 2016-09-15 06:56:50 UTC (rev 205947)
+++ branches/safari-602-branch/Source/WebKit2/ChangeLog 2016-09-15 06:56:53 UTC (rev 205948)
@@ -1,5 +1,35 @@
2016-09-14 Babak Shafiei <[email protected]>
+ Merge r205934. rdar://problem/26013388
+
+ 2016-09-14 Beth Dakin <[email protected]>
+
+ Add needsPlainTextQuirk and send it to the UIProcess
+ https://bugs.webkit.org/show_bug.cgi?id=161996
+ -and corresponding-
+ rdar://problem/26013388
+
+ Reviewed by Anders Carlsson.
+
+ WebPageProxy should keep track of m_needsPlainTextQuirk.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setNeedsPlainTextQuirk):
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::needsPlainTextQuirk):
+ (WebKit::WebPageProxy::needsHiddenContentEditableQuirk): Deleted.
+ * UIProcess/WebPageProxy.messages.in:
+
+ If m_needsPlainTextQuirk is true, set it back to false on page transition.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::didStartPageTransition):
+
+ The sites that need this quirk.
+ (WebKit::needsPlainTextQuirk):
+ (WebKit::WebPage::didChangeSelection):
+ * WebProcess/WebPage/WebPage.h:
+
+2016-09-14 Babak Shafiei <[email protected]>
+
Merge r205928. rdar://problem/26013388
2016-09-14 Beth Dakin <[email protected]>
Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (205947 => 205948)
--- branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-09-15 06:56:50 UTC (rev 205947)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-09-15 06:56:53 UTC (rev 205948)
@@ -4268,6 +4268,11 @@
m_needsHiddenContentEditableQuirk = needsHiddenContentEditableQuirk;
}
+void WebPageProxy::setNeedsPlainTextQuirk(bool needsPlainTextQuirk)
+{
+ m_needsPlainTextQuirk = needsPlainTextQuirk;
+}
+
// BackForwardList
void WebPageProxy::backForwardAddItem(uint64_t itemID)
Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.h (205947 => 205948)
--- branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2016-09-15 06:56:50 UTC (rev 205947)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2016-09-15 06:56:53 UTC (rev 205948)
@@ -1118,6 +1118,7 @@
bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
+ bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
bool isAlwaysOnLoggingAllowed() const;
@@ -1282,6 +1283,7 @@
void compositionWasCanceled(const EditorState&);
void setHasHadSelectionChangesFromUserInteraction(bool);
void setNeedsHiddenContentEditableQuirk(bool);
+ void setNeedsPlainTextQuirk(bool);
// Back/Forward list management
void backForwardAddItem(uint64_t itemID);
@@ -1850,6 +1852,7 @@
bool m_hasHadSelectionChangesFromUserInteraction { false };
bool m_needsHiddenContentEditableQuirk { false };
+ bool m_needsPlainTextQuirk { false };
#if ENABLE(MEDIA_SESSION)
bool m_hasMediaSessionWithActiveMediaElements { false };
Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (205947 => 205948)
--- branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2016-09-15 06:56:50 UTC (rev 205947)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2016-09-15 06:56:53 UTC (rev 205948)
@@ -235,6 +235,7 @@
CompositionWasCanceled(struct WebKit::EditorState editorState)
SetHasHadSelectionChangesFromUserInteraction(bool hasHadUserSelectionChanges)
SetNeedsHiddenContentEditableQuirk(bool needsHiddenContentEditableQuirk)
+ SetNeedsPlainTextQuirk(bool needsPlainTextQuirk)
# Find messages
DidCountStringMatches(String string, uint32_t matchCount)
Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (205947 => 205948)
--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-09-15 06:56:50 UTC (rev 205947)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-09-15 06:56:53 UTC (rev 205948)
@@ -2635,6 +2635,10 @@
m_needsHiddenContentEditableQuirk = false;
send(Messages::WebPageProxy::SetNeedsHiddenContentEditableQuirk(m_needsHiddenContentEditableQuirk));
}
+ if (m_needsPlainTextQuirk) {
+ m_needsPlainTextQuirk = false;
+ send(Messages::WebPageProxy::SetNeedsPlainTextQuirk(m_needsPlainTextQuirk));
+ }
#endif
}
@@ -4772,6 +4776,30 @@
String path = url.path();
return equalLettersIgnoringASCIICase(host, "docs.google.com") || (equalLettersIgnoringASCIICase(host, "www.icloud.com") && path.contains("/pages/"));
}
+
+static bool needsPlainTextQuirk(bool needsQuirks, const URL& url)
+{
+ if (!needsQuirks)
+ return false;
+
+ String host = url.host();
+ String path = url.path();
+ String fragmentIdentifier = url.fragmentIdentifier();
+
+ if (equalLettersIgnoringASCIICase(host, "twitter.com"))
+ return true;
+
+ if (equalLettersIgnoringASCIICase(host, "onedrive.live.com"))
+ return true;
+
+ if (equalLettersIgnoringASCIICase(host, "www.icloud.com") && (path.contains("notes") || fragmentIdentifier.contains("notes") || path.contains("/keynote/")))
+ return true;
+
+ if (equalLettersIgnoringASCIICase(host, "trix-editor.org"))
+ return true;
+
+ return false;
+}
#endif
void WebPage::didChangeSelection()
@@ -4794,6 +4822,12 @@
m_needsHiddenContentEditableQuirk = true;
send(Messages::WebPageProxy::SetNeedsHiddenContentEditableQuirk(m_needsHiddenContentEditableQuirk));
}
+
+ if (needsPlainTextQuirk(m_page->settings().needsSiteSpecificQuirks(), m_page->mainFrame().document()->url())) {
+ m_needsPlainTextQuirk = true;
+ send(Messages::WebPageProxy::SetNeedsPlainTextQuirk(m_needsPlainTextQuirk));
+ }
+
send(Messages::WebPageProxy::SetHasHadSelectionChangesFromUserInteraction(m_hasEverFocusedElementDueToUserInteractionSincePageTransition));
}
Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (205947 => 205948)
--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-09-15 06:56:50 UTC (rev 205947)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-09-15 06:56:53 UTC (rev 205948)
@@ -1393,6 +1393,7 @@
bool m_isAssistingNodeDueToUserInteraction { false };
bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
bool m_needsHiddenContentEditableQuirk { false };
+ bool m_needsPlainTextQuirk { false };
#if ENABLE(CONTEXT_MENUS)
bool m_isShowingContextMenu;