WebKit Bugzilla
Attachment 361694 Details for
Bug 194505
: [iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch and layout tests
bug-194505-20190211103420.patch (text/plain), 9.37 KB, created by
Daniel Bates
on 2019-02-11 10:34:20 PST
(
hide
)
Description:
Patch and layout tests
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-02-11 10:34:20 PST
Size:
9.37 KB
patch
obsolete
>Subversion Revision: 241028 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9993ba9c078d548137086505697b35c3672dd21d..11ab083de5007317f0b18828c4b180dcad00555a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-11 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph >+ https://bugs.webkit.org/show_bug.cgi?id=194505 >+ <rdar://problem/47743533> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _deleteToEndOfParagraph]): Added. >+ (-[WKContentView _transpose]): Added. >+ > 2019-02-06 Daniel Bates <dabates@apple.com> > > Standardize on ControlKey instead of CtrlKey >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 4d8e3604a8ea88f516f6743c3af8d47474185689..f3bc6c331a951949cc1b0dad7d2c1e570f115ead 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -4274,6 +4274,16 @@ - (void)_deleteForwardAndNotify:(BOOL)notify > [self executeEditCommandWithCallback:@"deleteForward"]; > } > >+- (void)_deleteToEndOfParagraph >+{ >+ [self executeEditCommandWithCallback:@"deleteToEndOfParagraph"]; >+} >+ >+- (void)_transpose >+{ >+ [self executeEditCommandWithCallback:@"transpose"]; >+} >+ > - (UITextInputArrowKeyHistory *)_moveUp:(BOOL)extending withHistory:(UITextInputArrowKeyHistory *)history > { > [self executeEditCommandWithCallback:extending ? @"moveUpAndModifySelection" : @"moveUp"]; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 67d1203113c64add6fa5cdc5ce18543fca842c4b..795898a0ae08483800e8c02db0ff2801af92b68e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,20 @@ >+2019-02-11 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph >+ https://bugs.webkit.org/show_bug.cgi?id=194505 >+ <rdar://problem/47743533> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add tests to ensure that Control + t and Control + k perform a transpose and delete to the >+ end of the line/paragraph. Skip the tests for now until we have the UIKit fix <rdar://problem/44928156>. >+ >+ * fast/events/ios/key-command-delete-to-end-of-paragraph-expected.txt: Added. >+ * fast/events/ios/key-command-delete-to-end-of-paragraph.html: Added. >+ * fast/events/ios/key-command-transpose-expected.txt: Added. >+ * fast/events/ios/key-command-transpose.html: Added. >+ * platform/ios/TestExpectations: Skip tests for now. >+ > 2019-02-06 Jonathan Bedard <jbedard@apple.com> > > [iPad] Initial test gardening (Part 2) >diff --git a/LayoutTests/fast/events/ios/key-command-delete-to-end-of-paragraph-expected.txt b/LayoutTests/fast/events/ios/key-command-delete-to-end-of-paragraph-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..97fa194ab4ec083b211aaefecd70aee9b093bbb5 >--- /dev/null >+++ b/LayoutTests/fast/events/ios/key-command-delete-to-end-of-paragraph-expected.txt >@@ -0,0 +1,12 @@ >+Tests that pressing Control + k in a content-editable field deletes to the end of the paragraph. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+To run this test by hand, place the text insertion point before the 'h' in the text below and press Control + k. >+ >+PASS document.getElementById("test").textContent is "a" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/events/ios/key-command-delete-to-end-of-paragraph.html b/LayoutTests/fast/events/ios/key-command-delete-to-end-of-paragraph.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fc679e80ccef82b2614f5005030b72d1e2548541 >--- /dev/null >+++ b/LayoutTests/fast/events/ios/key-command-delete-to-end-of-paragraph.html >@@ -0,0 +1,60 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta name="viewport" content="width=device-width"> >+<script src="../../../resources/js-test.js"></script> >+<script src="../../../resources/ui-helper.js"></script> >+<style> >+#test { >+ border: 1px solid black; >+ height: 500px; >+ width: 500px; >+} >+ >+.hidden { >+ display: none; >+} >+</style> >+</head> >+<body> >+<p id="description"></p> >+<p id="manual-instructions" class="hide">To run this test by hand, place the text insertion point before the 'h' in the text below and press Control + k.</p> >+<div id="console"></div> >+<div id="test" contenteditable="true">ah</div> >+<script> >+window.jsTestIsAsync = true; >+ >+let testElement = document.getElementById("test"); >+let mutationObserver = null; >+ >+function handleChildListModified() >+{ >+ mutationObserver.disconnect(); >+ shouldBeEqualToString('document.getElementById("test").textContent', "a"); >+ document.body.removeChild(testElement); >+ finishJSTest(); >+} >+ >+function runTest() >+{ >+ if (!window.testRunner) >+ document.getElementById("manual-instructions").classList.remove("hidden"); >+ >+ mutationObserver = new MutationObserver(handleChildListModified); >+ mutationObserver.observe(testElement, { subtree:true, characterData: true }); >+ >+ function handleFocus() { >+ window.getSelection().setBaseAndExtent(testElement.firstChild, 1, testElement.firstChild, 1); // Put caret before the 'h'. >+ if (window.testRunner) >+ UIHelper.keyDown("k", ["ctrlKey"]); >+ } >+ testElement.addEventListener("focus", handleFocus, { once: true }); >+ if (window.testRunner) >+ UIHelper.activateElement(testElement); >+} >+ >+description("Tests that pressing Control + k in a content-editable field deletes to the end of the paragraph."); >+runTest(); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/events/ios/key-command-transpose-expected.txt b/LayoutTests/fast/events/ios/key-command-transpose-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..92ceed00828e0ad6bae5ccfd585dabfb5eb788e2 >--- /dev/null >+++ b/LayoutTests/fast/events/ios/key-command-transpose-expected.txt >@@ -0,0 +1,12 @@ >+Tests that pressing Control + t in a content-editable field performs a tranpose. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+To run this test by hand, place the text insertion point before the 'h' in the text below and press Control + t. >+ >+PASS document.getElementById("test").textContent is "ha" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/events/ios/key-command-transpose.html b/LayoutTests/fast/events/ios/key-command-transpose.html >new file mode 100644 >index 0000000000000000000000000000000000000000..207931b92c4fb94d09e4c99eec592381f223089c >--- /dev/null >+++ b/LayoutTests/fast/events/ios/key-command-transpose.html >@@ -0,0 +1,60 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta name="viewport" content="width=device-width"> >+<script src="../../../resources/js-test.js"></script> >+<script src="../../../resources/ui-helper.js"></script> >+<style> >+#test { >+ border: 1px solid black; >+ height: 500px; >+ width: 500px; >+} >+ >+.hidden { >+ display: none; >+} >+</style> >+</head> >+<body> >+<p id="description"></p> >+<p id="manual-instructions" class="hide">To run this test by hand, place the text insertion point before the 'h' in the text below and press Control + t.</p> >+<div id="console"></div> >+<div id="test" contenteditable="true">ah</div> >+<script> >+window.jsTestIsAsync = true; >+ >+let testElement = document.getElementById("test"); >+let mutationObserver = null; >+ >+function handleChildListModified() >+{ >+ mutationObserver.disconnect(); >+ shouldBeEqualToString('document.getElementById("test").textContent', "ha"); >+ document.body.removeChild(testElement); >+ finishJSTest(); >+} >+ >+function runTest() >+{ >+ if (!window.testRunner) >+ document.getElementById("manual-instructions").classList.remove("hidden"); >+ >+ mutationObserver = new MutationObserver(handleChildListModified); >+ mutationObserver.observe(testElement, { subtree:true, characterData: true }); >+ >+ function handleFocus() { >+ window.getSelection().setBaseAndExtent(testElement.firstChild, 1, testElement.firstChild, 1); // Put caret before the 'h'. >+ if (window.testRunner) >+ UIHelper.keyDown("t", ["ctrlKey"]); >+ } >+ testElement.addEventListener("focus", handleFocus, { once: true }); >+ if (window.testRunner) >+ UIHelper.activateElement(testElement); >+} >+ >+description("Tests that pressing Control + t in a content-editable field performs a tranpose."); >+runTest(); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index f40161cca2c98c73d76e5260531e817037b32c5f..6b68564829b69ca37b4f201ee739f915614dbfb0 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -3210,3 +3210,7 @@ webkit.org/b/193955 compositing/iframes/remove-reinsert-webview-with-iframe.html > webkit.org/b/153337 pageoverlay/overlay-installation.html [ Pass Failure ] > webkit.org/b/153337 pageoverlay/overlay-large-document-scrolled.html [ Pass Failure ] > webkit.org/b/153337 pageoverlay/overlay-large-document.html [ Pass Failure ] >+ >+# FIXME: Unskip the following test once we have the fix for <rdar://problem/44928156>. >+fast/events/ios/key-command-delete-to-end-of-paragraph.html [ Skip ] >+fast/events/ios/key-command-transpose.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 194505
:
361694
|
361695