Skip to content

Commit

Permalink
[Live Range Selection] editing/mac/pasteboard/paste-and-match-style-s…
Browse files Browse the repository at this point in the history
…elector-event.html fails

https://bugs.webkit.org/show_bug.cgi?id=248672

Reviewed by Darin Adler.

Fix the test to use correct offset and also updated the test to work in WebKit2.

* LayoutTests/editing/mac/pasteboard/paste-and-match-style-selector-event-expected.txt:
* LayoutTests/editing/mac/pasteboard/paste-and-match-style-selector-event.html:
* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/257329@main
  • Loading branch information
rniwa committed Dec 3, 2022
1 parent 8dfe17d commit f95f47e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
@@ -1,2 +1,3 @@
This tests that sending the pasteAsPlainText selector, which is what happens when you paste and match style, fires the onpaste event.
This tests pasting as plain text, which is what happens when you paste and match style, fires the onpaste event.
To manually test, select & cut "FAILURE" below and "paste and match style" from menu.
SUCCESS
Expand Up @@ -8,21 +8,20 @@
testRunner.dumpAsText();

var result = document.getElementById("result");
window.getSelection().setBaseAndExtent(result, 0, result, 7);
window.getSelection().setBaseAndExtent(result, 0, result, 1);
document.execCommand("Cut");
if (window.textInputController) {
textInputController.doCommand("pasteAsPlainText:");
if (onPasteEventFired)
result.innerText = "SUCCESS";
}
if (window.testRunner)
testRunner.execCommand('PasteAsPlainText');
}
function onpastehandler(event) {
onPasteEventFired = true;
event.preventDefault();
result.innerText = 'SUCCESS';
}
</script>
</head>
<body onload="test()" onpaste="onpastehandler(event)" contenteditable>
This tests that sending the pasteAsPlainText selector, which is what happens when you paste and match style, fires the onpaste event.
This tests pasting as plain text, which is what happens when you paste and match style, fires the onpaste event.<br>
To manually test, select & cut "FAILURE" below and "paste and match style" from menu.
<div id="result">FAILURE</div>
</body>
</html>
1 change: 0 additions & 1 deletion LayoutTests/platform/mac-wk2/TestExpectations
Expand Up @@ -654,7 +654,6 @@ editing/mac/input/text-input-controller.html
editing/mac/input/text-input-controller-no-editable-no-crash.html
editing/mac/input/wrapped-line-char-rect.html
editing/mac/input/NSBackgroundColor-transparent.html
editing/mac/pasteboard/paste-and-match-style-selector-event.html
editing/mac/selection/25228.html

# WebKitTestRunner needs testRunner.setCallCloseOnWebViews
Expand Down

0 comments on commit f95f47e

Please sign in to comment.