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-128174-20140204144820.patch (text/plain), 31.79 KB, created by
Grzegorz Czajkowski
on 2014-02-04 05:48:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Grzegorz Czajkowski
Created:
2014-02-04 05:48:22 PST
Size:
31.79 KB
patch
obsolete
>Subversion Revision: 163373 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6272a35c04692e617ab732d20136c6916bd823c2..2bdbf9d9e6343558a2fede18df0e64caf85fce3e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,28 @@ >+2014-02-04 Grzegorz Czajkowski <g.czajkowski@samsung.com> >+ >+ Verify spellcheck attribute asynchronously >+ https://bugs.webkit.org/show_bug.cgi?id=128174 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Refactoring spelling tests that verify spellcheck attribute to use >+ asynchronous text checking. >+ >+ * editing/spelling/spelling-attribute-at-child-expected.txt: >+ * editing/spelling/script-tests/spelling-attribute-at-child.js: >+ Do not use getElementById if more than one element has the same >+ id ('child'). Although we defined a bunch of elements with id >+ 'child', however only first one was retrieved and tested. >+ Additionally, dump current markup so that user is able to see >+ which element is being tested. >+ >+ * editing/spelling/spelling-attribute-change-expected.txt: >+ * editing/spelling/script-tests/spelling-attribute-change.js: >+ >+ * editing/spelling/spellcheck-attribute-expected.txt: >+ * editing/spelling/spellcheck-attribute.html: >+ Dump markup to increase readability of test expectation. >+ > 2014-02-04 Andrzej Badowski <a.badowski@samsung.com> > > [EFL] Add expectations for two flaky media layout tests >diff --git a/LayoutTests/editing/spelling/script-tests/spelling-attribute-at-child.js b/LayoutTests/editing/spelling/script-tests/spelling-attribute-at-child.js >index cbd2315d0bfa3defcf791c4a343dc8452dc286a1..49a6c9a0eef23004207c462620e66cf7ac1ad764 100644 >--- a/LayoutTests/editing/spelling/script-tests/spelling-attribute-at-child.js >+++ b/LayoutTests/editing/spelling/script-tests/spelling-attribute-at-child.js >@@ -1,29 +1,50 @@ > description('Tests if the spellchecker behavior change after the spellcheck attribute changed by the script.'); > >+jsTestIsAsync = true; >+ >+if (window.internals) { >+ internals.settings.setUnifiedTextCheckerEnabled(true); >+ internals.settings.setAsynchronousSpellCheckingEnabled(true); >+} >+ > var root = document.createElement("div"); > document.body.appendChild(root); > >-function childHasSpellingMarker(markup) >+function verifyChildSpellingMarker(markup, expectation) > { > root.innerHTML = markup; >- var text = document.getElementById("child").firstChild; >- document.getSelection().setPosition(text, 1); >+ var childText = root.firstChild.childNodes[1].firstChild; >+ document.getSelection().setPosition(childText, 1); // [^] > document.execCommand("InsertText", false, 'z'); > document.execCommand("InsertText", false, 'z'); > document.execCommand("InsertText", false, ' '); >- var marked = internals.hasSpellingMarker(1, 2); >- root.innerHTML = ""; >- return marked; >+ debug(escapeHTML(root.innerHTML)); >+ shouldBecomeEqual('internals.hasSpellingMarker(1, 2)', expectation ? "true" : "false", function() { >+ root.innerHTML = ""; >+ debug(""); >+ done(); >+ }); > } > >-shouldBeFalse("childHasSpellingMarker(\"<div contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>\")"); >-shouldBeTrue("childHasSpellingMarker(\"<div contentEditable>Foo <span id='child'>[]</span> Baz</div>\")"); >-shouldBeTrue("childHasSpellingMarker(\"<div contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>\")"); >-shouldBeFalse("childHasSpellingMarker(\"<div spellcheck='false' contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>\")"); >-shouldBeFalse("childHasSpellingMarker(\"<div spellcheck='false' contentEditable>Foo <span id='child'>[]</span> Baz</div>\")"); >-shouldBeTrue("childHasSpellingMarker(\"<div spellcheck='false' contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>\")"); >-shouldBeFalse("childHasSpellingMarker(\"<div spellcheck='true' contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>\")"); >-shouldBeTrue("childHasSpellingMarker(\"<div spellcheck='true' contentEditable>Foo <span id='child'>[]</span> Baz</div>\")"); >-shouldBeTrue("childHasSpellingMarker(\"<div spellcheck='true' contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>\")"); >+var tests = [ function() { verifyChildSpellingMarker("<div contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>", false); }, >+ function() { verifyChildSpellingMarker("<div contentEditable>Foo <span id='child'>[]</span> Baz</div>", true); }, >+ function() { verifyChildSpellingMarker("<div contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>", true); }, >+ function() { verifyChildSpellingMarker("<div spellcheck='false' contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>", false); }, >+ function() { verifyChildSpellingMarker("<div spellcheck='false' contentEditable>Foo <span id='child'>[]</span> Baz</div>", false); }, >+ function() { verifyChildSpellingMarker("<div spellcheck='false' contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>", true); }, >+ function() { verifyChildSpellingMarker("<div spellcheck='true' contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>", false); }, >+ function() { verifyChildSpellingMarker("<div spellcheck='true' contentEditable>Foo <span id='child'>[]</span> Baz</div>", true); }, >+ function() { verifyChildSpellingMarker("<div spellcheck='true' contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>", true); } >+]; >+ >+function done() >+{ >+ var next = tests.shift(); >+ if (next) >+ return window.setTimeout(next, 0); >+ >+ finishJSTest(); >+} >+done(); > > var successfullyParsed = true; >diff --git a/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js b/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js >index 6a0cdd50d3bf51c2f0c3163ae42e41c40c213240..475df6cadc8dd0c449ac810a1d4ae4a1bc40081b 100644 >--- a/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js >+++ b/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js >@@ -1,5 +1,12 @@ > description('Tests if the spellchecker behavior change after the spellcheck attribute changed by the script.'); > >+jsTestIsAsync = true; >+ >+if (window.internals) { >+ internals.settings.setUnifiedTextCheckerEnabled(true); >+ internals.settings.setAsynchronousSpellCheckingEnabled(true); >+} >+ > var parent = document.createElement("div"); > document.body.appendChild(parent); > var sel = document.getSelection(); >@@ -22,7 +29,7 @@ function testSpellCheckingEnabled(target, enabled) > > window.target = target; > shouldBe("target.spellcheck", enabled ? "true" : "false"); >- shouldBe("internals.hasSpellingMarker(6, 2)", enabled ? "true" : "false"); >+ shouldBecomeEqual("internals.hasSpellingMarker(6, 2)", enabled ? "true" : "false", done); > } > > function createElement(tagName, spellcheck) >@@ -41,46 +48,41 @@ function testFor(tagName, initialAttribute, expectation) > parent.appendChild(target); > > testSpellCheckingEnabled(target, expectation); >- parent.innerHTML = ""; > } > >-// default -> true >-testFor("SPAN", undefined, true); >-// default -> false >-testFor("SPAN", undefined, false); >-// true -> true >-testFor("SPAN", true, true); >-// true -> false >-testFor("SPAN", true, false); >-// false -> true >-testFor("SPAN", false, true); >-// false -> false >-testFor("SPAN", false, false); >- >-// default -> true >-testFor("INPUT", undefined, true); >-// default -> false >-testFor("INPUT", undefined, false); >-// true -> true >-testFor("INPUT", true, true); >-// true -> false >-testFor("INPUT", true, false); >-// false -> true >-testFor("INPUT", false, true); >-// false -> false >-testFor("INPUT", false, false); >- >-// default -> true >-testFor("TEXTAREA", undefined, true); >-// default -> false >-testFor("TEXTAREA", undefined, false); >-// true -> true >-testFor("TEXTAREA", true, true); >-// true -> false >-testFor("TEXTAREA", true, false); >-// false -> true >-testFor("TEXTAREA", false, true); >-// false -> false >-testFor("TEXTAREA", false, false); >+var tests = [ function() { testFor("SPAN", undefined, true); }, // default -> true >+ function() { testFor("SPAN", undefined, false); }, // default -> false >+ function() { testFor("SPAN", true, true); }, // true -> true >+ function() { testFor("SPAN", true, false); }, // true -> false >+ function() { testFor("SPAN", false, true); }, // false -> true >+ function() { testFor("SPAN", false, false); }, // false -> false >+ >+ function() { testFor("INPUT", undefined, true); }, // default -> true >+ function() { testFor("INPUT", undefined, false); }, // default -> false >+ function() { testFor("INPUT", true, true); }, // true -> true >+ function() { testFor("INPUT", true, false); }, // true -> false >+ function() { testFor("INPUT", false, true); }, // false -> true >+ function() { testFor("INPUT", false, false); }, // false -> false >+ >+ function() { testFor("TEXTAREA", undefined, true); }, // default -> true >+ function() { testFor("TEXTAREA", undefined, false); }, // default -> false >+ function() { testFor("TEXTAREA", true, true); }, // true -> true >+ function() { testFor("TEXTAREA", true, false); }, // true -> false >+ function() { testFor("TEXTAREA", false, true); }, // false -> true >+ function() { testFor("TEXTAREA", false, false); }, // false -> false >+ ]; >+ >+function done() >+{ >+ if (window.internals) { >+ var next = tests.shift(); >+ if (next) >+ return window.setTimeout(next, 0); >+ >+ parent.innerHTML = ""; >+ } >+ finishJSTest(); >+} >+done(); > > var successfullyParsed = true; >diff --git a/LayoutTests/editing/spelling/spellcheck-attribute-expected.txt b/LayoutTests/editing/spelling/spellcheck-attribute-expected.txt >index 3e1506d138b907b6c1729e6cd04d8a685bc08472..7bac9622c0d986515eec8b6f0bcebed91be72261 100644 >--- a/LayoutTests/editing/spelling/spellcheck-attribute-expected.txt >+++ b/LayoutTests/editing/spelling/spellcheck-attribute-expected.txt >@@ -1,56 +1,60 @@ >-This tests if the "spellcheck" attribute is implemented as written in its specification. If this test succeeds, you can see forms filled with an invalid word 'zz '. Nevertheless, the 'zz ' is not marked as misspelled in all of them. >- >-id=test1_1 type=text spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test1_2 type=text spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test1_3 type=text spellcheck=false parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test1_4 type=text spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test1_5 type=text spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test1_6 type=text spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >- >-id=test2_1 type=text spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test2_2 type=text spellcheck=true parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test2_3 type=text spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test2_4 type=text spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test2_5 type=text spellcheck=true parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test2_6 type=text spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >- >-id=test3_1 type=search spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test3_2 type=search spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test3_3 type=search spellcheck=false parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test3_4 type=search spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test3_5 type=search spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test3_6 type=search spellcheck=true parent's spellcheck=true >-PASS internals.hasSpellingMarker(0, 2) is true >- >-id=test4_1 type=search spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test4_2 type=search spellcheck=true parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test4_3 type=search spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test4_4 type=search spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >-id=test4_5 type=search spellcheck=true parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is true >-id=test4_6 type=search spellcheck=false parent's spellcheck=false >-PASS internals.hasSpellingMarker(0, 2) is false >+This tests if the "spellcheck" attribute is implemented as written in its specification. If this test succeeds, you can see forms filled with an invalid word "zz". Nevertheless, the "zz" is not marked as misspelled in all of them. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+<DIV id=div1 spellcheck=true> >+<INPUT id=test1_1 type=text>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test1_2 type=text spellcheck=true>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test1_3 type=text spellcheck=false>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test1_4 type=text spellcheck=InvalidValue>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test1_5 type=text spellcheck>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+</DIV> >+ >+<DIV id=div2 spellcheck=false> >+<INPUT id=test2_1 type=text>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test2_2 type=text spellcheck=true>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test2_3 type=text spellcheck=false>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test2_4 type=text spellcheck=InvalidValue>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test2_5 type=text spellcheck>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+</DIV> >+ >+<DIV id=div3 spellcheck=true> >+<INPUT id=test3_1 type=search>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test3_2 type=search spellcheck=true>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test3_3 type=search spellcheck=false>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test3_4 type=search spellcheck=InvalidValue>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test3_5 type=search spellcheck>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+</DIV> >+ >+<DIV id=div4 spellcheck=false> >+<INPUT id=test4_1 type=search>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test4_2 type=search spellcheck=true>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+<INPUT id=test4_3 type=search spellcheck=false>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test4_4 type=search spellcheck=InvalidValue>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became false >+<INPUT id=test4_5 type=search spellcheck>zz </INPUT> >+PASS internals.hasSpellingMarker(0, 2) became true >+</DIV> >+ > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/editing/spelling/spellcheck-attribute.html b/LayoutTests/editing/spelling/spellcheck-attribute.html >index da49073916cf2644f559547ab64e70f498eff900..f5b652942f5bb0738cf8a09314434037ce9d7e7e 100644 >--- a/LayoutTests/editing/spelling/spellcheck-attribute.html >+++ b/LayoutTests/editing/spelling/spellcheck-attribute.html >@@ -2,101 +2,151 @@ > <head> > <title>Spellcheck Attribute Test</title> > <link rel="help" href="http://damowmow.com/playground/spellcheck.txt"> >+<script src="../editing.js"></script> >+<script src="resources/util.js"></script> > <script src="../../resources/js-test-pre.js"></script> > </head> > <body> >-<p>This tests if the "spellcheck" attribute is implemented as written in its specification. If this test succeeds, you can see forms filled with an invalid word 'zz '. Nevertheless, the 'zz ' is not marked as misspelled in all of them. > <div id="testRoot"> >- >-<div spellcheck="true"> >-<label>1.1.</label><input id="test1_1" type="text"></input><br/> >-<label>1.2.</label><input id="test1_2" type="text" spellcheck="true"></input><br/> >-<label>1.3.</label><input id="test1_3" type="text" spellcheck="false"></input><br/> >-<label>1.4.</label><input id="test1_4" type="text" spellcheck="InvalidValue"></input><br/> >-<label>1.5.</label><input id="test1_5" type="text" spellcheck></input><br/> >-<label>1.6.</label><input id="test1_6" type="text"></input><br/> >-</div> >-<div spellcheck="false"> >-<label>2.1.</label><input id="test2_1" type="text"></input><br/> >-<label>2.2.</label><input id="test2_2" type="text" spellcheck="true"></input><br/> >-<label>2.3.</label><input id="test2_3" type="text" spellcheck="false"></input><br/> >-<label>2.4.</label><input id="test2_4" type="text" spellcheck="InvalidValue"></input><br/> >-<label>2.5.</label><input id="test2_5" type="text" spellcheck></input><br/> >-<label>2.6.</label><input id="test2_6" type="text"></input><br/> >+<div id="div1" spellcheck="true"></div> >+<div id="div2" spellcheck="false"></div> >+<div id="div3" spellcheck="true"></div> >+<div id="div4" spellcheck="false"></div> > </div> >+<script> >+description('This tests if the "spellcheck" attribute is implemented ' >+ + 'as written in its specification. If this test succeeds, you can see ' >+ + 'forms filled with an invalid word "zz". Nevertheless, the "zz" is not ' >+ + 'marked as misspelled in all of them.'); > >-<div spellcheck="true"> >-<label>3.1.</label><input id="test3_1" type="search"></input><br/> >-<label>3.2.</label><input id="test3_2" type="search" spellcheck="true"></input><br/> >-<label>3.3.</label><input id="test3_3" type="search" spellcheck="false"></input><br/> >-<label>3.4.</label><input id="test3_4" type="search" spellcheck="InvalidValue"></input><br/> >-<label>3.5.</label><input id="test3_5" type="search" spellcheck></input><br/> >-<label>3.6.</label><input id="test3_6" type="search"></input><br/> >-</div> >-<div spellcheck="false"> >-<label>4.1.</label><input id="test4_1" type="search"></input><br/> >-<label>4.2.</label><input id="test4_2" type="search" spellcheck="true"></input><br/> >-<label>4.3.</label><input id="test4_3" type="search" spellcheck="false"></input><br/> >-<label>4.4.</label><input id="test4_4" type="search" spellcheck="InvalidValue"></input><br/> >-<label>4.5.</label><input id="test4_5" type="search" spellcheck></input><br/> >-<label>4.6.</label><input id="test4_6" type="search"></input><br/> >-</div> >+jsTestIsAsync = true; > >-</div> >-<pre id="console"></pre> >-<script> >-function log(msg) { >- document.getElementById("console").innerHTML += (msg + "\n"); >+if (window.internals) { >+ internals.settings.setUnifiedTextCheckerEnabled(true); >+ internals.settings.setAsynchronousSpellCheckingEnabled(true); > } > >-function testMarkerForMisspelledWord(id, shouldBeMarked) { >- var inputElement = document.getElementById(id); >- inputElement.focus(); >- document.execCommand("InsertText", false, 'z'); >- document.execCommand("InsertText", false, 'z'); >- document.execCommand("InsertText", false, ' '); >+function addInputElement(parentId, id, type, spellcheck) >+{ >+ var input = document.createElement('input'); >+ input.setAttribute('type', type); >+ input.setAttribute('id', id); >+ input.setAttribute('value', 'zz '); >+ if (spellcheck !== undefined) >+ input.setAttribute('spellcheck', spellcheck); > >- log("id=" + id + " type=" + inputElement.type + " spellcheck=" + inputElement.spellcheck >- + " parent's spellcheck=" + inputElement.parentNode.spellcheck); >+ var div = document.getElementById(parentId); >+ div.appendChild(document.createTextNode(id)); >+ div.appendChild(input); >+ div.appendChild(document.createElement('br')); > >- shouldBe("internals.hasSpellingMarker(0, 2)", shouldBeMarked ? "true" : "false") >+ return input; > } > >-// For type="text". >-testMarkerForMisspelledWord('test1_1', true); >-testMarkerForMisspelledWord('test1_2', true); >-testMarkerForMisspelledWord('test1_3', false); >-testMarkerForMisspelledWord('test1_4', true); >-testMarkerForMisspelledWord('test1_5', true); >-testMarkerForMisspelledWord('test1_6', true); >-log(""); >-testMarkerForMisspelledWord('test2_1', false); >-testMarkerForMisspelledWord('test2_2', true); >-testMarkerForMisspelledWord('test2_3', false); >-testMarkerForMisspelledWord('test2_4', false); >-testMarkerForMisspelledWord('test2_5', true); >-testMarkerForMisspelledWord('test2_6', false); >-log(""); >- >-// For type="search". >-testMarkerForMisspelledWord('test3_1', true); >-testMarkerForMisspelledWord('test3_2', true); >-testMarkerForMisspelledWord('test3_3', false); >-testMarkerForMisspelledWord('test3_4', true); >-testMarkerForMisspelledWord('test3_5', true); >-testMarkerForMisspelledWord('test3_6', true); >-log(""); >-testMarkerForMisspelledWord('test4_1', false); >-testMarkerForMisspelledWord('test4_2', true); >-testMarkerForMisspelledWord('test4_3', false); >-testMarkerForMisspelledWord('test4_4', false); >-testMarkerForMisspelledWord('test4_5', true); >-testMarkerForMisspelledWord('test4_6', false); >- >-if (window.testRunner) { >- // Cleaning up for expeation text if running on DRT. >- document.getElementById("testRoot").style.display = "none"; >+function testMarkerForMisspelledWord(parentId, shouldBeMisspelled, id, type, spellcheck) >+{ >+ var input = addInputElement(parentId, id, type, spellcheck); >+ input.focus(); >+ // Activate spellchecking. >+ moveSelectionForwardByWordCommand(); >+ >+ logMarkup(id, spellcheck, true); >+ >+ if (window.internals) >+ shouldBecomeEqual('internals.hasSpellingMarker(0, 2)', shouldBeMisspelled ? 'true' : 'false', done); >+ else >+ done(); >+} >+ >+function logMarkup(id, spellcheckValue, shouldCloseTag) >+{ >+ var element = document.getElementById(id); >+ var elementMarkup = '<' + element.tagName; >+ elementMarkup += ' id=' + element.id; >+ >+ if (element.type) >+ elementMarkup += ' type=' + element.type; >+ >+ var spellcheckAttrString = ''; >+ if (spellcheckValue !== undefined) { >+ if (spellcheckValue != '') >+ spellcheckAttrString = ' spellcheck=' + spellcheckValue; >+ else >+ spellcheckAttrString = ' spellcheck'; >+ } >+ elementMarkup += spellcheckAttrString; >+ elementMarkup += '>'; >+ >+ if (element.value) >+ elementMarkup += element.value; >+ >+ if (shouldCloseTag) >+ elementMarkup += '</' + element.tagName + '>'; >+ >+ debug(elementMarkup); >+} >+ >+function encloseTag(id) >+{ >+ var element = document.getElementById(id); >+ logMarkup(id, element.spellcheck ? "true" : "false", false); >+ done(); >+} >+ >+function closeTag(id) >+{ >+ var element = document.getElementById(id); >+ debug('</' + element.tagName + '>' + '\n'); >+ done(); >+} >+ >+var tests = [ >+ function() { encloseTag('div1'); }, >+ function() { testMarkerForMisspelledWord('div1', true, 'test1_1', 'text' /*, undefined */); }, >+ function() { testMarkerForMisspelledWord('div1', true, 'test1_2', 'text', 'true'); }, >+ function() { testMarkerForMisspelledWord('div1', false, 'test1_3', 'text', 'false'); }, >+ function() { testMarkerForMisspelledWord('div1', true, 'test1_4', 'text', 'InvalidValue'); }, >+ function() { testMarkerForMisspelledWord('div1', true, 'test1_5', 'text', ''); }, >+ function() { closeTag('div1'); }, >+ >+ function() { encloseTag('div2'); }, >+ function() { testMarkerForMisspelledWord('div2', false, 'test2_1', 'text' /*, undefined */); }, >+ function() { testMarkerForMisspelledWord('div2', true, 'test2_2', 'text', 'true'); }, >+ function() { testMarkerForMisspelledWord('div2', false, 'test2_3', 'text', 'false'); }, >+ function() { testMarkerForMisspelledWord('div2', false, 'test2_4', 'text', 'InvalidValue'); }, >+ function() { testMarkerForMisspelledWord('div2', true, 'test2_5', 'text', ''); }, >+ function() { closeTag('div2'); }, >+ >+ function() { encloseTag('div3'); }, >+ function() { testMarkerForMisspelledWord('div3', true, 'test3_1', 'search' /*, undefined */); }, >+ function() { testMarkerForMisspelledWord('div3', true, 'test3_2', 'search', 'true'); }, >+ function() { testMarkerForMisspelledWord('div3', false, 'test3_3', 'search', 'false'); }, >+ function() { testMarkerForMisspelledWord('div3', true, 'test3_4', 'search', 'InvalidValue'); }, >+ function() { testMarkerForMisspelledWord('div3', true, 'test3_5', 'search', ''); }, >+ function() { closeTag('div3'); }, >+ >+ function() { encloseTag('div4'); }, >+ function() { testMarkerForMisspelledWord('div4', false, 'test4_1', 'search' /*, undefined */); }, >+ function() { testMarkerForMisspelledWord('div4', true, 'test4_2', 'search', 'true'); }, >+ function() { testMarkerForMisspelledWord('div4', false, 'test4_3', 'search', 'false'); }, >+ function() { testMarkerForMisspelledWord('div4', false, 'test4_4', 'search', 'InvalidValue'); }, >+ function() { testMarkerForMisspelledWord('div4', true, 'test4_5', 'search', ''); }, >+ function() { closeTag('div4'); } >+]; >+ >+function done() >+{ >+ var next = tests.shift(); >+ if (next) >+ return window.setTimeout(next, 0); >+ >+ if (window.testRunner) { >+ // Cleaning up for expectation text if running on DRT. >+ document.getElementById("testRoot").style.display = "none"; >+ } >+ finishJSTest(); > } >+done(); > </script> > <script src="../../resources/js-test-post.js"></script> > </body> >diff --git a/LayoutTests/editing/spelling/spelling-attribute-at-child-expected.txt b/LayoutTests/editing/spelling/spelling-attribute-at-child-expected.txt >index 54b4ef8ba3feca26c08faf1282d8eba3d368740d..4e13c50416dab00690203e449acf7c9363853485 100644 >--- a/LayoutTests/editing/spelling/spelling-attribute-at-child-expected.txt >+++ b/LayoutTests/editing/spelling/spelling-attribute-at-child-expected.txt >@@ -3,15 +3,33 @@ Tests if the spellchecker behavior change after the spellcheck attribute changed > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS childHasSpellingMarker("<div contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>") is false >-PASS childHasSpellingMarker("<div contentEditable>Foo <span id='child'>[]</span> Baz</div>") is true >-PASS childHasSpellingMarker("<div contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>") is true >-PASS childHasSpellingMarker("<div spellcheck='false' contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>") is false >-PASS childHasSpellingMarker("<div spellcheck='false' contentEditable>Foo <span id='child'>[]</span> Baz</div>") is false >-PASS childHasSpellingMarker("<div spellcheck='false' contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>") is true >-PASS childHasSpellingMarker("<div spellcheck='true' contentEditable>Foo <span spellcheck='false' id='child'>[]</span> Baz</div>") is false >-PASS childHasSpellingMarker("<div spellcheck='true' contentEditable>Foo <span id='child'>[]</span> Baz</div>") is true >-PASS childHasSpellingMarker("<div spellcheck='true' contentEditable>Foo <span spellcheck='true' id='child'>[]</span> Baz</div>") is true >+<div contenteditable="">Foo <span spellcheck="false" id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became false >+ >+<div contenteditable="">Foo <span id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became true >+ >+<div contenteditable="">Foo <span spellcheck="true" id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became true >+ >+<div spellcheck="false" contenteditable="">Foo <span spellcheck="false" id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became false >+ >+<div spellcheck="false" contenteditable="">Foo <span id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became false >+ >+<div spellcheck="false" contenteditable="">Foo <span spellcheck="true" id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became true >+ >+<div spellcheck="true" contenteditable="">Foo <span spellcheck="false" id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became false >+ >+<div spellcheck="true" contenteditable="">Foo <span id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became true >+ >+<div spellcheck="true" contenteditable="">Foo <span spellcheck="true" id="child">[zz ]</span> Baz</div> >+PASS internals.hasSpellingMarker(1, 2) became true >+ > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/editing/spelling/spelling-attribute-change-expected.txt b/LayoutTests/editing/spelling/spelling-attribute-change-expected.txt >index 79ce257bb01bbcb8af552f4e01ff07582b91dbfd..5963f89181f541be3edd5690fb11a90b19c35ed4 100644 >--- a/LayoutTests/editing/spelling/spelling-attribute-change-expected.txt >+++ b/LayoutTests/editing/spelling/spelling-attribute-change-expected.txt >@@ -4,41 +4,41 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS target.spellcheck is true >-PASS internals.hasSpellingMarker(6, 2) is true >+PASS internals.hasSpellingMarker(6, 2) became true > PASS target.spellcheck is false >-PASS internals.hasSpellingMarker(6, 2) is false >+PASS internals.hasSpellingMarker(6, 2) became false > PASS successfullyParsed is true > > TEST COMPLETE
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 128174
: 223104