WebKit Bugzilla
Attachment 373429 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-20190703162012.patch (text/plain), 9.56 KB, created by
Daniel Bates
on 2019-07-03 16:20:13 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-07-03 16:20:13 PDT
Size:
9.56 KB
patch
obsolete
>Subversion Revision: 247115 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 13155d474e0853276544b1bdac2949dbfe2de9f3..92d35560f6c12e74f76a99dc5773acdddbd60b9b 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2019-07-03 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-03 Chris Dumez <cdumez@apple.com> > > Fix a couple of thread safety issues in ResourceLoadStatisticsStore >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 0fc3e4368868f4af0c8fcb45026b4af9d9458b5c..b46ff67725d2e79ef315f36f9c4250be0416bd16 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -3060,7 +3060,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 3a982f8b4247f4c10c0468e16ad1499c57613d07..7147fc04b5c63a0ef88484915820abe0f03f1213 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,29 @@ >+2019-07-03 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. >+ >+ Also disallow testing of Command + A until we fix <https://bugs.webkit.org/show_bug.cgi?id=199475>. >+ Otherwise, the test fast/events/ios/key-events-comprehensive/key-events-meta.html fails since >+ Command + A now triggers page selection even in a non-editable (the purpose of this change) >+ and hence Command + C also triggers the copy command. The triggering of these commands causes >+ the test to fail the Command + A and Command + C sub-tests since no keypress event is dispatched >+ for the key that triggered these key commands. This is expected, but Command + A should not have >+ triggered selection as key-tester.js calls preventDefault() from a keypress handler. That's >+ the bug. See <https://bugs.webkit.org/show_bug.cgi?id=199475> for more details. >+ >+ * 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. >+ * fast/events/ios/key-events-comprehensive/key-events-meta-expected.txt: Updated result. >+ * fast/events/ios/resources/key-tester.js: Disallow Command + A until we fix <https://bugs.webkit.org/show_bug.cgi?id=199475>. >+ * platform/ios/TestExpectations: Skip the test until the fix for <rdar://problem/48322899> >+ has shipped. >+ > 2019-07-02 Myles C. Maxfield <mmaxfield@apple.com> > > [WHLSL] Standard library is too big to directly include in WebCore >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/fast/events/ios/key-events-comprehensive/key-events-meta-expected.txt b/LayoutTests/fast/events/ios/key-events-comprehensive/key-events-meta-expected.txt >index 5ce393684ef1926394186ad89da7b698dc962f4b..c75a772f4a33c729d173fecc58dc44ab5b633b3b 100644 >--- a/LayoutTests/fast/events/ios/key-events-comprehensive/key-events-meta-expected.txt >+++ b/LayoutTests/fast/events/ios/key-events-comprehensive/key-events-meta-expected.txt >@@ -1,12 +1,6 @@ > This logs DOM keydown, keyup, keypress events that are dispatched when pressing key commands of the form Command + X. Must be run in WebKitTestRunner. > > >-Test Command + a: >-type: keydown, key: Meta, code: MetaLeft, keyIdentifier: Meta, keyCode: 91, charCode: 0, keyCode: 91, which: 91, altKey: false, ctrlKey: false, metaKey: true, shiftKey: false, location: 1, keyLocation: 1 >-type: keydown, key: a, code: KeyA, keyIdentifier: U+0041, keyCode: 65, charCode: 0, keyCode: 65, which: 65, altKey: false, ctrlKey: false, metaKey: true, shiftKey: false, location: 0, keyLocation: 0 >-type: keypress, key: a, code: KeyA, keyIdentifier: , keyCode: 97, charCode: 97, keyCode: 97, which: 97, altKey: false, ctrlKey: false, metaKey: true, shiftKey: false, location: 0, keyLocation: 0 >-type: keyup, key: Meta, code: MetaLeft, keyIdentifier: Meta, keyCode: 91, charCode: 0, keyCode: 91, which: 91, altKey: false, ctrlKey: false, metaKey: false, shiftKey: false, location: 1, keyLocation: 1 >- > Test Command + b: > type: keydown, key: Meta, code: MetaLeft, keyIdentifier: Meta, keyCode: 91, charCode: 0, keyCode: 91, which: 91, altKey: false, ctrlKey: false, metaKey: true, shiftKey: false, location: 1, keyLocation: 1 > type: keydown, key: b, code: KeyB, keyIdentifier: U+0042, keyCode: 66, charCode: 0, keyCode: 66, which: 66, altKey: false, ctrlKey: false, metaKey: true, shiftKey: false, location: 0, keyLocation: 0 >diff --git a/LayoutTests/fast/events/ios/resources/key-tester.js b/LayoutTests/fast/events/ios/resources/key-tester.js >index 60dbe9ece7dd6e3cace83fd5649a44ec3ed2b35c..0efd96e459eb891c4f8557e59f35ffff47891c07 100644 >--- a/LayoutTests/fast/events/ios/resources/key-tester.js >+++ b/LayoutTests/fast/events/ios/resources/key-tester.js >@@ -75,6 +75,9 @@ let disallowedKeyCommands = [ > new KeyCommand("]", ["metaKey"]), > new KeyCommand("r", ["metaKey"]), > new KeyCommand("r", ["metaKey", "altKey"]), >+ >+ // FIXME: Command + A cannot be prevented from keypress. See <https://bugs.webkit.org/show_bug.cgi?id=199475>. >+ new KeyCommand("a", ["metaKey"]), > ]; > for (let i = 1; i <= 9; ++i) > disallowedKeyCommands.push(new KeyCommand(i, ["metaKey"])); >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index fb6b7a1df7cd032b6c9b0e1a148333bb8da32d52..985b603d36e7ea56e4daa2e5fa87e5623f5c8755 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -3252,5 +3252,6 @@ 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 ] > > webkit.org/b/199472 fast/events/ios/keydown-keyup-keypress-keys-in-non-editable-using-chinese-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