Title: [205934] trunk/Source/WebKit2
- Revision
- 205934
- Author
- [email protected]
- Date
- 2016-09-14 16:00:46 -0700 (Wed, 14 Sep 2016)
Log Message
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:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (205933 => 205934)
--- trunk/Source/WebKit2/ChangeLog 2016-09-14 22:32:58 UTC (rev 205933)
+++ trunk/Source/WebKit2/ChangeLog 2016-09-14 23:00:46 UTC (rev 205934)
@@ -1,3 +1,29 @@
+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 Eric Carlson <[email protected]>
[MediaStream] Minor cleanup
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (205933 => 205934)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-09-14 22:32:58 UTC (rev 205933)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-09-14 23:00:46 UTC (rev 205934)
@@ -4294,6 +4294,11 @@
m_needsHiddenContentEditableQuirk = needsHiddenContentEditableQuirk;
}
+void WebPageProxy::setNeedsPlainTextQuirk(bool needsPlainTextQuirk)
+{
+ m_needsPlainTextQuirk = needsPlainTextQuirk;
+}
+
// BackForwardList
void WebPageProxy::backForwardAddItem(uint64_t itemID)
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (205933 => 205934)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2016-09-14 22:32:58 UTC (rev 205933)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2016-09-14 23:00:46 UTC (rev 205934)
@@ -1119,6 +1119,7 @@
bool hasHadSelectionChangesFromUserInteraction() const { return m_hasHadSelectionChangesFromUserInteraction; }
bool needsHiddenContentEditableQuirk() const { return m_needsHiddenContentEditableQuirk; }
+ bool needsPlainTextQuirk() const { return m_needsPlainTextQuirk; }
bool isAlwaysOnLoggingAllowed() const;
@@ -1288,6 +1289,7 @@
void compositionWasCanceled(const EditorState&);
void setHasHadSelectionChangesFromUserInteraction(bool);
void setNeedsHiddenContentEditableQuirk(bool);
+ void setNeedsPlainTextQuirk(bool);
// Back/Forward list management
void backForwardAddItem(uint64_t itemID);
@@ -1857,6 +1859,7 @@
bool m_hasHadSelectionChangesFromUserInteraction { false };
bool m_needsHiddenContentEditableQuirk { false };
+ bool m_needsPlainTextQuirk { false };
#if ENABLE(MEDIA_SESSION)
bool m_hasMediaSessionWithActiveMediaElements { false };
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (205933 => 205934)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2016-09-14 22:32:58 UTC (rev 205933)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2016-09-14 23:00:46 UTC (rev 205934)
@@ -236,6 +236,7 @@
CompositionWasCanceled(struct WebKit::EditorState editorState)
SetHasHadSelectionChangesFromUserInteraction(bool hasHadUserSelectionChanges)
SetNeedsHiddenContentEditableQuirk(bool needsHiddenContentEditableQuirk)
+ SetNeedsPlainTextQuirk(bool needsPlainTextQuirk)
# Find messages
DidCountStringMatches(String string, uint32_t matchCount)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (205933 => 205934)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-09-14 22:32:58 UTC (rev 205933)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-09-14 23:00:46 UTC (rev 205934)
@@ -2650,6 +2650,10 @@
m_needsHiddenContentEditableQuirk = false;
send(Messages::WebPageProxy::SetNeedsHiddenContentEditableQuirk(m_needsHiddenContentEditableQuirk));
}
+ if (m_needsPlainTextQuirk) {
+ m_needsPlainTextQuirk = false;
+ send(Messages::WebPageProxy::SetNeedsPlainTextQuirk(m_needsPlainTextQuirk));
+ }
#endif
}
@@ -4805,6 +4809,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()
@@ -4827,6 +4855,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: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (205933 => 205934)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-09-14 22:32:58 UTC (rev 205933)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-09-14 23:00:46 UTC (rev 205934)
@@ -1408,6 +1408,7 @@
bool m_isAssistingNodeDueToUserInteraction { false };
bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
bool m_needsHiddenContentEditableQuirk { false };
+ bool m_needsPlainTextQuirk { false };
#if ENABLE(CONTEXT_MENUS)
bool m_isShowingContextMenu;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes