WebKit Bugzilla
Attachment 373380 Details for
Bug 199257
: [iOS] Support select all in non-editable element
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199257-20190702205001.patch (text/plain), 5.84 KB, created by
Daniel Bates
on 2019-07-02 20:50:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-07-02 20:50:02 PDT
Size:
5.84 KB
patch
obsolete
>Subversion Revision: 246884 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 574dfd24241c644b30e54205c8982286f0c0d213..7be01784dfe61deabe90d7b09a49d4558fb2d030 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2019-07-02 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Support select all in non-editable element >+ https://bugs.webkit.org/show_bug.cgi?id=199257 >+ <rdar://problem/52553667> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Unless we are populating the callout bar always advertise that WebKit can perform Select All >+ when building with USE(UIKIT_KEYBOARD_ADDITIONS). This way you can press Command + A to select >+ all text even in a non-editable element just like you can on Mac. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView canPerformActionForWebView:withSender:]): >+ > 2019-07-01 Daniel Bates <dabates@apple.com> > > [iOS] Cannot tab cycle through credit card fields on antonsvpatisserie.com checkout page >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 5d0d263aecc00a3505b058b9d82bb010d60ce8b6..0e7a479c305818deffda5031bfb8d40f7bb2a203 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -3053,7 +3053,11 @@ - (BOOL)canPerformActionForWebView:(SEL)action withSender:(id)sender > // By platform convention we don't show Select All in the callout menu for a range selection. > if ([sender isKindOfClass:UIMenuController.class]) > return !editorState.selectionIsNone && !editorState.selectionIsRange; >+#if USE(UIKIT_KEYBOARD_ADDITIONS) >+ return YES; >+#else > return !editorState.selectionIsNone && self.hasContent; >+#endif > } > > if (action == @selector(replace:)) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d01261fa55995c3298c0e976d02c7247a913d434..6f0c17304c3929b8935abdff6235459e3b0f66fa 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2019-07-02 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Support select all in non-editable element >+ https://bugs.webkit.org/show_bug.cgi?id=199257 >+ <rdar://problem/52553667> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a test to ensure that we can perform Select All even when a non-editable element is focused. >+ >+ * editing/selection/ios/select-all-non-editable-text-using-keyboard-expected.txt: Added. >+ * editing/selection/ios/select-all-non-editable-text-using-keyboard.html: Added. >+ * platform/ios/TestExpectations: Skip the test until the fix for <rdar://problem/48322899> >+ has shipped. >+ > 2019-07-02 Daniel Bates <dabates@apple.com> > > Left and right option key has Unidentified key identifier >diff --git a/LayoutTests/editing/selection/ios/select-all-non-editable-text-using-keyboard-expected.txt b/LayoutTests/editing/selection/ios/select-all-non-editable-text-using-keyboard-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..30ff7f428f120e7ac1291affb7619cc47ab9b2e9 >--- /dev/null >+++ b/LayoutTests/editing/selection/ios/select-all-non-editable-text-using-keyboard-expected.txt >@@ -0,0 +1,10 @@ >+Tests pressing Command + a to select all non-editable text. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS window.getSelection().toString() is "Here's to the crazy ones.\n\nThe misfits.\n\nThe rebels." >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/editing/selection/ios/select-all-non-editable-text-using-keyboard.html b/LayoutTests/editing/selection/ios/select-all-non-editable-text-using-keyboard.html >new file mode 100644 >index 0000000000000000000000000000000000000000..56fb549c78d38083cba13bb5bc4cf4bc1fac9940 >--- /dev/null >+++ b/LayoutTests/editing/selection/ios/select-all-non-editable-text-using-keyboard.html >@@ -0,0 +1,46 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../../resources/js-test.js"></script> >+<script src="../../../resources/ui-helper.js"></script> >+<style> >+body.hide-everything-except-test-container > :not(#test-container) { >+ display: none; >+} >+</style> >+</head> >+<body> >+<div id="test-container"> >+ <p>Here's to the crazy ones.</p> >+ <p>The misfits.</p> >+ <p>The rebels.</p> >+</div> >+<script> >+let testContainer = document.getElementById("test-container"); >+let paragraphs = testContainer.children; >+let selection = window.getSelection(); >+ >+function toggleOnlyShowTestContainer() >+{ >+ document.body.classList.toggle("hide-everything-except-test-container"); >+} >+ >+async function runTest() >+{ >+ toggleOnlyShowTestContainer(); >+ >+ await UIHelper.callFunctionAndWaitForEvent(() => window.testRunner && UIHelper.keyDown("a", ["metaKey"]) , document, "selectionchange"); >+ shouldBeEqualToString("window.getSelection().toString()", "Here's to the crazy ones.\n\nThe misfits.\n\nThe rebels."); >+ >+ toggleOnlyShowTestContainer(); >+ >+ document.body.removeChild(document.getElementById("test-container")); >+ finishJSTest(); >+} >+ >+window.jsTestIsAsync = true; >+description("Tests pressing Command + a to select all non-editable text."); >+runTest(); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index 914cca66b11d696ba434c6edf1cff76ca3fa7a6a..45833ab4e587fc61d16602741fcd3c1e60cd7b12 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -3254,3 +3254,4 @@ media/controls-after-reload.html [ Skip ] > > # FIXME: Unskip the following test once we have the fix for <rdar://problem/48322899>. > editing/selection/ios/select-non-editable-text-using-keyboard.html [ Skip ] >+editing/selection/ios/select-all-non-editable-text-using-keyboard.html [ Skip ]
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 199257
:
373368
|
373370
|
373380
|
373428
|
373429