RESOLVED FIXED 106815
[Chromium] Tests and fixes for spell checker behavior
https://bugs.webkit.org/show_bug.cgi?id=106815
Summary [Chromium] Tests and fixes for spell checker behavior
Rouslan Solomakhin
Reported 2013-01-14 12:18:45 PST
Need to add test to for how spell checker behaves with various selections: - No selection - Sub-word selection - Selection with underscore - Selection with punctuation - Selection with trailing whitespace - Selection with multiple words
Attachments
Proposed patch (58.04 KB, patch)
2013-01-23 12:12 PST, Rouslan Solomakhin
no flags
Proposed patch (52.15 KB, patch)
2013-01-24 14:45 PST, Rouslan Solomakhin
no flags
Proposed patch (52.28 KB, patch)
2013-01-24 14:56 PST, Rouslan Solomakhin
tony: review-
buildbot: commit-queue-
Proposed patch (67.04 KB, patch)
2013-01-25 14:00 PST, Rouslan Solomakhin
buildbot: commit-queue-
Proposed patch (69.28 KB, patch)
2013-01-25 15:49 PST, Rouslan Solomakhin
webkit.review.bot: commit-queue-
Proposed patch (66.82 KB, patch)
2013-01-28 16:02 PST, Rouslan Solomakhin
no flags
Patch (65.00 KB, patch)
2013-01-28 18:00 PST, Rouslan Solomakhin
no flags
Patch (65.09 KB, patch)
2013-01-29 14:02 PST, Rouslan Solomakhin
no flags
Patch (85.90 KB, patch)
2013-01-30 12:21 PST, Rouslan Solomakhin
no flags
Patch (77.27 KB, patch)
2013-01-30 13:18 PST, Rouslan Solomakhin
no flags
Patch (77.20 KB, patch)
2013-01-30 15:27 PST, Rouslan Solomakhin
no flags
Patch (60.54 KB, patch)
2013-01-30 16:58 PST, Rouslan Solomakhin
no flags
Rouslan Solomakhin
Comment 1 2013-01-23 12:12:13 PST
Created attachment 184278 [details] Proposed patch Please review the attached patch. Here is the behavior for Chromium that this patch sets: - Chrome selects the misspelled word on context click. - Spelling should work when the user selects the misspelled word exactly. - If the word is not misspelled, there should be no spelling options in the context menu. - Chrome should select multi-word misspellings on context click. - Spelling should work when the user selects a multi-word misspelling exactly. - Spelling should work for double-clicked misspellings. - Spelling should ignore whitespace. - Underscores should be treated as whitespace: spelling should ignore them. - Punctuation marks should be treated as whitespace: spelling should ignore them. - Spelling should be disabled when user selects a part of misspelling. - Spelling should be disabled when user selects multiple words that are not a single misspelling.
Rouslan Solomakhin
Comment 2 2013-01-23 12:15:48 PST
Hi Anders, I see that you have reviewed changes to Source/WebKit/chromium/src/ContextMenuClientImpl.cpp before. Are you the right person to ask for a review on the attached patch? Thank you. Cheers, Rouslan
Rouslan Solomakhin
Comment 3 2013-01-24 14:45:11 PST
Created attachment 184581 [details] Proposed patch
WebKit Review Bot
Comment 4 2013-01-24 14:47:46 PST
Attachment 184581 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/platform/chromium/editing/spelling/spelling-double-clicked-word-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-double-clicked-word-with-underscores-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-double-clicked-word-with-underscores.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-double-clicked-word.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-exactly-selected-multiple-words-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-exactly-selected-multiple-words.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-exactly-selected-word-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-exactly-selected-word.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-multiword-selection-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-multiword-selection.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-should-select-multiple-words-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-should-select-multiple-words.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-should-select-single-word-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-should-select-single-word.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-subword-selection-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-subword-selection.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-with-punctuation-selection-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-with-punctuation-selection.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-with-underscore-selection-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-with-underscore-selection.html', u'LayoutTests/platform/chromium/editing/spelling/spelling-with-whitespace-selection-expected.txt', u'LayoutTests/platform/chromium/editing/spelling/spelling-with-whitespace-selection.html', u'Source/WebCore/testing/Internals.cpp', u'Source/WebCore/testing/Internals.h', u'Source/WebCore/testing/Internals.idl', u'Source/WebKit/chromium/src/ContextMenuClientImpl.cpp', u'Source/WebKit/chromium/src/WebFrameImpl.cpp']" exit_code: 1 Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:81: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 27 files If any of these errors are false positives, please file a bug against check-webkit-style.
Rouslan Solomakhin
Comment 5 2013-01-24 14:56:21 PST
Created attachment 184588 [details] Proposed patch
Build Bot
Comment 6 2013-01-24 18:23:47 PST
Comment on attachment 184588 [details] Proposed patch Attachment 184588 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16097512
Build Bot
Comment 7 2013-01-24 18:54:23 PST
Comment on attachment 184588 [details] Proposed patch Attachment 184588 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://queues.webkit.org/results/16123006
WebKit Review Bot
Comment 8 2013-01-24 19:24:48 PST
Comment on attachment 184588 [details] Proposed patch Attachment 184588 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16122016 New failing tests: platform/chromium/editing/spelling/spelling-should-select-single-word.html platform/chromium/editing/spelling/spelling-double-clicked-word.html platform/chromium/editing/spelling/spelling-double-clicked-word-with-underscores.html platform/chromium/editing/spelling/spelling-should-select-multiple-words.html platform/chromium/editing/spelling/spelling-exactly-selected-word.html platform/chromium/editing/spelling/spelling-with-punctuation-selection.html platform/chromium/editing/spelling/spelling-with-underscore-selection.html platform/chromium/editing/spelling/spelling-with-whitespace-selection.html
Build Bot
Comment 9 2013-01-24 23:29:25 PST
Comment on attachment 184588 [details] Proposed patch Attachment 184588 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/16114215
Tony Chang
Comment 10 2013-01-25 10:10:12 PST
Comment on attachment 184588 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=184588&action=review You need a ChangeLog. If you use "webkit-patch upload" it should create one for you and open it in a text editor for you. Otherwise, you can use prepare-ChangeLog. Why are these tests only run on Chromium? Shouldn't the result be the same on all WebKit ports? Does this depend on features that are Chromium specific? If so, you could put them in a subdirectory (e.g., editing/spelling/unified-text-checker) and skip that subdir on other platforms since they may enable it in the future. > LayoutTests/platform/chromium/editing/spelling/spelling-double-clicked-word-with-underscores.html:16 > + internals.settings.setUnifiedTextCheckerEnabled(false); This shouldn't be necessary. The test harness (DRT) should automatically undo any settings you set. If you see a different behavior, please file a bug about it and cc me. > LayoutTests/platform/chromium/editing/spelling/spelling-double-clicked-word-with-underscores.html:76 > +description("Spelling should work for double-clicked misspelled words with underscores."); > +if (window.internals) > + test(); It would be nice if there was some text describing how to run the test manually. You could write this in the else branch of "if (window.internals)" or just put it in the description.
Tony Chang
Comment 11 2013-01-25 10:12:22 PST
I think Morrita knows this code and can review it. The tests probably fail depend on what platform you run it on. You might have to setSelectTrailingWhitespaceEnabled and setSmartInsertDeleteEnabled in each test to get consistent results on each platform.
Tony Chang
Comment 12 2013-01-25 10:42:42 PST
Hironori is also a good person to do an informal review of this.
Rouslan Solomakhin
Comment 13 2013-01-25 14:00:24 PST
Created attachment 184808 [details] Proposed patch Added Changelog. Added description of how to test manually. Added setSelectTrailingWhitespaceEnabled and setSmartInsertDeleteEnabled in all tests. Removed unnecessary test cleanup calls. Tony: Thank you for the review. I've placed the tests in platform/chromium/editing/spelling because I am testing and fixing the behavior of Source/WebKit/chromium/src/ContextMenuClientImpl.cpp specifically. Chromium spell check behaves differently from other WebKit ports. For example, Chromium selects the misspelled word on context click, but Safari does not. Calls to setSelectTrailingWhitespaceEnabled should be necessary only when double-clicks are involved, but I've put it in all the tests for good measure. Calls to setSmartInsertDeleteEnabled should be necessary only when we test replacing the misspelling with a suggestion. These tests do not exercise that functionality, but I've put it in all the tests for good measure, too.
Build Bot
Comment 14 2013-01-25 14:07:20 PST
Comment on attachment 184808 [details] Proposed patch Attachment 184808 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://queues.webkit.org/results/16097943
Rouslan Solomakhin
Comment 15 2013-01-25 14:16:08 PST
(In reply to comment #10) > Why are these tests only run on Chromium? Shouldn't the result be the same on all WebKit ports? Does this depend on features that are Chromium specific? If so, you could put them in a subdirectory (e.g., editing/spelling/unified-text-checker) and skip that subdir on other platforms since they may enable it in the future. If we decide to put the tests in a subdirectory of editing/spelling, then we probably should have three subdirectories for the three different features that Chromium implements: 1) editing/spelling/select-on-context-click/ - Select misspelled word on context-click. 2) editing/spelling/selection/ - Spell check selected word. 3) editing/spelling/ignore-whitespace/ - Ignore selected whitespace in spell check. 4) editing/spelling/ignore-punctuation/ - Ignore selected punctuation in spell check.
Rouslan Solomakhin
Comment 16 2013-01-25 14:16:51 PST
(In reply to comment #15) > three subdirectories four, that is.
kov's GTK+ EWS bot
Comment 17 2013-01-25 14:19:06 PST
Comment on attachment 184808 [details] Proposed patch Attachment 184808 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/16123486
WebKit Review Bot
Comment 18 2013-01-25 14:48:45 PST
Comment on attachment 184808 [details] Proposed patch Attachment 184808 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16120473 New failing tests: platform/chromium/editing/spelling/spelling-should-select-single-word.html platform/chromium/editing/spelling/spelling-double-clicked-word.html platform/chromium/editing/spelling/spelling-double-clicked-word-with-underscores.html platform/chromium/editing/spelling/spelling-should-select-multiple-words.html platform/chromium/editing/spelling/spelling-exactly-selected-word.html platform/chromium/editing/spelling/spelling-with-punctuation-selection.html platform/chromium/editing/spelling/spelling-with-underscore-selection.html platform/chromium/editing/spelling/spelling-with-whitespace-selection.html
Build Bot
Comment 19 2013-01-25 14:51:51 PST
Comment on attachment 184808 [details] Proposed patch Attachment 184808 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16113612
Tony Chang
Comment 20 2013-01-25 15:01:01 PST
I think you need to update the symbol exports for the platforms that are failing: http://trac.webkit.org/wiki/ExportingSymbols The tests are still failing on the cr-linux box. What platform are you running the tests on? There's a lot of common boilerplate in the tests. You might want to factor that into a shared .js file that the tests all include. You would put the shared .js file in a resources subdirectory. I thought Safari (and OS X in general) always selected the word under the cursor when you right click? We normally only put tests in a platform specific subdirectory when we're testing platform specific behavior (e.g., there are some Apple Script tests in platform/mac). None of these behaviors seem platform specific to me, although there might be slightly different results on different platforms, in which case, we can check in multiple results files or disable the failing tests on the platforms they fail on.
Rouslan Solomakhin
Comment 21 2013-01-25 15:49:27 PST
Created attachment 184825 [details] Proposed patch Added symbol exports. Want to see if this fixes any of the build bots.
Rouslan Solomakhin
Comment 22 2013-01-25 15:55:09 PST
(In reply to comment #20) > I think you need to update the symbol exports for the platforms that are failing: > http://trac.webkit.org/wiki/ExportingSymbols Thank you for pointing that out. I am testing the patch with exported symbols now. > The tests are still failing on the cr-linux box. What platform are you running the tests on? I have been running the following command in Chromium. $ ~/src/webkit/tools/layout_tests/run_webkit_tests.sh --no-pixel-tests platform/chromium/editing/spelling Although this is a Chromium tool, my WebKit in src/third_party/WebKit is checked out directly from git://git.webkit.org/WebKit.git. > There's a lot of common boilerplate in the tests. You might want to factor that into a shared .js file that the tests all include. You would put the shared .js file in a resources subdirectory. Will do. > I thought Safari (and OS X in general) always selected the word under the cursor when you right click? I double-checked and you are correct. Chrome matches Safari in that misspelled words are selected when you right click. Safari also selects correctly spelled words when you right click. Chrome does not, however. > We normally only put tests in a platform specific subdirectory when we're testing platform specific behavior (e.g., there are some Apple Script tests in platform/mac). None of these behaviors seem platform specific to me, although there might be slightly different results on different platforms, in which case, we can check in multiple results files or disable the failing tests on the platforms they fail on. Sounds good. I am working on it.
WebKit Review Bot
Comment 23 2013-01-25 16:33:03 PST
Comment on attachment 184825 [details] Proposed patch Attachment 184825 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16112684 New failing tests: platform/chromium/editing/spelling/spelling-should-select-single-word.html platform/chromium/editing/spelling/spelling-double-clicked-word.html platform/chromium/editing/spelling/spelling-double-clicked-word-with-underscores.html platform/chromium/editing/spelling/spelling-should-select-multiple-words.html platform/chromium/editing/spelling/spelling-exactly-selected-word.html platform/chromium/editing/spelling/spelling-with-punctuation-selection.html platform/chromium/editing/spelling/spelling-with-underscore-selection.html platform/chromium/editing/spelling/spelling-with-whitespace-selection.html
Build Bot
Comment 24 2013-01-25 19:29:07 PST
Comment on attachment 184825 [details] Proposed patch Attachment 184825 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/16111885
Hajime Morrita
Comment 25 2013-01-27 16:25:36 PST
Comment on attachment 184825 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=184825&action=review I'm wondering whether we can get rid of addSpellingMarker(). In general, Internals object is for inspecting hidden state from JS and issuing a action with side effect through the Internals object isn't a good idea. It can be a signal of testing something that never happens in real Web. One possible workaround is to tell MockSpellChecker a multi-word misspelling candidate. http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp So that it marks the text as mis-spelled. This approach is more like end-to-end than unit testing, which WebKit traditionally prefers. > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:289 > + RefPtr<Range> markerRange = selectionRange->cloneRange(exceptionCode); Nit: Can this fail? If not, we can use ASSERT_NO_EXCEPTION macro to clarify that fact. https://lists.webkit.org/pipermail/webkit-dev/2011-December/018908.html
Rouslan Solomakhin
Comment 26 2013-01-28 16:02:08 PST
Created attachment 185091 [details] Proposed patch
Rouslan Solomakhin
Comment 27 2013-01-28 16:03:54 PST
Trying out a patch without addSpellingMarker and with ASSERT_NO_EXCEPTION.
Hajime Morrita
Comment 28 2013-01-28 16:33:46 PST
Comment on attachment 185091 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=185091&action=review As Tony pointed, The large part of the test code is a boilerplate. Can we get rid of it? > LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores.html:16 > + finishJSTest(); It looks we have no "FAIL" output when the test is timed out. Let's explicitly fail here. Same for other tests. > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:300 > + selectionRange.clear(); Nit: It looks we don't need this clear() call.
Rouslan Solomakhin
Comment 29 2013-01-28 18:00:55 PST
Rouslan Solomakhin
Comment 30 2013-01-28 18:01:54 PST
(In reply to comment #28) > (From update of attachment 185091 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=185091&action=review > > As Tony pointed, The large part of the test code is a boilerplate. Can we get rid of it? Moved boilerplate into LayoutTests/editing/spelling/resources/util.js > > > LayoutTests/editing/spelling/spelling-double-clicked-word-with-underscores.html:16 > > + finishJSTest(); > > It looks we have no "FAIL" output when the test is timed out. > Let's explicitly fail here. Same for other tests. > > > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:300 > > + selectionRange.clear(); > > Nit: It looks we don't need this clear() call. Removed the clear() call.
Rouslan Solomakhin
Comment 31 2013-01-28 18:03:03 PST
(In reply to comment #28) > It looks we have no "FAIL" output when the test is timed out. > Let's explicitly fail here. Same for other tests. Added log("FAIL: spell check timed outed") in LayoutTests/editing/spelling/resources/util.js.
Hajime Morrita
Comment 32 2013-01-28 18:20:46 PST
Comment on attachment 185121 [details] Patch Looks good to me. Do you want me to land this?
Rouslan Solomakhin
Comment 33 2013-01-28 18:25:18 PST
Comment on attachment 185121 [details] Patch Requesting to use the commit-queue
Build Bot
Comment 34 2013-01-29 02:06:35 PST
Comment on attachment 185121 [details] Patch Attachment 185121 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16200066 New failing tests: editing/spelling/spelling-exactly-selected-multiple-words.html editing/spelling/spelling-should-select-multiple-words.html editing/spelling/spelling-with-punctuation-selection.html editing/spelling/spelling-double-clicked-word.html editing/spelling/spelling-should-select-single-word.html editing/spelling/spelling-exactly-selected-word.html editing/spelling/spelling-double-clicked-word-with-underscores.html editing/spelling/spelling-with-whitespace-selection.html editing/spelling/spelling-with-underscore-selection.html
Build Bot
Comment 35 2013-01-29 02:50:52 PST
Comment on attachment 185121 [details] Patch Attachment 185121 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16201085 New failing tests: editing/spelling/spelling-exactly-selected-multiple-words.html editing/spelling/spelling-should-select-multiple-words.html editing/spelling/spelling-with-punctuation-selection.html editing/spelling/spelling-double-clicked-word.html editing/spelling/spelling-should-select-single-word.html editing/spelling/spelling-exactly-selected-word.html editing/spelling/spelling-double-clicked-word-with-underscores.html editing/spelling/spelling-with-whitespace-selection.html editing/spelling/spelling-with-underscore-selection.html
Tony Chang
Comment 36 2013-01-29 10:04:42 PST
My suggestion for the Mac failures is to add the tests to platform/mac/TestExpectations marked as [ Failure ]. Then when you commit, the tests will run and you can grab the results from the bots and try to figure out why they failed. The other option is to build the Apple Mac port locally and run the tests (which you may need to do anyway to figure out why these tests are failing).
Rouslan Solomakhin
Comment 37 2013-01-29 10:09:37 PST
(In reply to comment #36) > My suggestion for the Mac failures is to add the tests to platform/mac/TestExpectations marked as [ Failure ]. Then when you commit, the tests will run and you can grab the results from the bots and try to figure out why they failed. > > The other option is to build the Apple Mac port locally and run the tests (which you may need to do anyway to figure out why these tests are failing). I am building the Apple Mac port locally on my Mac.
Rouslan Solomakhin
Comment 38 2013-01-29 14:02:35 PST
Rouslan Solomakhin
Comment 39 2013-01-29 14:03:57 PST
Comment on attachment 185303 [details] Patch The fix for layout tests on Mac is to set "win" editing behavior.
Build Bot
Comment 40 2013-01-29 15:40:29 PST
Comment on attachment 185303 [details] Patch Attachment 185303 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://queues.webkit.org/results/16196318 New failing tests: editing/spelling/spelling-exactly-selected-multiple-words.html editing/spelling/spelling-should-select-multiple-words.html editing/spelling/spelling-with-punctuation-selection.html editing/spelling/spelling-double-clicked-word.html editing/spelling/spelling-should-select-single-word.html editing/spelling/spelling-multiword-selection.html editing/spelling/spelling-exactly-selected-word.html editing/spelling/spelling-double-clicked-word-with-underscores.html editing/spelling/spelling-with-whitespace-selection.html editing/spelling/spelling-with-underscore-selection.html editing/spelling/spelling-subword-selection.html
Build Bot
Comment 41 2013-01-29 16:03:02 PST
Comment on attachment 185303 [details] Patch Attachment 185303 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/16195339 New failing tests: editing/spelling/spelling-exactly-selected-multiple-words.html editing/spelling/spelling-should-select-multiple-words.html editing/spelling/spelling-with-punctuation-selection.html editing/spelling/spelling-double-clicked-word.html editing/spelling/spelling-should-select-single-word.html editing/spelling/spelling-exactly-selected-word.html editing/spelling/spelling-double-clicked-word-with-underscores.html editing/spelling/spelling-with-whitespace-selection.html editing/spelling/spelling-with-underscore-selection.html
Rouslan Solomakhin
Comment 42 2013-01-29 16:59:04 PST
The failures on Mac are due to differences in misspelling marker placement. In the word "wellcome_", for example, the Mac port marks the text "wellcome_" as misspelled, including the underline. Other ports, however, only mark the text "wellcome", without the underline.
Tony Chang
Comment 43 2013-01-29 17:08:35 PST
(In reply to comment #42) > The failures on Mac are due to differences in misspelling marker placement. In the word "wellcome_", for example, the Mac port marks the text "wellcome_" as misspelled, including the underline. Other ports, however, only mark the text "wellcome", without the underline. What happens in TextEdit on a Mac? Safari tries to mimic the behavior of TextEdit.
Rouslan Solomakhin
Comment 44 2013-01-29 17:19:20 PST
(In reply to comment #43) > (In reply to comment #42) > > The failures on Mac are due to differences in misspelling marker placement. In the word "wellcome_", for example, the Mac port marks the text "wellcome_" as misspelled, including the underline. Other ports, however, only mark the text "wellcome", without the underline. > > What happens in TextEdit on a Mac? Safari tries to mimic the behavior of TextEdit. TextEdit also marks the text "wellcome_" as misspelled, including the underline.
Rouslan Solomakhin
Comment 45 2013-01-29 17:20:23 PST
(In reply to comment #44) > (In reply to comment #43) > > (In reply to comment #42) > > > The failures on Mac are due to differences in misspelling marker placement. In the word "wellcome_", for example, the Mac port marks the text "wellcome_" as misspelled, including the underline. Other ports, however, only mark the text "wellcome", without the underline. > > > > What happens in TextEdit on a Mac? Safari tries to mimic the behavior of TextEdit. > > TextEdit also marks the text "wellcome_" as misspelled, including the underline. Is there a setting like editing behavior that I can flip in layout tests to alter this behavior?
Tony Chang
Comment 46 2013-01-30 10:07:33 PST
(In reply to comment #45) > (In reply to comment #44) > > (In reply to comment #43) > > > (In reply to comment #42) > > > > The failures on Mac are due to differences in misspelling marker placement. In the word "wellcome_", for example, the Mac port marks the text "wellcome_" as misspelled, including the underline. Other ports, however, only mark the text "wellcome", without the underline. > > > > > > What happens in TextEdit on a Mac? Safari tries to mimic the behavior of TextEdit. > > > > TextEdit also marks the text "wellcome_" as misspelled, including the underline. > > Is there a setting like editing behavior that I can flip in layout tests to alter this behavior? Not that I know of. It seems OK to me to check in a separate expected file for platform/mac and file a bug for the differing behavior.
Rouslan Solomakhin
Comment 47 2013-01-30 10:15:56 PST
(In reply to comment #46) > It seems OK to me to check in a separate expected file for platform/mac and file a bug for the differing behavior. Sounds good. Would the new bug ask for the same behavior on all platforms or for new tests on the mac platform?
Tony Chang
Comment 48 2013-01-30 11:18:52 PST
(In reply to comment #47) > (In reply to comment #46) > > It seems OK to me to check in a separate expected file for platform/mac and file a bug for the differing behavior. > > Sounds good. Would the new bug ask for the same behavior on all platforms or for new tests on the mac platform? I'm not sure since I'm not sure if the behavior in Safari/TextEdit is intentional or not. Maybe Ryosuke can find out? For now, I would just file a bug saying what the different behaviors are.
Rouslan Solomakhin
Comment 49 2013-01-30 12:21:53 PST
Rouslan Solomakhin
Comment 50 2013-01-30 12:22:55 PST
Comment on attachment 185537 [details] Patch Added platform-specific expected test outputs for mac and mac-wk2 platforms.
Rouslan Solomakhin
Comment 51 2013-01-30 12:33:41 PST
Filed https://bugs.webkit.org/show_bug.cgi?id=108370 - "Different spellcheck behavior among platforms"
Tony Chang
Comment 52 2013-01-30 12:46:03 PST
Comment on attachment 185537 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=185537&action=review It would be helpful if on bug 108370 you listed what the differences are for each test. > LayoutTests/platform/mac-wk2/editing/spelling/spelling-double-clicked-word-expected.txt:7 > +FAIL Incomplete test environment > +PASS successfullyParsed is true I see, we should skip these tests in platform/mac-wk2/TestExpectations since it doesn't implement setAsynchronousSpellCheckingEnabled.
Rouslan Solomakhin
Comment 53 2013-01-30 13:18:58 PST
Rouslan Solomakhin
Comment 54 2013-01-30 13:21:23 PST
Comment on attachment 185547 [details] Patch Skipping the new spell checker tests on Mac WK2.
Rouslan Solomakhin
Comment 55 2013-01-30 13:39:14 PST
Specified the mac platform differences in bug 108370.
Rouslan Solomakhin
Comment 56 2013-01-30 14:51:22 PST
All tests passed. Can someone with correct permissions please flip the review and commit-queue flags to "+" ?
Tony Chang
Comment 57 2013-01-30 14:52:49 PST
Comment on attachment 185547 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=185547&action=review Some minor style nits, but this looks OK overall. Note that the Qt, Gtk and Efl bots don't run tests, so these tests may fail on those ports too. You can either suppress the errors in TestExpectations or land them and watch the bots on build.webkit.org. > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:296 > + // If there is no selection, then select the misspelling. WebKit style is to avoid comments that only describe the code. Most comments are for answering 'why' the code is there. I would remove this comment. > Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp:76 > + int maxWordLength = stringText.length() - wordOffset; > + int wordLength; Don't you need to static_cast length() to an int? I think some compilers will complain about this signed/unsigned conversion. Should maxWordLength and wordLength be unsigned? > Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp:77 > + WTF::String word; Nit: No WTF:: needed. > Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp:85 > + wordLength = m_misspelledWords.at(i).length() > maxWordLength ? maxWordLength : m_misspelledWords.at(i).length(); I'm surprised this doesn't complain about signed/unsigned either.
Rouslan Solomakhin
Comment 58 2013-01-30 15:22:17 PST
(In reply to comment #57) > Note that the Qt, Gtk and Efl bots don't run tests, so these tests may fail on those ports too. You can either suppress the errors in TestExpectations or land them and watch the bots on build.webkit.org. Is there a way to make these bots run the tests? I am hopeful that the tests will pass on those platforms. If not, we should add TestExpecations after the build bots fail.
Tony Chang
Comment 59 2013-01-30 15:23:48 PST
(In reply to comment #58) > (In reply to comment #57) > > Note that the Qt, Gtk and Efl bots don't run tests, so these tests may fail on those ports too. You can either suppress the errors in TestExpectations or land them and watch the bots on build.webkit.org. > > Is there a way to make these bots run the tests? Nope. > I am hopeful that the tests will pass on those platforms. If not, we should add TestExpecations after the build bots fail. That's fine as well. Just make sure you're around when the patch lands.
Rouslan Solomakhin
Comment 60 2013-01-30 15:27:23 PST
Rouslan Solomakhin
Comment 61 2013-01-30 15:31:31 PST
Comment on attachment 185594 [details] Patch - Removed the unnecessary comment in ContextMenuClentImpl.cpp - Casting length() to int in MockSpellCheck.cpp.
Rouslan Solomakhin
Comment 62 2013-01-30 15:33:53 PST
Posted this on #webkit IRC channel: "This is a heads up: I plan to land http://webkit.org/b/106815, which might break layout test on qt, gtk, and efl. In case of breakage, I will land the appropriate changes to TestExpectations."
Ryosuke Niwa
Comment 63 2013-01-30 15:34:22 PST
Comment on attachment 185594 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=185594&action=review > Source/WebKit/chromium/ChangeLog:19 > + Fix spellcheck to behave as follows: > + - Spellcheck selects the misspelled word on context click. > + - Spelling should work when the user selects the misspelled word exactly. > + - If the word is not misspelled, there should be no spelling options in the context menu. > + - Spellcheck should select multi-word misspellings on context click. > + - Spelling should work when the user selects a multi-word misspelling exactly. > + - Spelling should work for double-clicked misspellings. > + - Spelling should ignore whitespace. > + - Underscores should be treated as whitespace: spelling should ignore them. > + - Punctuation marks should be treated as whitespace: spelling should ignore them. > + - Spelling should be disabled when user selects a part of misspelling. > + - Spelling should be disabled when user selects multiple words that are not a single misspelling. That's a lot of bug fixes in one patch! Can we somehow break this up into smaller pieces? In WebKit, we try to break up patches into small pieces as much as possible. > LayoutTests/ChangeLog:19 > + - Spellcheck selects the misspelled word on context click. > + - Spelling should work when the user selects the misspelled word exactly. > + - If the word is not misspelled, there should be no spelling options in the context menu. > + - Spellcheck should select multi-word misspellings on context click. > + - Spelling should work when the user selects a multi-word misspelling exactly. > + - Spelling should work for double-clicked misspellings. > + - Spelling should ignore whitespace. > + - Underscores should be treated as whitespace: spelling should ignore them. > + - Punctuation marks should be treated as whitespace: spelling should ignore them. > + - Spelling should be disabled when user selects a part of misspelling. > + - Spelling should be disabled when user selects multiple words that are not a single misspelling. Please add these comments after "Added." below.
Rouslan Solomakhin
Comment 64 2013-01-30 16:58:26 PST
Rouslan Solomakhin
Comment 65 2013-01-30 16:59:09 PST
Comment on attachment 185625 [details] Patch Trying to attach this patch to https://bugs.webkit.org/show_bug.cgi?id=108405...
Rouslan Solomakhin
Comment 66 2013-01-30 17:06:50 PST
(In reply to comment #63) > That's a lot of bug fixes in one patch! Can we somehow break this up into smaller pieces? Filed https://webkit.org/b/108405 and attached LayoutTests there. The tests are marked as [Skip] in TestExpectations for all platforms for now.
Rouslan Solomakhin
Comment 67 2013-01-31 11:10:05 PST
(In reply to comment #66) > (In reply to comment #63) > > That's a lot of bug fixes in one patch! Can we somehow break this up into smaller pieces? > > Filed https://webkit.org/b/108405 and attached LayoutTests there. The tests are marked as [Skip] in TestExpectations for all platforms for now. Filed https://webkit.org/b/108498 (Add two-word misspelling to mock spellchecker) and attached the patch.
Rouslan Solomakhin
Comment 68 2013-01-31 14:19:55 PST
Filed https://webkit.org/b/108509 (Select two-word misspelling on context-click) and attached the patch.
Rouslan Solomakhin
Comment 69 2013-02-11 12:46:20 PST
Thank you for all your help!
Note You need to log in before you can comment on or make changes to this bug.