WebKit Bugzilla
Attachment 341197 Details for
Bug 185926
: Fix Issues with Loupe Gesture
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185926-20180524092647.patch (text/plain), 6.06 KB, created by
Megan Gardner
on 2018-05-24 09:26:47 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2018-05-24 09:26:47 PDT
Size:
6.06 KB
patch
obsolete
>Subversion Revision: 231854 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 51940422374a2719afe00b023c72a9af669ead17..649cd2db8afc102d831adfab6c29d1a8ca2f9b55 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2018-05-23 Megan Gardner <megan_gardner@apple.com> >+ >+ Fix Issues with Loupe Gesture >+ https://bugs.webkit.org/show_bug.cgi?id=185926 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The loupe gesture was not giving us the correct selection in some situations. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]): >+ (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): >+ (-[WKContentView setSelectedTextRange:]): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::selectWithGesture): >+ (WebKit::WebPage::clearSelection): >+ > 2018-05-16 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win] Implement WebPage::handleEditingKeyboardEvent >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 28077747f84c901e437cb75d3992e30af569f6c1..46e776a11f75010fe8bca8200b8c80a4c0517199 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -1320,6 +1320,11 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius, > #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 > isForcePressGesture = (preventingGestureRecognizer == _textSelectionAssistant.get().forcePressGesture); > #endif >+#if ENABLE(MINIMAL_SIMULATOR) >+ if ((preventingGestureRecognizer == _textSelectionAssistant.get().loupeGesture) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer || preventedGestureRecognizer == _textSelectionAssistant.get().forcePressGesture)) >+ return YES; >+#endif >+ > if ((preventingGestureRecognizer == _textSelectionAssistant.get().loupeGesture || isForcePressGesture || [_webSelectionAssistant isSelectionGestureRecognizer:preventingGestureRecognizer]) && (preventedGestureRecognizer == _highlightLongPressGestureRecognizer || preventedGestureRecognizer == _longPressGestureRecognizer)) > return NO; > >@@ -1344,6 +1349,10 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI > if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _webSelectionAssistant.get().selectionLongPressRecognizer)) > return YES; > #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 >+#if ENABLE(MINIMAL_SIMULATOR) >+ if (isSamePair(gestureRecognizer, otherGestureRecognizer, _textSelectionAssistant.get().loupeGesture, _textSelectionAssistant.get().forcePressGesture)) >+ return YES; >+#endif > if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _textSelectionAssistant.get().forcePressGesture)) > return YES; > #endif >@@ -3196,8 +3205,14 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi > > - (void)setSelectedTextRange:(UITextRange *)range > { >- if (hasAssistedNode(_assistedNodeInformation) && !range) >+ if (range) >+ return; >+#if !ENABLE(MINIMAL_SIMULATOR) >+ if (hasAssistedNode(_assistedNodeInformation)) > [self clearSelection]; >+#else >+ [self clearSelection]; >+#endif > } > > - (BOOL)hasMarkedText >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 4da75aea52a35ef66cf1a9996084372dce3d22ef..28036b1ddb7afcaa1da8d4ce7d77be736e83fce4 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -1540,6 +1540,7 @@ private: > > #if PLATFORM(IOS) > bool m_allowsMediaDocumentInlinePlayback { false }; >+ RefPtr<WebCore::Range> m_startingGestureRange; > #endif > > #if ENABLE(FULLSCREEN_API) >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index e57c86fad372ef0f8babef079c32ad80b1e2e7be..59d846ff0b997d6e9618dfaf91351d26e35b1e0f 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -1141,7 +1141,31 @@ void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uin > if (position.rootEditableElement()) > range = Range::create(*frame.document(), position, position); > else >+#if !ENABLE(MINIMAL_SIMULATOR) > range = wordRangeFromPosition(position); >+#else >+ switch (wkGestureState) { >+ case GestureRecognizerState::Began: >+ m_startingGestureRange = Range::create(*frame.document(), position, position); >+ break; >+ case GestureRecognizerState::Changed: >+ if (m_startingGestureRange) { >+ if (m_startingGestureRange->startPosition() < position) >+ range = Range::create(*frame.document(), m_startingGestureRange->startPosition(), position); >+ else >+ range = Range::create(*frame.document(), position, m_startingGestureRange->startPosition()); >+ } >+ break; >+ case GestureRecognizerState::Ended: >+ case GestureRecognizerState::Cancelled: >+ m_startingGestureRange = nullptr; >+ break; >+ case GestureRecognizerState::Failed: >+ case GestureRecognizerState::Possible: >+ ASSERT_NOT_REACHED(); >+ break; >+ } >+#endif > break; > > case GestureType::TapAndAHalf: >@@ -1291,6 +1315,7 @@ static RefPtr<Range> rangeAtWordBoundaryForPosition(Frame* frame, const VisibleP > } > > void WebPage::clearSelection(){ >+ m_startingGestureRange = nullptr; > m_currentBlockSelection = nullptr; > m_page->focusController().focusedOrMainFrame().selection().clear(); > }
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 185926
:
341146
|
341157
|
341197
|
341222