WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-127770-20140128114916.patch (text/plain), 5.75 KB, created by
Grzegorz Czajkowski
on 2014-01-28 02:49:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Grzegorz Czajkowski
Created:
2014-01-28 02:49:20 PST
Size:
5.75 KB
patch
obsolete
>Subversion Revision: 162922 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 52602b9880a44f398f9beae95f27d2281a0f64bc..409a2fa665f78a783a2a429e13d2fd7a8f1059bb 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,24 @@ >+2014-01-27 Grzegorz Czajkowski <g.czajkowski@samsung.com> >+ >+ Refactoring design-mode-spellcheck-off.html to use asynchronous spellchecking >+ https://bugs.webkit.org/show_bug.cgi?id=127770 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Enable asynchronous spellchecking in design-mode-spellcheck-off.html. >+ >+ Due to js-test-pre.js adds some HTML elements inside the BODY, the misspelled >+ phrase was moved into separated div element. It allows to check spelling marker >+ on desired element instead of whole body. >+ >+ It turned out that the test does not underline "asdf" as misspelled although >+ spellcheck attribute is on. To force spellchecking, the caret needs to be moved >+ out of the misspelled word. To be more reliable, the test now contains two test >+ cases in 'desingMode=on' when spellcheck attribute is off and on. >+ >+ * editing/spelling/design-mode-spellcheck-off-expected.txt: >+ * editing/spelling/design-mode-spellcheck-off.html: >+ > 2014-01-27 Brian Burg <bburg@apple.com> > > Web Inspector: clean up initialization of managers and observers in InspectorTest >diff --git a/LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt b/LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt >index aaa2a83a3574a237863d6fbc7d1572be60149672..4857950984319bb66887643338ca56ec1554812a 100644 >--- a/LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt >+++ b/LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt >@@ -1,4 +1,12 @@ >-asdf is misspelled. >-To test this manually, click "asdf" above. There should be no spelling marker for "asdf" after the click. >+This tests whether WebKit does not spell check in 'designMode' when spellcheck='false'. To test manually, click arround 'asdf'. There should be no spelling marker for 'asdf' after the click. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ > >-PASS >+PASS internals.hasSpellingMarker(0, 4) became false >+document.body.setAttribute("spellcheck", "true") >+PASS internals.hasSpellingMarker(0, 4) became different from false >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+asdf is misspelled. >diff --git a/LayoutTests/editing/spelling/design-mode-spellcheck-off.html b/LayoutTests/editing/spelling/design-mode-spellcheck-off.html >index fd8f8bbc175b53e6002a1bd2def2609d3276946b..6533f563d39a4a6ed43efd5fa789155d2bddca5e 100644 >--- a/LayoutTests/editing/spelling/design-mode-spellcheck-off.html >+++ b/LayoutTests/editing/spelling/design-mode-spellcheck-off.html >@@ -1,39 +1,51 @@ > <!DOCTYPE html> > <html> >-<body spellcheck="false"> >-asdf is misspelled. >-<p>To test this manually, click "asdf" above. There should be no spelling marker for "asdf" after the click.</p> >+<head> >+<script src="../editing.js"></script> >+</head> >+<body spellcheck="false"> >+<script src="../../resources/js-test-pre.js"></script> >+<div id="misspelled" onmouseup="checkSpellingMarker()">asdf is misspelled.</div> > <script> >+description("This tests whether WebKit does not spell check in 'designMode' " >+ + "when spellcheck='false'. To test manually, click arround 'asdf'. " >+ + "There should be no spelling marker for 'asdf' after the click."); > >-if (window.testRunner) >- testRunner.dumpAsText(); >+jsTestIsAsync = true; >+ >+if (window.internals) { >+ internals.settings.setUnifiedTextCheckerEnabled(true); >+ internals.settings.setAsynchronousSpellCheckingEnabled(true); >+} > > document.designMode = "on"; > >-if (document.activeElement != document.body) >- document.body.appendChild(document.createTextNode('FAIL: active element before click is not body element')); >-else if (window.testRunner && window.eventSender) { >- testRunner.waitUntilDone(); >+function checkSpellingMarker() >+{ >+ if (!window.internals) >+ return; > >- document.body.addEventListener('mousedown', function() { >- if (document.activeElement != document.body) >- document.body.appendChild(document.createTextNode('FAIL: active element after click is not body element')); >- else if (internals.hasSpellingMarker(0, 4)) >- document.body.appendChild(document.createTextNode('FAIL: spell check was invoked')); >- else >- document.body.appendChild(document.createTextNode('PASS')); >- testRunner.notifyDone(); >+ // First, verify spelling with spellcheck attribute off. >+ // Move selection to the next word to notify WebKit that "asdf" has been typed/changed >+ // to give a chance to spellcheck. >+ moveSelectionForwardByWordCommand(); >+ shouldBecomeEqual('internals.hasSpellingMarker(0, 4)', 'false', function() { >+ evalAndLog('document.body.setAttribute("spellcheck", "true")'); >+ // Do any selection change to force spellchecking after attribute change. >+ moveSelectionForwardByLineCommand(); >+ shouldBecomeDifferent('internals.hasSpellingMarker(0, 4)', 'false', finishJSTest); > }); >+} > >- var x = document.body.offsetLeft + 10; >- var y = document.body.offsetTop + 10; >+if (window.eventSender) { >+ var misspelledDiv = document.getElementById("misspelled"); >+ var x = misspelledDiv.offsetLeft; >+ var y = misspelledDiv.offsetTop; > eventSender.mouseMoveTo(x, y); > eventSender.mouseDown(); > eventSender.mouseUp(); >- setTimeout("testRunner.notifyDone();document.body.appendChild(document.createTextNode('FAIL: timeout'));", 500); >-} else >- document.body.appendChild(document.createTextNode('PASS')); >- >+} > </script> >+<script src="../../resources/js-test-post.js"></script> > </body> > </html>
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
Flags:
rniwa
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 127770
: 222426