Changeset 100887 in webkit


Ignore:
Timestamp:
Nov 20, 2011 10:28:06 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Chromium] Layout test does not return correct misspelling positions if there are multiple misspelled words.
https://bugs.webkit.org/show_bug.cgi?id=72655

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-11-20
Reviewed by Hajime Morita.

Tools:

Fixed the calculation of offset.

  • DumpRenderTree/chromium/WebViewHost.cpp:

(WebViewHost::finishLastTextCheck):

LayoutTests:

Fixed the calculation of offset, and added test cases having multiple misspelled words.

  • editing/spelling/script-tests/spellcheck-paste.js: Added test cases having multiple misspelled words.

(verifyMarker):
(tests):

  • editing/spelling/spellcheck-paste-expected.txt: Recreated.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100886 r100887  
     12011-11-20  Shinya Kawanaka  <shinyak@google.com>
     2
     3        [Chromium] Layout test does not return correct misspelling positions if there are multiple misspelled words.
     4        https://bugs.webkit.org/show_bug.cgi?id=72655
     5
     6        Reviewed by Hajime Morita.
     7
     8        Fixed the calculation of offset, and added test cases having multiple misspelled words.
     9
     10        * editing/spelling/script-tests/spellcheck-paste.js:
     11          Added test cases having multiple misspelled words.
     12        (verifyMarker):
     13        (tests):
     14        * editing/spelling/spellcheck-paste-expected.txt: Recreated.
     15
    1162011-11-20  Kenichi Ishibashi  <bashi@chromium.org>
    217
  • trunk/LayoutTests/editing/spelling/script-tests/spellcheck-paste.js

    r73886 r100887  
    2626testRoot.appendChild(testSourceDecorated);
    2727
     28var testSourceMulti = document.createElement("div");
     29testSourceMulti.innerHTML = "zz zz zz";
     30testRoot.appendChild(testSourceMulti);
     31
    2832var sel = window.getSelection();
    2933
     
    4650        sel.selectAllChildren(node);
    4751    }
    48     return layoutTestController.hasSpellingMarker(expectedMarked[0], expectedMarked[1]);
     52
     53    var ok = true;
     54    for (var i = 0; ok && i < expectedMarked.length; ++i)
     55        ok = layoutTestController.hasSpellingMarker(expectedMarked[i][0], expectedMarked[i][1]);
     56    return ok;
    4957}
    5058
     
    8896    layoutTestController.setAsynchronousSpellCheckingEnabled(true);
    8997
    90 tests.push(function() { pasteAndVerify(testSourcePlain, testInput, [0, 3]); });
    91 tests.push(function() { pasteAndVerify(testSourceDecorated, testInput, [0, 3]); });
    92 tests.push(function() { pasteAndVerify(testSourcePlain, testTextArea, [0, 3]); });
    93 tests.push(function() { pasteAndVerify(testSourceDecorated, testTextArea, [0, 3]); });
    94 tests.push(function() { pasteAndVerify(testSourcePlain, testEditable, [0, 3]); });
    95 tests.push(function() { pasteAndVerify(testSourceDecorated, testEditable, [0, 2]); }); // To check "fo" part of foo.
     98tests.push(function() { pasteAndVerify(testSourcePlain, testInput, [[0, 3]]); });
     99tests.push(function() { pasteAndVerify(testSourceDecorated, testInput, [[0, 3]]); });
     100tests.push(function() { pasteAndVerify(testSourceMulti, testInput, [[0, 2], [3, 2]]); });
     101tests.push(function() { pasteAndVerify(testSourcePlain, testTextArea, [[0, 3]]); });
     102tests.push(function() { pasteAndVerify(testSourceDecorated, testTextArea, [[0, 3]]); });
     103tests.push(function() { pasteAndVerify(testSourceMulti, testTextArea, [[0, 2], [3, 2]]); });
     104tests.push(function() { pasteAndVerify(testSourcePlain, testEditable, [[0, 3]]); });
     105tests.push(function() { pasteAndVerify(testSourceDecorated, testEditable, [[0, 2]]); }); // To check "fo" part of foo.
     106tests.push(function() { pasteAndVerify(testSourceMulti, testEditable, [[0, 2], [3, 2]]); });
    96107done();
    97108
  • trunk/LayoutTests/editing/spelling/spellcheck-paste-expected.txt

    r73886 r100887  
    99PASS INPUT has a marker on 'foo bar'
    1010PASS INPUT has a marker on 'fo<b>o ba</b>r'
     11PASS INPUT has a marker on 'zz zz zz'
    1112PASS TEXTAREA has a marker on 'foo bar'
    1213PASS TEXTAREA has a marker on 'fo<b>o ba</b>r'
     14PASS TEXTAREA has a marker on 'zz zz zz'
    1315PASS DIV has a marker on 'foo bar'
    1416PASS DIV has a marker on 'fo<b>o ba</b>r'
     17PASS DIV has a marker on 'zz zz zz'
    1518
  • trunk/Tools/ChangeLog

    r100875 r100887  
     12011-11-20  Shinya Kawanaka  <shinyak@google.com>
     2
     3        [Chromium] Layout test does not return correct misspelling positions if there are multiple misspelled words.
     4        https://bugs.webkit.org/show_bug.cgi?id=72655
     5
     6        Reviewed by Hajime Morita.
     7
     8        Fixed the calculation of offset.
     9
     10        * DumpRenderTree/chromium/WebViewHost.cpp:
     11        (WebViewHost::finishLastTextCheck):
     12
    1132011-11-20  Ojan Vafai  <ojan@chromium.org>
    214
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r100821 r100887  
    459459        results.append(WebTextCheckingResult(WebTextCheckingResult::ErrorSpelling, offset + misspelledPosition, misspelledLength));
    460460        text = text.substring(misspelledPosition + misspelledLength);
    461         offset += misspelledPosition;
     461        offset += misspelledPosition + misspelledLength;
    462462    }
    463463
Note: See TracChangeset for help on using the changeset viewer.