2014-01-17 09:18:58 +00:00
|
|
|
Tests spelling and grammar markers for misspellings.
|
|
|
|
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for issue on "I have a issue."
|
|
|
|
PASS internals.markerRangeForNode(element.firstChild, misspellingData.marker, 0) became different from null
|
2018-07-02 22:04:51 +00:00
|
|
|
PASS range.toString() is "a"
|
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for issue on "I have a issue."
|
|
|
|
PASS internals.markerRangeForNode(element.firstChild, misspellingData.marker, 0) became different from null
|
2018-07-02 22:04:51 +00:00
|
|
|
PASS range.toString() is "a"
|
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for issue on "I have a issue."
|
|
|
|
PASS internals.markerRangeForNode(element.firstChild, misspellingData.marker, 0) became different from null
|
2018-07-02 22:04:51 +00:00
|
|
|
PASS range.toString() is "a"
|
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for issue on "I have a issue."
|
|
|
|
PASS internals.markerRangeForNode(element.firstChild, misspellingData.marker, 0) became different from null
|
2011-12-04 03:25:41 +00:00
|
|
|
PASS range.toString() is "a"
|
2014-01-17 09:18:58 +00:00
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for issue on "zz."
|
|
|
|
PASS internals.markerRangeForNode(element.firstChild, misspellingData.marker, 0) became different from null
|
2011-12-04 03:25:41 +00:00
|
|
|
PASS range.toString() is "zz"
|
2014-01-17 09:18:58 +00:00
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for issue on "orange,zz,apple."
|
|
|
|
PASS internals.markerRangeForNode(element.firstChild, misspellingData.marker, 0) became different from null
|
[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.
Source/WebCore:
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.
LayoutTests:
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:
Canonical link: https://commits.webkit.org/201711@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-06 01:44:03 +00:00
|
|
|
PASS range.toString() is "orange,zz,apple."
|
2014-01-17 09:18:58 +00:00
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for issue on "orange,zz,apple."
|
|
|
|
PASS internals.markerRangeForNode(element.firstChild, misspellingData.marker, 0) became different from null
|
[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.
Source/WebCore:
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.
LayoutTests:
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:
Canonical link: https://commits.webkit.org/201711@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-06 01:44:03 +00:00
|
|
|
PASS range.toString() is "orange,zz,apple"
|
2014-01-17 09:18:58 +00:00
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for no other issues on "I have a issue."
|
2014-01-17 09:18:58 +00:00
|
|
|
PASS internals.markerCountForNode(element.firstChild, oppositeMarker) became 0
|
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for no other issues on "I have a issue."
|
2018-07-02 22:04:51 +00:00
|
|
|
PASS internals.markerCountForNode(element.firstChild, oppositeMarker) became 0
|
|
|
|
|
2020-08-07 23:05:36 +00:00
|
|
|
Checking for no other issues on "zz."
|
2014-01-17 09:18:58 +00:00
|
|
|
PASS internals.markerCountForNode(element.firstChild, oppositeMarker) became 0
|
|
|
|
|
2011-12-04 03:25:41 +00:00
|
|
|
PASS successfullyParsed is true
|
|
|
|
|
|
|
|
TEST COMPLETE
|
|
|
|
I have a issue.
|
|
|
|
zz.
|
|
|
|
orange,zz,apple.
|