Title: [285365] trunk/Source/WebCore
Revision
285365
Author
megan_gard...@apple.com
Date
2021-11-05 21:49:48 -0700 (Fri, 05 Nov 2021)

Log Message

Lookup for text would not show after clicking the page and using key commands to launch.
https://bugs.webkit.org/show_bug.cgi?id=232766
rdar://74562619

Reviewed by Wenson Hsieh.

When triggering the lookup command with command-control-D or the triple finger tap on mac, if you have previously
clicked the page, the lookup would time out and the popover would never show. This was because after clicking on the page,
an invisible caret selection would exist, which would change the path taken for highlighting and temporarily selecting text to
be sent to data detectors.
The solution was to set ignoreSelectionChanges on the temporary selection, and also to stop propagating temporary selection changes to accessibility, as
that should not be necessary and that is the code that cause a sync message (RootViewToScreen) to be sent to the UI process while it was sync awaiting our
reply to the sync message (DidPerformImmediateActionHitTest) sent earlier for the original request for data detectors.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::updateAndRevealSelection):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285364 => 285365)


--- trunk/Source/WebCore/ChangeLog	2021-11-06 04:33:11 UTC (rev 285364)
+++ trunk/Source/WebCore/ChangeLog	2021-11-06 04:49:48 UTC (rev 285365)
@@ -1,3 +1,24 @@
+2021-11-05  Megan Gardner  <megan_gard...@apple.com>
+
+        Lookup for text would not show after clicking the page and using key commands to launch.
+        https://bugs.webkit.org/show_bug.cgi?id=232766
+        rdar://74562619
+
+        Reviewed by Wenson Hsieh.
+
+        When triggering the lookup command with command-control-D or the triple finger tap on mac, if you have previously
+        clicked the page, the lookup would time out and the popover would never show. This was because after clicking on the page, 
+        an invisible caret selection would exist, which would change the path taken for highlighting and temporarily selecting text to 
+        be sent to data detectors. 
+        The solution was to set ignoreSelectionChanges on the temporary selection, and also to stop propagating temporary selection changes to accessibility, as 
+        that should not be necessary and that is the code that cause a sync message (RootViewToScreen) to be sent to the UI process while it was sync awaiting our
+        reply to the sync message (DidPerformImmediateActionHitTest) sent earlier for the original request for data detectors.
+
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::updateAndRevealSelection):
+        * page/TextIndicator.cpp:
+        (WebCore::TextIndicator::createWithRange):
+
 2021-11-05  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Mail compose becomes unresponsive after pasting in text and attempting to type

Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (285364 => 285365)


--- trunk/Source/WebCore/editing/FrameSelection.cpp	2021-11-06 04:33:11 UTC (rev 285364)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp	2021-11-06 04:49:48 UTC (rev 285365)
@@ -498,8 +498,8 @@
 
         revealSelection(m_selectionRevealMode, alignment, revealExtent, scrollBehavior);
     }
-
-    notifyAccessibilityForSelectionChange(intent);
+    if (!m_document->editor().ignoreSelectionChanges())
+        notifyAccessibilityForSelectionChange(intent);
 }
 
 void FrameSelection::updateDataDetectorsForSelection()

Modified: trunk/Source/WebCore/page/TextIndicator.cpp (285364 => 285365)


--- trunk/Source/WebCore/page/TextIndicator.cpp	2021-11-06 04:33:11 UTC (rev 285364)
+++ trunk/Source/WebCore/page/TextIndicator.cpp	2021-11-06 04:49:48 UTC (rev 285365)
@@ -81,8 +81,8 @@
 
     OptionSet<TemporarySelectionOption> temporarySelectionOptions;
     temporarySelectionOptions.add(TemporarySelectionOption::DoNotSetFocus);
+    temporarySelectionOptions.add(TemporarySelectionOption::IgnoreSelectionChanges);
 #if PLATFORM(IOS_FAMILY)
-    temporarySelectionOptions.add(TemporarySelectionOption::IgnoreSelectionChanges);
     temporarySelectionOptions.add(TemporarySelectionOption::EnableAppearanceUpdates);
 #endif
     TemporarySelectionChange selectionChange(*document, { range }, temporarySelectionOptions);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to