⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 110546 in webkit


Ignore:
Timestamp:
Mar 13, 2012, 1:38:38 AM (15 years ago)
Author:
shinyak@chromium.org
Message:

REGRESSION: Spellcheck tests hit assertions on Mac.
​https://bugs.webkit.org/show_bug.cgi?id=80883

Reviewed by Ryosuke Niwa.

Source/WebKit/mac:

The bug was caused by the closure object created in requestCheckingOfString accessing
request's member variables even though the request object is not an NSObject or allocated
in stack. This resulted in the closure not being able to access those variables when invoked.

Fixed the bug by making local copies of those member variables.

  • WebCoreSupport/WebEditorClient.mm:

(WebEditorClient::requestCheckingOfString):

LayoutTests:

Some words used in spellcheck-paste.js are considered as correct spellings in Mac's spellchecker.
This patch changes them into 'zz' so that Mac's spellchecker can make them as misspelling.

  • editing/spelling/script-tests/spellcheck-paste.js:

(pasteAndVerify.trial):
(pasteAndVerify):
(tests):

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r110545 r110546  
     12012-03-13  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        REGRESSION: Spellcheck tests hit assertions on Mac.
     4        https://bugs.webkit.org/show_bug.cgi?id=80883
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Some words used in spellcheck-paste.js are considered as correct spellings in Mac's spellchecker.
     9        This patch changes them into 'zz' so that Mac's spellchecker can make them as misspelling.
     10
     11        * editing/spelling/script-tests/spellcheck-paste.js:
     12        (pasteAndVerify.trial):
     13        (pasteAndVerify):
     14        (tests):
     15        * editing/spelling/spellcheck-paste-expected.txt:
     16
    1172012-03-12  Nikolas Zimmermann  <nzimmermann@rim.com>
    218
  • trunk/LayoutTests/editing/spelling/script-tests/spellcheck-paste.js

    r101002 r110546  
    1919
    2020var testSourcePlain = document.createElement("div");
    21 testSourcePlain.innerHTML = "foo bar";
     21testSourcePlain.innerHTML = "zz apple";
    2222testRoot.appendChild(testSourcePlain);
    2323
    2424var testSourceDecorated = document.createElement("div");
    25 testSourceDecorated.innerHTML = "fo<b>o ba</b>r";
     25testSourceDecorated.innerHTML = "z<b>z appl</b>e";
    2626testRoot.appendChild(testSourceDecorated);
    2727
    … …  
    8484        nretry--;
    8585        if (0 == nretry) {
    86             testFailed(dest.tagName + " should have a marker on for '" + source.innerHTML + "'");
     86            testFailed(dest.tagName + " should have a marker on '" + source.innerHTML + "'");
    8787            done();
    8888            return;
    … …  
    9898    layoutTestController.setAsynchronousSpellCheckingEnabled(true);
    9999
    100 tests.push(function() { pasteAndVerify(testSourcePlain, testInput, [[0, 3]]); });
    101 tests.push(function() { pasteAndVerify(testSourceDecorated, testInput, [[0, 3]]); });
     100tests.push(function() { pasteAndVerify(testSourcePlain, testInput, [[0, 2]]); });
     101tests.push(function() { pasteAndVerify(testSourceDecorated, testInput, [[0, 2]]); });
    102102tests.push(function() { pasteAndVerify(testSourceMulti, testInput, [[0, 2], [3, 2]]); });
    103 tests.push(function() { pasteAndVerify(testSourcePlain, testTextArea, [[0, 3]]); });
    104 tests.push(function() { pasteAndVerify(testSourceDecorated, testTextArea, [[0, 3]]); });
     103
     104tests.push(function() { pasteAndVerify(testSourcePlain, testTextArea, [[0, 2]]); });
     105tests.push(function() { pasteAndVerify(testSourceDecorated, testTextArea, [[0, 2]]); });
    105106tests.push(function() { pasteAndVerify(testSourceMulti, testTextArea, [[0, 2], [3, 2]]); });
    106 tests.push(function() { pasteAndVerify(testSourcePlain, testEditable, [[0, 3]]); });
    107 tests.push(function() { pasteAndVerify(testSourceDecorated, testEditable, [[0, 2]]); }); // To check "fo" part of foo.
     107
     108tests.push(function() { pasteAndVerify(testSourcePlain, testEditable, [[0, 2]]); });
     109tests.push(function() { pasteAndVerify(testSourceDecorated, testEditable, [[0, 1]]); }); // To check "fo" part of foo.
    108110tests.push(function() { pasteAndVerify(testSourceMulti, testEditable, [[0, 2], [3, 2]]); });
    109111done();
  • trunk/LayoutTests/editing/spelling/spellcheck-paste-expected.txt

    r100887 r110546  
    77
    88TEST COMPLETE
    9 PASS INPUT has a marker on 'foo bar'
    10 PASS INPUT has a marker on 'fo<b>o ba</b>r'
     9PASS INPUT has a marker on 'zz apple'
     10PASS INPUT has a marker on 'z<b>z appl</b>e'
    1111PASS INPUT has a marker on 'zz zz zz'
    12 PASS TEXTAREA has a marker on 'foo bar'
    13 PASS TEXTAREA has a marker on 'fo<b>o ba</b>r'
     12PASS TEXTAREA has a marker on 'zz apple'
     13PASS TEXTAREA has a marker on 'z<b>z appl</b>e'
    1414PASS TEXTAREA has a marker on 'zz zz zz'
    15 PASS DIV has a marker on 'foo bar'
    16 PASS DIV has a marker on 'fo<b>o ba</b>r'
     15PASS DIV has a marker on 'zz apple'
     16PASS DIV has a marker on 'z<b>z appl</b>e'
    1717PASS DIV has a marker on 'zz zz zz'
    1818
  • trunk/Source/WebKit/mac/ChangeLog

    r110403 r110546  
     12012-03-13  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        REGRESSION: Spellcheck tests hit assertions on Mac.
     4        https://bugs.webkit.org/show_bug.cgi?id=80883
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        The bug was caused by the closure object created in requestCheckingOfString accessing
     9        request's member variables even though the request object is not an NSObject or allocated
     10        in stack. This resulted in the closure not being able to access those variables when invoked.
     11
     12        Fixed the bug by making local copies of those member variables.
     13
     14        * WebCoreSupport/WebEditorClient.mm:
     15        (WebEditorClient::requestCheckingOfString):
     16
    1172012-03-11  Timothy Hatcher  <timothy@apple.com>
    218
  • trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm

    r109147 r110546  
    978978    NSRange range = NSMakeRange(0, request.text().length());
    979979    NSRunLoop* currentLoop = [NSRunLoop currentRunLoop];
     980    int sequence = request.sequence();
     981    TextCheckingTypeMask types = request.mask();
    980982    [[NSSpellChecker sharedSpellChecker] requestCheckingOfString:request.text() range:range types:NSTextCheckingAllSystemTypes options:0 inSpellDocumentWithTag:0
    981983                                         completionHandler:^(NSInteger, NSArray* results, NSOrthography*, NSInteger) {
    982984            [currentLoop performSelector:@selector(perform)
    983                                   target:[[[WebEditorSpellCheckResponder alloc] initWithSender:sender sequence:request.sequence() types:request.mask() results:results] autorelease]
     985                                  target:[[[WebEditorSpellCheckResponder alloc] initWithSender:sender sequence:sequence types:types results:results] autorelease]
    984986                                argument:nil order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
    985987        }];
Note: See TracChangeset for help on using the changeset viewer.