WebKit Bugzilla
Attachment 345938 Details for
Bug 188107
: [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188107-20180727124152.patch (text/plain), 6.42 KB, created by
Wenson Hsieh
on 2018-07-27 12:41:53 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-07-27 12:41:53 PDT
Size:
6.42 KB
patch
obsolete
>Subversion Revision: 234280 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9202f26e4c2f3a6014a0c6078ea8fa295e90cd9b..9eded023d3d2eb2d2fbd980ed2e28b8c822fe5d7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-07-27 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in >+ https://bugs.webkit.org/show_bug.cgi?id=188107 >+ <rdar://problem/42354250> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element, >+ which allows the page to handle click events inside editable content. However, this means that codepaths in >+ EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now >+ active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing >+ mechanism for modifying the selection on iOS. >+ >+ To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the >+ default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is >+ similar to r233311, but in a different codepath that specifically handles selection changes when clicking on >+ content that is already selected. >+ >+ Test: fast/forms/ios/click-should-not-suppress-misspelling.html >+ >+ * page/EventHandler.cpp: >+ (WebCore::EventHandler::handleMouseReleaseEvent): >+ > 2018-07-26 Antoine Quint <graouts@apple.com> > > [Web Animations] Accelerated animations don't respect a positive delay value >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 26c89b0cfb5ff6fc01c24e9d3df480dd9bae618a..c8b1447eebdf487edd38acf2a0351032e30da1f8 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -1050,12 +1050,21 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e > VisibleSelection newSelection; > Node* node = event.targetNode(); > bool caretBrowsing = m_frame.settings().caretBrowsingEnabled(); >+ bool allowSelectionChanges = true; > if (node && node->renderer() && (caretBrowsing || node->hasEditableStyle())) { > VisiblePosition pos = node->renderer()->positionForPoint(event.localPoint(), nullptr); > newSelection = VisibleSelection(pos); >+#if PLATFORM(IOS) >+ // On iOS, selection changes are triggered using platform-specific text interaction gestures rather than >+ // default behavior on click or mouseup. As such, the only time we should allow click events to change the >+ // selection on iOS is when we focus a different editable element, in which case the text interaction >+ // gestures will fail. >+ allowSelectionChanges = m_frame.selection().selection().rootEditableElement() != newSelection.rootEditableElement(); >+#endif > } > >- setSelectionIfNeeded(m_frame.selection(), newSelection); >+ if (allowSelectionChanges) >+ setSelectionIfNeeded(m_frame.selection(), newSelection); > > handled = true; > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 209e9cd88388e26ed6476d28534691ea63e14241..05ec6cd27c678a39eb51fa415b0fef79b49b9de0 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2018-07-27 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in >+ https://bugs.webkit.org/show_bug.cgi?id=188107 >+ <rdar://problem/42354250> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Adds a new test to verify that tapping in a misspelled word to bring up the spelling correction callout and >+ selection view does not immediately cause the selection to dismiss. >+ >+ * fast/forms/ios/click-should-not-suppress-misspelling-expected.txt: Added. >+ * fast/forms/ios/click-should-not-suppress-misspelling.html: Added. >+ > 2018-07-26 Antoine Quint <graouts@apple.com> > > [Web Animations] Accelerated animations don't respect a positive delay value >diff --git a/LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling-expected.txt b/LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..691e2b4d8afc63bed86fe3bfaf0f9f507d213f3c >--- /dev/null >+++ b/LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling-expected.txt >@@ -0,0 +1,6 @@ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+PASS input.selectionStart is 0 >+PASS input.selectionEnd is 7 >+ >diff --git a/LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling.html b/LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling.html >new file mode 100644 >index 0000000000000000000000000000000000000000..07024853b06bf3c3d12346f6c1c3f727c1d5a8c2 >--- /dev/null >+++ b/LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling.html >@@ -0,0 +1,49 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<head> >+<script src="../../../resources/ui-helper.js"></script> >+<script src="../../../resources/js-test.js"></script> >+<style> >+html, body { >+ margin: 0; >+ width: 100%; >+ height: 100%; >+} >+ >+input { >+ font-size: 320px; >+ display: block; >+} >+</style> >+</head> >+<body> >+<input id="input" value="covfefe"> >+</body> >+<script> >+const input = document.getElementById("input"); >+ >+addEventListener("load", async () => { >+ if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+ } else { >+ description(`To manually test, tap the input field to bring up the keyboard, and then tap on a part of the word in >+ the input field that is far away from the editing caret. As a result, the contents of the input should be >+ selected and marked as a misspelled word.`); >+ return; >+ } >+ >+ await UIHelper.activateAndWaitForInputSessionAt(100, 150); >+ >+ input.addEventListener("click", () => { >+ setTimeout(() => { >+ shouldBe("input.selectionStart", "0"); >+ shouldBe("input.selectionEnd", "7"); >+ testRunner.notifyDone(); >+ }); >+ }); >+ >+ await UIHelper.tapAt(800, 150); >+}); >+</script> >+</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 188107
: 345938 |
346248
|
346250
|
346258