WebKit Bugzilla
Attachment 373467 Details for
Bug 199497
: [ContentChangeObserver] Limit mouseOut dispatching after synthetic click to YouTube.com
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199497-20190704080227.patch (text/plain), 14.94 KB, created by
zalan
on 2019-07-04 08:02:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-07-04 08:02:32 PDT
Size:
14.94 KB
patch
obsolete
>Subversion Revision: 247085 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3df5f88decfe9ab63edfb3c637070825a1669b52..a4853b7df776af3e2dcd5a21efb46aaf61f878bf 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2019-07-04 Zalan Bujtas <zalan@apple.com> >+ >+ [ContentChangeObserver] Limit mouseOut dispatching after synthetic click to YouTube.com >+ https://bugs.webkit.org/show_bug.cgi?id=199497 >+ <rdar://problem/52361019> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ r242798 introduced synthetic mouseOut dispatching soon after sythentic click to dismiss certain type of content (e.g. video control bar on YouTube). >+ However on many sites, it resulted in dismissing useful content, like menu panes and other, non-clickable but informative content. >+ This patch limits the mouseOut dispatching to YouTube.com. >+ >+ Test: fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click.html >+ >+ * page/Quirks.cpp: >+ (WebCore::Quirks::needsYouTubeMouseOutQuirk const): >+ * page/Quirks.h: >+ * page/Settings.yaml: >+ * testing/InternalSettings.cpp: >+ (WebCore::InternalSettings::Backup::Backup): >+ (WebCore::InternalSettings::Backup::restoreTo): >+ (WebCore::InternalSettings::setShouldDispatchSyntheticMouseOutAfterSyntheticClick): >+ * testing/InternalSettings.h: >+ * testing/InternalSettings.idl: >+ > 2019-07-02 Said Abou-Hallawa <sabouhallawa@apple.com> > > Assertion fires when animating the 'class' attribute of an SVG element >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3e83275df6e5ef2706bbc89502b17922ef638635..e95d4813406db67290f2d3db7e31b59eee3901da 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2019-07-04 Zalan Bujtas <zalan@apple.com> >+ >+ [ContentChangeObserver] Limit mouseOut dispatching after synthetic click to YouTube.com >+ https://bugs.webkit.org/show_bug.cgi?id=199497 >+ <rdar://problem/52361019> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::completeSyntheticClick): >+ > 2019-07-02 Youenn Fablet <youenn@apple.com> > > StorageManager does not need to be a WorkQueueMessageReceiver anymore >diff --git a/Source/WebCore/page/Quirks.cpp b/Source/WebCore/page/Quirks.cpp >index 93c404ecb907d2af8ba1b04cc5638bc4f4a07609..9957b8aee810fa5cfcb7fdd56093311cd40d0516 100644 >--- a/Source/WebCore/page/Quirks.cpp >+++ b/Source/WebCore/page/Quirks.cpp >@@ -238,6 +238,21 @@ bool Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const > return false; > } > >+bool Quirks::needsYouTubeMouseOutQuirk() const >+{ >+#if PLATFORM(IOS_FAMILY) >+ if (m_document->settings().shouldDispatchSyntheticMouseOutAfterSyntheticClick()) >+ return true; >+ >+ if (!needsQuirks()) >+ return false; >+ >+ return equalLettersIgnoringASCIICase(m_document->url().host(), "www.youtube.com"); >+#else >+ return false; >+#endif >+} >+ > bool Quirks::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const > { > if (!needsQuirks()) >@@ -392,5 +407,4 @@ bool Quirks::needsYouTubeOverflowScrollQuirk() const > #endif > } > >- > } >diff --git a/Source/WebCore/page/Quirks.h b/Source/WebCore/page/Quirks.h >index 05122a9952a85ec00e90ac5af9c68a5c6838a76b..43d7eaeec7b26d473f0a510f87cb80f522539903 100644 >--- a/Source/WebCore/page/Quirks.h >+++ b/Source/WebCore/page/Quirks.h >@@ -62,6 +62,8 @@ public: > WEBCORE_EXPORT bool isNeverRichlyEditableForTouchBar() const; > WEBCORE_EXPORT bool shouldAvoidResizingWhenInputViewBoundsChange() const; > >+ WEBCORE_EXPORT bool needsYouTubeMouseOutQuirk() const; >+ > bool needsGMailOverflowScrollQuirk() const; > bool needsYouTubeOverflowScrollQuirk() const; > >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index cbc73a110fbd56491c3acfc4782a0e202a37bfc6..e22d8d4e29023e82a0ca047c1d6f55e84d42d8a3 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -840,6 +840,9 @@ shouldDecidePolicyBeforeLoadingQuickLookPreview: > shouldDispatchSyntheticMouseEventsWhenModifyingSelection: > initial: false > >+shouldDispatchSyntheticMouseOutAfterSyntheticClick: >+ initial: false >+ > allowViewportShrinkToFitContent: > initial: true > >diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp >index e723a4771e0f0cc9baf3eed5cf9327c1172530b6..c1131d25b388bba836653d29708e6a5bbe4bdfc4 100644 >--- a/Source/WebCore/testing/InternalSettings.cpp >+++ b/Source/WebCore/testing/InternalSettings.cpp >@@ -101,6 +101,7 @@ InternalSettings::Backup::Backup(Settings& settings) > , m_inputEventsEnabled(settings.inputEventsEnabled()) > , m_incompleteImageBorderEnabled(settings.incompleteImageBorderEnabled()) > , m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection(settings.shouldDispatchSyntheticMouseEventsWhenModifyingSelection()) >+ , m_shouldDispatchSyntheticMouseOutAfterSyntheticClick(settings.shouldDispatchSyntheticMouseOutAfterSyntheticClick()) > , m_shouldDeactivateAudioSession(PlatformMediaSessionManager::shouldDeactivateAudioSession()) > , m_userInterfaceDirectionPolicy(settings.userInterfaceDirectionPolicy()) > , m_systemLayoutDirection(settings.systemLayoutDirection()) >@@ -209,6 +210,7 @@ void InternalSettings::Backup::restoreTo(Settings& settings) > settings.setFrameFlattening(m_frameFlattening); > settings.setIncompleteImageBorderEnabled(m_incompleteImageBorderEnabled); > settings.setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection); >+ settings.setShouldDispatchSyntheticMouseOutAfterSyntheticClick(m_shouldDispatchSyntheticMouseOutAfterSyntheticClick); > PlatformMediaSessionManager::setShouldDeactivateAudioSession(m_shouldDeactivateAudioSession); > > #if ENABLE(INDEXED_DATABASE_IN_WORKERS) >@@ -936,6 +938,14 @@ ExceptionOr<void> InternalSettings::setShouldDispatchSyntheticMouseEventsWhenMod > return { }; > } > >+ExceptionOr<void> InternalSettings::setShouldDispatchSyntheticMouseOutAfterSyntheticClick(bool shouldDispatch) >+{ >+ if (!m_page) >+ return Exception { InvalidAccessError }; >+ settings().setShouldDispatchSyntheticMouseOutAfterSyntheticClick(shouldDispatch); >+ return { }; >+} >+ > static InternalSettings::ForcedAccessibilityValue settingsToInternalSettingsValue(Settings::ForcedAccessibilityValue value) > { > switch (value) { >diff --git a/Source/WebCore/testing/InternalSettings.h b/Source/WebCore/testing/InternalSettings.h >index a04c4021f28c5c3cb194d6352c0c41c56f8d2cf9..662d8fea2986d8f4602e3efe4bc5b2b0aff7735e 100644 >--- a/Source/WebCore/testing/InternalSettings.h >+++ b/Source/WebCore/testing/InternalSettings.h >@@ -104,6 +104,7 @@ public: > ExceptionOr<void> setCustomPasteboardDataEnabled(bool); > ExceptionOr<void> setIncompleteImageBorderEnabled(bool); > ExceptionOr<void> setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(bool); >+ ExceptionOr<void> setShouldDispatchSyntheticMouseOutAfterSyntheticClick(bool); > > using FrameFlatteningValue = FrameFlattening; > ExceptionOr<void> setFrameFlattening(FrameFlatteningValue); >@@ -200,6 +201,7 @@ private: > bool m_inputEventsEnabled; > bool m_incompleteImageBorderEnabled; > bool m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection; >+ bool m_shouldDispatchSyntheticMouseOutAfterSyntheticClick { false }; > bool m_shouldDeactivateAudioSession; > UserInterfaceDirectionPolicy m_userInterfaceDirectionPolicy; > TextDirection m_systemLayoutDirection; >diff --git a/Source/WebCore/testing/InternalSettings.idl b/Source/WebCore/testing/InternalSettings.idl >index aaf24a9920be9e0fca97e3fb65957e4b39c27b4d..e63cc56062b3e81a0b347d0f9ceeb8bf42be98d6 100644 >--- a/Source/WebCore/testing/InternalSettings.idl >+++ b/Source/WebCore/testing/InternalSettings.idl >@@ -89,6 +89,7 @@ enum FontLoadTimingOverride { "Block", "Swap", "Failure" }; > [MayThrowException] void setFrameFlattening(FrameFlatteningValue frameFlattening); > [MayThrowException] void setIncompleteImageBorderEnabled(boolean enabled); > [MayThrowException] void setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(boolean shouldDispatch); >+ [MayThrowException] void setShouldDispatchSyntheticMouseOutAfterSyntheticClick(boolean shouldDispatch); > > // RuntimeEnabledFeatures. > void setIndexedDBWorkersEnabled(boolean enabled); >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 73b6108511433207772f38c2271c7b1a99a1b73f..f48cf27de1f4b1f9ec08c440218bae4442d3be5f 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -779,9 +779,14 @@ void WebPage::completeSyntheticClick(Node& nodeRespondingToClick, const WebCore: > if (newFocusedElement && newFocusedElement == oldFocusedElement) > elementDidRefocus(*newFocusedElement); > >- // Only send a synthetic mouse out event if synthetic mouse move events were sent; this is true when ContentChangeObserver is enabled. >- if (nodeRespondingToClick.document().settings().contentChangeObserverEnabled() && !tapWasHandled && nodeRespondingToClick.document().frame()) >- nodeRespondingToClick.document().frame()->eventHandler().dispatchSyntheticMouseOut(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::NoType, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap, pointerId)); >+ if (nodeRespondingToClick.document().settings().contentChangeObserverEnabled()) { >+ auto& document = nodeRespondingToClick.document(); >+ // Dispatch mouseOut to dismiss tooltip content when tapping on the control bar buttons (cc, settings). >+ if (document.quirks().needsYouTubeMouseOutQuirk()) { >+ if (auto* frame = document.frame()) >+ frame->eventHandler().dispatchSyntheticMouseOut(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::NoType, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap, pointerId)); >+ } >+ } > > if (m_isClosed) > return; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 44a42bfc7a78ed91b8180bed37710ebba9bceb91..d148bbebcadd7e88f5a5172c3d3ac5fce61d287e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-07-04 Zalan Bujtas <zalan@apple.com> >+ >+ [ContentChangeObserver] Limit mouseOut dispatching after synthetic click to YouTube.com >+ https://bugs.webkit.org/show_bug.cgi?id=199497 >+ <rdar://problem/52361019> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html: >+ * fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-expected.txt: Added. >+ * fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click.html: Copied from LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html. >+ > 2019-07-02 Said Abou-Hallawa <sabouhallawa@apple.com> > > Assertion fires when animating the 'class' attribute of an SVG element >diff --git a/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html b/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html >index 48e1846e841c603ee610e3b1c79e1645999cc440..92ef848013427039d33d070058634772db7f6b79 100644 >--- a/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html >+++ b/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html >@@ -1,7 +1,7 @@ > <!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] --> > <html> > <head> >-<title>This tests that we fire mouseout on synthetic click</title> >+<title>This tests that we fire mouseout on synthetic click when the quirk is on.</title> > <script src="../../../../../resources/basic-gestures.js"></script> > <style> > #tapthis { >@@ -20,8 +20,10 @@ > async function test() { > if (!window.testRunner || !testRunner.runUIScript) > return; >- if (window.internals) >+ if (window.internals) { > internals.settings.setContentChangeObserverEnabled(true); >+ internals.settings.setShouldDispatchSyntheticMouseOutAfterSyntheticClick(true); >+ } > > testRunner.waitUntilDone(); > testRunner.dumpAsText(); >diff --git a/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-expected.txt b/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ce7d74b602443a440919fe901a806014fd29a31f >--- /dev/null >+++ b/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click-expected.txt >@@ -0,0 +1,2 @@ >+PASS if 'mouseout' text is NOT shown below. >+ clicked >diff --git a/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click.html b/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4eebc28317fb0055f2bf4adc62a6c86b761af939 >--- /dev/null >+++ b/LayoutTests/fast/events/touch/ios/content-observation/mouse-out-event-should-not-fire-on-click.html >@@ -0,0 +1,58 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<head> >+<title>This tests that we _do_not_ fire mouseout on synthetic click by default.</title> >+<script src="../../../../../resources/basic-gestures.js"></script> >+<style> >+#tapthis { >+ width: 400px; >+ height: 400px; >+ border: 1px solid green; >+} >+ >+#becomesVisible { >+ width: 100px; >+ height: 100px; >+ background-color: green; >+} >+</style> >+<script> >+async function test() { >+ if (!window.testRunner || !testRunner.runUIScript) >+ return; >+ if (window.internals) >+ internals.settings.setContentChangeObserverEnabled(true); >+ >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+ >+ let rect = tapthis.getBoundingClientRect(); >+ let x = rect.left + rect.width / 2; >+ let y = rect.top + rect.height / 2; >+ >+ await tapAtPoint(x, y); >+} >+</script> >+</head> >+<body onload="test()"> >+<button id=tapthis>PASS if 'mouseout' text is NOT shown below.</button> >+<div id=becomesVisible></div> >+<pre id=result></pre> >+<script> >+ >+becomesVisible.addEventListener("click", function( event ) { >+ result.innerHTML = "clicked hidden"; >+}, false); >+ >+tapthis.addEventListener("mouseout", function( event ) { >+ result.innerHTML = result.innerHTML + " mouseout triggered "; >+ if (window.testRunner) >+ testRunner.notifyDone(); >+}, false); >+ >+tapthis.addEventListener("click", function( event ) { >+ result.innerHTML = result.innerHTML + " clicked "; >+}, false); >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199497
:
373467
|
373469
|
373472