| Index: third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html b/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
|
| index d63c5e52fd83f811bc749797874cc1f92df4921c..83bce2cc635616a942267aafca31747da7a1521d 100644
|
| --- a/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
|
| +++ b/third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html
|
| @@ -1,46 +1,38 @@
|
| <!DOCTYPE html>
|
| -<html>
|
| -<body spellcheck="false">
|
| -<script src="../editing.js"></script>
|
| -<script src="../../resources/js-test.js"></script>
|
| -<div id="misspelled" onmouseup="checkSpellingMarker()">asd is misspelled.</div>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../assert_selection.js"></script>
|
| +<script src="spellcheck_test.js"></script>
|
| <script>
|
| -description("This tests whether WebKit does not spell check in 'designMode' "
|
| - + "when spellcheck='false'. To test manually, click 'asd' and move cursor until '.'. "
|
| - + "There should be no spelling marker for 'asd'.");
|
| -
|
| -jsTestIsAsync = true;
|
| -if (window.testRunner)
|
| - testRunner.setMockSpellCheckerEnabled(true);
|
| -
|
| -document.designMode = "on";
|
| -
|
| -function checkSpellingMarker()
|
| -{
|
| - if (!window.internals)
|
| - return;
|
| -
|
| - // First, verify spelling with spellcheck attribute off.
|
| - // Move selection to the next word to notify WebKit that "asd" has been typed/changed
|
| - // to give a chance to spellcheck.
|
| - moveSelectionForwardByWordCommand();
|
| -
|
| - shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 3)', 'false', function() {
|
| - evalAndLog('document.body.setAttribute("spellcheck", "true")');
|
| - // Do any selection change to force spellchecking after attribute change.
|
| - moveSelectionForwardByLineCommand();
|
| - shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 3)', 'false', finishJSTest);
|
| +spellcheck_test(
|
| + [
|
| + '<div id="container" spellcheck="false">',
|
| + '<div>|asd is misspelled.</div>',
|
| + '</div>'
|
| + ].join(''),
|
| + document => {
|
| + document.designMode = 'on';
|
| + document.getSelection().modify('move', 'forward', 'word');
|
| + },
|
| + [
|
| + '<div id="container" spellcheck="false">',
|
| + '<div>asd is misspelled.</div>',
|
| + '</div>'
|
| + ].join(''),
|
| + {
|
| + title: 'No spelling marker in designMode when spellcheck=false.',
|
| + callback: sample => spellcheck_test(
|
| + sample,
|
| + document => {
|
| + document.getElementById('container').setAttribute('spellcheck', 'true');
|
| + // Do any selection change to force spellchecking after attribute change.
|
| + document.getSelection().modify('move', 'forward', 'line');
|
| + },
|
| + [
|
| + '<div id="container" spellcheck="true">',
|
| + '<div>_asd_ is misspelled.</div>',
|
| + '</div>'
|
| + ].join(''),
|
| + 'Spelling marker appears when changing spellcheck from false to true.')
|
| });
|
| -}
|
| -
|
| -if (window.eventSender) {
|
| - var misspelledDiv = document.getElementById("misspelled");
|
| - var x = misspelledDiv.offsetLeft;
|
| - var y = misspelledDiv.offsetTop;
|
| - eventSender.mouseMoveTo(x, y);
|
| - eventSender.mouseDown();
|
| - eventSender.mouseUp();
|
| -}
|
| -</script>
|
| -</body>
|
| -</html>
|
| +</script>
|
|
|