WebKit Bugzilla
Attachment 342011 Details for
Bug 185584
: [macOS] Spelling errors in the middle of an inserted paragraph are not displayed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-185584-20180605180527.patch (text/plain), 25.96 KB, created by
Wenson Hsieh
on 2018-06-05 18:05:28 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-06-05 18:05:28 PDT
Size:
25.96 KB
patch
obsolete
>Subversion Revision: 232519 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c646d1378533d4d0a54030b3fa02a7664ad610e6..137f11aa6f605e668d1890cf0a4ec50a2470e3f1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2018-06-05 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [macOS] Spelling errors in the middle of an inserted paragraph are not displayed >+ https://bugs.webkit.org/show_bug.cgi?id=185584 >+ <rdar://problem/38676081> >+ >+ Reviewed by Ryosuke Niwa. >+ >+ Currently when typing, we only consider the range of adjacent words when determining where to place spelling >+ correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back >+ results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that >+ include correctly spelled words that are misused in the context of the sentence. This means that while typing a >+ sentence, a different part of the sentence may gain or lose spelling markers as a result. >+ >+ To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever >+ a full word is typed (since the context of other words within the sentence may have changed, resulting in >+ different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking >+ range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the >+ start of the typed word, and does not include any position that is under an element with `spellcheck=false`. >+ >+ This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is >+ disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't >+ handle the case where an element with spellchecking disabled lies between a sentence retro correction range and >+ the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of >+ non-contiguous spelling correction ranges â see the FIXME in markMisspellingsAfterTypingToWord for more detail. >+ >+ Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing. >+ >+ Tests: editing/spelling/retro-correction-spelling-markers.html >+ editing/spelling/spelling-markers-after-pasting-sentence.html >+ >+ * editing/Editor.cpp: >+ (WebCore::Editor::markMisspellingsAfterTypingToWord): >+ * testing/Internals.h: >+ * testing/Internals.idl: >+ >+ Add an internal testing helper to determine whether retro sentence corrections are enabled. >+ > 2018-06-05 Darin Adler <darin@apple.com> > > [Cocoa] Improve some soft linking compatibility with ARC >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 171d8770397ea7188b3817493f0281e47c80f943..8002e2bff04b1e9f481350e732306b569c5945b7 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -2371,12 +2371,59 @@ void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, > if (isGrammarCheckingEnabled()) > textCheckingOptions |= TextCheckingTypeGrammar; > >- VisibleSelection adjacentWords = VisibleSelection(startOfWord(wordStart, LeftWordIfOnBoundary), endOfWord(wordStart, RightWordIfOnBoundary)); >- if (textCheckingOptions & TextCheckingTypeGrammar) { >- VisibleSelection selectedSentence = VisibleSelection(startOfSentence(wordStart), endOfSentence(wordStart)); >- markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, adjacentWords.toNormalizedRange().get(), selectedSentence.toNormalizedRange().get()); >- } else >- markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, adjacentWords.toNormalizedRange().get(), adjacentWords.toNormalizedRange().get()); >+ auto sentenceStart = startOfSentence(wordStart); >+ auto sentenceEnd = endOfSentence(wordStart); >+ VisibleSelection fullSentence(sentenceStart, sentenceEnd); >+ auto fullSentenceRange = fullSentence.toNormalizedRange(); >+ if (!fullSentenceRange) >+ return; >+ >+ auto spellCheckingStart = wordStart; >+ auto spellCheckingEnd = wordStart; >+ >+ // FIXME: The following logic doesn't handle adding spelling markers due to retro sentence corrections when an >+ // incorrectly spelled range is separated from the start of the current word by a text node inside an element >+ // with spellcheck disabled. To fix this, we need to refactor markAllMisspellingsAndBadGrammarInRanges so that >+ // it can handle a list of spelling ranges, alongside the grammar range. >+ while (sentenceStart < spellCheckingStart) { >+ auto previousPosition = spellCheckingStart.previous(CannotCrossEditingBoundary); >+ if (previousPosition.isNull() || previousPosition == spellCheckingStart) >+ break; >+ >+ auto* container = previousPosition.deepEquivalent().downstream().containerNode(); >+ if (auto* containerElement = is<Element>(container) ? downcast<Element>(container) : container->parentElement()) { >+ if (!containerElement->isSpellCheckingEnabled()) >+ break; >+ } >+ >+ spellCheckingStart = previousPosition; >+ } >+ >+ while (spellCheckingEnd < sentenceEnd) { >+ auto nextPosition = spellCheckingEnd.next(CannotCrossEditingBoundary); >+ if (nextPosition.isNull() || nextPosition == spellCheckingEnd) >+ break; >+ >+ auto* container = nextPosition.deepEquivalent().upstream().containerNode(); >+ if (auto* containerElement = is<Element>(container) ? downcast<Element>(container) : container->parentElement()) { >+ if (!containerElement->isSpellCheckingEnabled()) >+ break; >+ } >+ >+ spellCheckingEnd = nextPosition; >+ } >+ >+ auto spellCheckingRange = VisibleSelection(spellCheckingStart, spellCheckingEnd).toNormalizedRange(); >+ if (!spellCheckingRange) >+ return; >+ >+ // The spelling and grammar markers in these ranges are recomputed. This is because typing a word may >+ // cause any other part of the current sentence to lose or gain spelling correction markers, due to >+ // sentence retro correction. As such, we expand the spell checking range to encompass as much of the >+ // full sentence as we can, respecting boundaries where spellchecking is disabled. >+ fullSentenceRange->ownerDocument().markers().removeMarkers(fullSentenceRange.get(), DocumentMarker::Grammar); >+ spellCheckingRange->ownerDocument().markers().removeMarkers(spellCheckingRange.get(), DocumentMarker::Spelling); >+ markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, spellCheckingRange.get(), fullSentenceRange.get()); > return; > } > >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index d059108f06807ab9278b37d32241b74cc9c185a0..93a7463464e0e99dceb801ce55ffd10d7e8a7a6e 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -286,6 +286,14 @@ public: > > void updateEditorUINowIfScheduled(); > >+ bool sentenceRetroCorrectionEnabled() const >+ { >+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ return true; >+#else >+ return false; >+#endif >+ } > bool hasSpellingMarker(int from, int length); > bool hasGrammarMarker(int from, int length); > bool hasAutocorrectedMarker(int from, int length); >diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl >index 54091ad003fc1b71675342d56131ba6bcd989ad5..4073a04820df567b9f63dcfd2cfe24ece958ceac 100644 >--- a/Source/WebCore/testing/Internals.idl >+++ b/Source/WebCore/testing/Internals.idl >@@ -258,6 +258,7 @@ enum EventThrottlingBehavior { > > void updateEditorUINowIfScheduled(); > >+ readonly attribute boolean sentenceRetroCorrectionEnabled; > boolean hasSpellingMarker(long from, long length); > boolean hasGrammarMarker(long from, long length); > boolean hasAutocorrectedMarker(long from, long length); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 045e54ff10e0a331f7bd42a1d92b0868d4f3a6bd..a7a0967bdb5c7663abbcab972ebd9edbeb45b699 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,40 @@ >+2018-06-05 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [macOS] Spelling errors in the middle of an inserted paragraph are not displayed >+ https://bugs.webkit.org/show_bug.cgi?id=185584 >+ <rdar://problem/38676081> >+ >+ Reviewed by Ryosuke Niwa. >+ >+ Adds 2 new spellchecking tests, and refactors some existing tests. >+ >+ * editing/spelling/grammar-expected.txt: >+ * editing/spelling/grammar.html: >+ * editing/spelling/markers-expected.txt: >+ * editing/spelling/markers.html: >+ >+ Tweaked so that these tests pass regardless of whether sentence retro correction is enabled or disabled. >+ >+ * editing/spelling/retro-correction-spelling-markers-expected.txt: Added. >+ * editing/spelling/retro-correction-spelling-markers.html: Added. >+ >+ Tests that typing at the end of a sentence will mark other parts of the sentence as misspellings, if retro >+ sentence correction is enabled. >+ >+ * editing/spelling/spelling-changed-text-expected.txt: >+ * editing/spelling/spelling-changed-text.html: >+ >+ Tweaked to correctly wait for the marker range to become the expected value. >+ >+ * editing/spelling/spelling-markers-after-pasting-sentence-expected.txt: Added. >+ * editing/spelling/spelling-markers-after-pasting-sentence.html: Added. >+ >+ Tests that after pasting a sentence with misspelled words, those misspelled words will be marked as misspellings. >+ >+ * platform/ios/TestExpectations: >+ * platform/mac-wk1/TestExpectations: >+ * platform/mac-wk2/TestExpectations: >+ > 2018-06-05 Youenn Fablet <youenn@apple.com> > > ServiceWorker registration should store any script fetched through importScripts >diff --git a/LayoutTests/editing/spelling/grammar-expected.txt b/LayoutTests/editing/spelling/grammar-expected.txt >index 45ac72175fd6ea4cb8cb66fa86a58bb6c3854d71..fdbb73d512f7e502f1bf96966525e7f37b6105d0 100644 >--- a/LayoutTests/editing/spelling/grammar-expected.txt >+++ b/LayoutTests/editing/spelling/grammar-expected.txt >@@ -3,7 +3,7 @@ This tests whether the grammatically-incorrect phrase 'I have a issue' has gramm > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS internals.hasGrammarMarker(7, 1) became true >+PASS hasExpectedSpellingOrGrammarMarkerInRange(7, 1) became true > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/editing/spelling/grammar.html b/LayoutTests/editing/spelling/grammar.html >index f583b6b2985b9cb1d24d1f14cac70016ea38fa51..923e41fbd7b63f68119106cdfb7768e96d885765 100644 >--- a/LayoutTests/editing/spelling/grammar.html >+++ b/LayoutTests/editing/spelling/grammar.html >@@ -11,12 +11,18 @@ > <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> > > <script> >+function hasExpectedSpellingOrGrammarMarkerInRange(from, length) { >+ if (internals.sentenceRetroCorrectionEnabled) >+ return internals.hasSpellingMarker(from, length); >+ return internals.hasGrammarMarker(from, length); >+} >+ > function editingTest() { > document.getElementById("root").focus(); > document.execCommand("InsertText", false, "I have a issue."); > > if (window.internals) { >- shouldBecomeEqual('internals.hasGrammarMarker(7, 1)', 'true', function() { >+ shouldBecomeEqual('hasExpectedSpellingOrGrammarMarkerInRange(7, 1)', 'true', function() { > document.getElementById("root").style.display = "none"; > finishJSTest(); > }); >diff --git a/LayoutTests/editing/spelling/markers-expected.txt b/LayoutTests/editing/spelling/markers-expected.txt >index c1bc16ae0f4f3a0f5609a52a680a184aed53f87d..791c9de8125a20a71721212b77f207f3c462d4e0 100644 >--- a/LayoutTests/editing/spelling/markers-expected.txt >+++ b/LayoutTests/editing/spelling/markers-expected.txt >@@ -3,26 +3,26 @@ Tests spelling and grammar markers for misspellings. > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-Checking grammar issue on 'I have a issue.' >+Checking for issue on 'I have a issue.' > PASS internals.markerRangeForNode(element.firstChild, nextMisspellingData.marker, 0) became different from null > PASS range.toString() is "a" > >-Checking spelling issue on 'zz.' >+Checking for issue on 'zz.' > PASS internals.markerRangeForNode(element.firstChild, nextMisspellingData.marker, 0) became different from null > PASS range.toString() is "zz" > >-Checking spelling issue on 'orange,zz,apple.' >+Checking for issue on 'orange,zz,apple.' > PASS internals.markerRangeForNode(element.firstChild, nextMisspellingData.marker, 0) became different from null >-PASS range.toString() is "zz" >+PASS range.toString() is "orange,zz,apple." > >-Checking grammar issue on 'orange,zz,apple.' >+Checking for issue on 'orange,zz,apple.' > PASS internals.markerRangeForNode(element.firstChild, nextMisspellingData.marker, 0) became different from null >-PASS range.toString() is "orange,zz,apple." >+PASS range.toString() is "orange,zz,apple" > >-Checking spelling issue on 'I have a issue.' >+Checking for no other issues on 'I have a issue.' > PASS internals.markerCountForNode(element.firstChild, oppositeMarker) became 0 > >-Checking grammar issue on 'zz.' >+Checking for no other issues on 'zz.' > PASS internals.markerCountForNode(element.firstChild, oppositeMarker) became 0 > > PASS successfullyParsed is true >diff --git a/LayoutTests/editing/spelling/markers.html b/LayoutTests/editing/spelling/markers.html >index 0a77d6f1fee0a26e5c3673df84dd04d6942d5050..94b5cb7989c96f3b367d639350f74f7d17e7e3ec 100644 >--- a/LayoutTests/editing/spelling/markers.html >+++ b/LayoutTests/editing/spelling/markers.html >@@ -52,15 +52,16 @@ var elementWithGrammarAndSpellingIssue = createEditableElement(container); > typeText(elementWithGrammarAndSpellingIssue, 'orange,zz,apple.'); > > var misspellings = [ >- { marker:'grammar', issue:'a' }, >- { marker:'spelling', issue:'zz' }, >- { marker:'grammar', issue:'orange,zz,apple.' } >+ { marker: internals.sentenceRetroCorrectionEnabled ? 'spelling' : 'grammar', issue: 'a' }, >+ { marker: 'spelling', issue: 'zz' }, >+ { marker: 'grammar', issue: 'orange,zz,apple.' }, >+ { marker: 'spelling', issue: 'orange,zz,apple' }, > ]; > > var tests = [ > function() { verifyDesiredMarkers(elementWithGrammarIssue, misspellings.slice(0, 1)) }, > function() { verifyDesiredMarkers(elementWithSpellingIssue, misspellings.slice(1, 2)) }, >- function() { verifyDesiredMarkers(elementWithGrammarAndSpellingIssue, misspellings.slice(1, 3)) }, >+ function() { verifyDesiredMarkers(elementWithGrammarAndSpellingIssue, misspellings.slice(2, 4)) }, > > // Those expect to have only one kind of markers either spelling or grammar. > function() { verifyUnexpectedMarkers(elementWithGrammarIssue, misspellings.slice(0, 1)) }, >@@ -80,7 +81,7 @@ function verifyDesiredMarkers(e, misspellings) > if (!nextMisspellingData) > return done(); > >- debug("Checking " + nextMisspellingData.marker + " issue on '" + element.firstChild.nodeValue + "'"); >+ debug("Checking for issue on '" + element.firstChild.nodeValue + "'"); > > shouldBecomeDifferent('internals.markerRangeForNode(element.firstChild, nextMisspellingData.marker, 0)', "null", function() { > range = internals.markerRangeForNode(element.firstChild, nextMisspellingData.marker, 0); >@@ -101,7 +102,7 @@ function verifyUnexpectedMarkers(e, misspellings) > else if (nextMisspellingData.marker == 'spelling') > oppositeMarker = 'grammar'; > >- debug("Checking " + oppositeMarker + " issue on '" + element.firstChild.nodeValue + "'"); >+ debug("Checking for no other issues on '" + element.firstChild.nodeValue + "'"); > > shouldBecomeEqual('internals.markerCountForNode(element.firstChild, oppositeMarker)', '0', function() { > debug(""); >diff --git a/LayoutTests/editing/spelling/retro-correction-spelling-markers-expected.txt b/LayoutTests/editing/spelling/retro-correction-spelling-markers-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..73cc5cd5d453da7b75b14e0fbce2049b6597c884 >--- /dev/null >+++ b/LayoutTests/editing/spelling/retro-correction-spelling-markers-expected.txt >@@ -0,0 +1,7 @@ >+PASS internals.hasSpellingMarker(5, 4) became true >+PASS !internals.sentenceRetroCorrectionEnabled || internals.hasSpellingMarker(10, 2) is true >+PASS !internals.sentenceRetroCorrectionEnabled || internals.hasSpellingMarker(18, 3) is true >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+It's muhc to late too finish this. >diff --git a/LayoutTests/editing/spelling/retro-correction-spelling-markers.html b/LayoutTests/editing/spelling/retro-correction-spelling-markers.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5c9d6eb22860e11202c98e639f4696c5ceec088c >--- /dev/null >+++ b/LayoutTests/editing/spelling/retro-correction-spelling-markers.html >@@ -0,0 +1,44 @@ >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+<script src="../editing.js"></script> >+ >+<script> >+function runTest() { >+ jsTestIsAsync = true; >+ >+ if (window.internals) { >+ internals.settings.setUnifiedTextCheckerEnabled(true); >+ internals.settings.setAsynchronousSpellCheckingEnabled(true); >+ internals.setAutomaticTextReplacementEnabled(false); >+ internals.setAutomaticSpellingCorrectionEnabled(false); >+ } >+ >+ document.getElementById("editor").focus(); >+ for (const character of "It's muhc to late too finish this.") >+ typeCharacterCommand(character); >+ >+ if (!window.testRunner) { >+ document.getElementById("description").innerHTML = `To manually test, verify that there are correction markers >+ below <strong>muhc</strong> as well as <strong>to</strong> and <strong>too</strong> on macOS Mojave.`; >+ return; >+ } >+ >+ shouldBecomeEqual("internals.hasSpellingMarker(5, 4)", "true", () => { >+ shouldBeTrue("!internals.sentenceRetroCorrectionEnabled || internals.hasSpellingMarker(10, 2)", "true"); >+ shouldBeTrue("!internals.sentenceRetroCorrectionEnabled || internals.hasSpellingMarker(18, 3)", "true"); >+ finishJSTest(); >+ }); >+} >+</script> >+</head> >+ >+<body> >+ <div id="description"></div> >+ <div contenteditable style="margin-bottom: 1em; border: 1px orange dashed;" id="editor"></div> >+ <script> >+ runTest(); >+ </script> >+ <script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/editing/spelling/spelling-changed-text-expected.txt b/LayoutTests/editing/spelling/spelling-changed-text-expected.txt >index 352e329fc8aebd133d34debefaf297240e52db02..6370317284a1837dbe4652ffe4f4b2bb6256e1ad 100644 >--- a/LayoutTests/editing/spelling/spelling-changed-text-expected.txt >+++ b/LayoutTests/editing/spelling/spelling-changed-text-expected.txt >@@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > PASS internals.markerCountForNode(destination.childNodes[0], "spelling") became different from 0 > PASS window.getSelection().toString() is " Is it broken?" >-PASS spellingMarkerRange.toString() became "wellcome" >+PASS misspellingString() became "wellcome" > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/editing/spelling/spelling-changed-text.html b/LayoutTests/editing/spelling/spelling-changed-text.html >index b7078d312b5ac3f798079dd450b636b582e9ae55..ae679fa03dd8956759a49c2e73edc1a021e39b3a 100644 >--- a/LayoutTests/editing/spelling/spelling-changed-text.html >+++ b/LayoutTests/editing/spelling/spelling-changed-text.html >@@ -16,6 +16,10 @@ description("WebKit should not crash after the text has changed and results are > + " The test succeeds when WebKit does not crash and 'wellcome' has spelling marker."); > > initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) { >+ misspellingString = () => { >+ const range = internals.markerRangeForNode(textNode, "spelling", 0); >+ return range ? range.toString() : null; >+ }; > // Select the text "Is it broken?". > var deleteRange = document.createRange(); > deleteRange.setStart(textNode, 15); >@@ -25,9 +29,7 @@ initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) > shouldBeEqualToString("window.getSelection().toString()", " Is it broken?"); > // Del key to delete the text "Is it broken?". > eventSender.keyDown(String.fromCharCode(0x007F), null); >- >- spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); >- shouldBecomeEqualToString("spellingMarkerRange.toString()", "wellcome", function() { >+ shouldBecomeEqualToString("misspellingString()", "wellcome", function() { > document.getElementById("destination").innerHTML = ""; > finishJSTest(); > }); >diff --git a/LayoutTests/editing/spelling/spelling-markers-after-pasting-sentence-expected.txt b/LayoutTests/editing/spelling/spelling-markers-after-pasting-sentence-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c63312cb8319d83c61aa63ff3e5a133392a49d3a >--- /dev/null >+++ b/LayoutTests/editing/spelling/spelling-markers-after-pasting-sentence-expected.txt >@@ -0,0 +1,7 @@ >+PASS internals.hasSpellingMarker(0, 5) became true >+PASS internals.hasSpellingMarker(6, 5) is true >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+Helol wordl this is a test >+Helol wordl this is a test >diff --git a/LayoutTests/editing/spelling/spelling-markers-after-pasting-sentence.html b/LayoutTests/editing/spelling/spelling-markers-after-pasting-sentence.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b02d8434e8341cdb554ac2529c749409a1626dff >--- /dev/null >+++ b/LayoutTests/editing/spelling/spelling-markers-after-pasting-sentence.html >@@ -0,0 +1,42 @@ >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+<script src="../editing.js"></script> >+ >+<script> >+function runTest() { >+ jsTestIsAsync = true; >+ getSelection().setBaseAndExtent(source, 0, source, 1); >+ >+ if (!window.testRunner) { >+ document.getElementById("description").innerHTML = `To manually test, select the text below and paste into the >+ editable area. There should be misspelling markers below both words.`; >+ return; >+ } >+ >+ internals.settings.setUnifiedTextCheckerEnabled(true); >+ internals.settings.setAsynchronousSpellCheckingEnabled(true); >+ internals.setAutomaticTextReplacementEnabled(false); >+ internals.setAutomaticSpellingCorrectionEnabled(false); >+ >+ copyCommand(); >+ document.getElementById("editor").focus(); >+ pasteCommand(); >+ shouldBecomeEqual("internals.hasSpellingMarker(0, 5)", "true", () => { >+ shouldBeTrue("internals.hasSpellingMarker(6, 5)", "true"); >+ finishJSTest(); >+ }); >+} >+</script> >+</head> >+ >+<body> >+ <div id="description"></div> >+ <div id="source">Helol wordl this is a test</div> >+ <div contenteditable style="margin-bottom: 1em; border: 1px orange dashed;" id="editor"></div> >+ <script> >+ runTest(); >+ </script> >+ <script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >\ No newline at end of file >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index 587a71bb7c1a6922138092071da2d788149891fa..55d39f13272f54c7bbdeac98477e430c725713f0 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -99,7 +99,9 @@ fast/forms/file/file-input-capture.html > fast/css/draggable-region-parser.html > > # Spelling and grammar markers are not supported >+editing/spelling/retro-correction-spelling-markers.html [ WontFix ] > editing/spelling/spelling-marker-includes-hyphen.html [ WontFix ] >+editing/spelling/spelling-markers-after-pasting-sentence.html [ WontFix ] > editing/spelling/spelling-markers-in-overlapping-lines.html [ WontFix ] > editing/spelling/spelling-markers-in-overlapping-lines-large-font.html [ WontFix ] > fast/writing-mode/english-bt-text-with-spelling-marker.html [ WontFix ] >diff --git a/LayoutTests/platform/mac-wk1/TestExpectations b/LayoutTests/platform/mac-wk1/TestExpectations >index 35199887edf590a5a99c5784c73028fbd35889cc..f721b1c74423d741e191e6ede9ccb68a6b751b9d 100644 >--- a/LayoutTests/platform/mac-wk1/TestExpectations >+++ b/LayoutTests/platform/mac-wk1/TestExpectations >@@ -348,7 +348,6 @@ webkit.org/b/158585 webgl/webgl-backing-store-size-update.html [ Pass Timeout ] > > # <rdar://problem/26399598> > [ Sierra+ ] editing/spelling/spellcheck-async.html [ Failure ] >-[ Sierra+ ] editing/spelling/markers.html [ Failure ] > [ Sierra+ ] editing/spelling/spelling-unified-emulation.html [ Failure ] > > # <rdar://problem/26050923> The result is probably still a pass, but we don't have a way >diff --git a/LayoutTests/platform/mac-wk2/TestExpectations b/LayoutTests/platform/mac-wk2/TestExpectations >index 6b0de4224b1cf501ad46c53317cf65cfb97fc7d6..f0064b0ccce4f5eeec414b44cf21c30ae0ea58dc 100644 >--- a/LayoutTests/platform/mac-wk2/TestExpectations >+++ b/LayoutTests/platform/mac-wk2/TestExpectations >@@ -177,6 +177,8 @@ webkit.org/b/105616 editing/spelling/spelling-with-punctuation-selection.html > webkit.org/b/105616 editing/spelling/spelling-with-whitespace-selection.html > webkit.org/b/105616 editing/spelling/grammar.html > webkit.org/b/105616 editing/spelling/markers.html >+webkit.org/b/105616 editing/spelling/retro-correction-spelling-markers.html >+webkit.org/b/105616 editing/spelling/spelling-markers-after-pasting-sentence.html > webkit.org/b/105616 editing/mac/spelling/autocorrection-delete.html [ Failure ] > webkit.org/b/105616 editing/mac/spelling/autocorrection-removing-underline-after-paste.html [ Failure ] > webkit.org/b/105616 editing/mac/spelling/autocorrection-removing-underline.html [ Failure ]
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 185584
:
341987
| 342011