Changeset 152369 in webkit


Ignore:
Timestamp:
Jul 3, 2013 11:06:00 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

WebTextCheckerClient doesn't initialize output arguments.
https://bugs.webkit.org/show_bug.cgi?id=83683

Patch by Simon Pena <simon.pena@samsung.com> on 2013-07-03
Reviewed by Martin Robinson.

Source/WebKit2:

Callers of checkSpellingOfString and checkGrammarOfString expect
certain default values when no misspelled (or bad grammar) string
is found. They try to do that by initialising the reply arguments
that go into the IPC calls, but these values are ultimately ignored (see
HandleMessage.h, where the replyArguments are declared).

In the past, this seems to have led to various issues, (see
TextCheckingHelper::findFirstMisspelling in TextCheckingHelper.cpp),
where these return values are asserted and checked to be in the right range.

This patch initialises the values, so even if no available client
implements the methods (or if the implementation forgets to do it) the callers
will have their expected output.

However, and for a general case, we probably need a way to tell the caller
that any existing value in the output arguments will be ignored.

  • UIProcess/WebTextCheckerClient.cpp:

(WebKit::WebTextCheckerClient::checkSpellingOfString):
(WebKit::WebTextCheckerClient::checkGrammarOfString):

LayoutTests:

Unskip editing/pasteboard/pasting-empty-html-falls-back-to-text.html, which no longer
crashes after the fix.

  • platform/gtk-wk2/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152342 r152369  
     12013-07-03  Simon Pena  <simon.pena@samsung.com>
     2
     3        WebTextCheckerClient doesn't initialize output arguments.
     4        https://bugs.webkit.org/show_bug.cgi?id=83683
     5
     6        Reviewed by Martin Robinson.
     7
     8        Unskip editing/pasteboard/pasting-empty-html-falls-back-to-text.html, which no longer
     9        crashes after the fix.
     10
     11        * platform/gtk-wk2/TestExpectations:
     12
    1132013-07-03  Gabor Abraham  <abrhm@inf.u-szeged.hu>
    214
  • trunk/LayoutTests/platform/gtk-wk2/TestExpectations

    r152160 r152369  
    229229
    230230webkit.org/b/116974 accessibility/title-ui-element-correctness.html [ Crash ]
    231 
    232 webkit.org/b/83683 [ Debug ] editing/pasteboard/pasting-empty-html-falls-back-to-text.html [ Crash ]
    233231
    234232webkit.org/b/108363 fullscreen/full-screen-iframe-legacy.html [ Crash ]
  • trunk/Source/WebKit2/ChangeLog

    r152367 r152369  
     12013-07-03  Simon Pena  <simon.pena@samsung.com>
     2
     3        WebTextCheckerClient doesn't initialize output arguments.
     4        https://bugs.webkit.org/show_bug.cgi?id=83683
     5
     6        Reviewed by Martin Robinson.
     7
     8        Callers of checkSpellingOfString and checkGrammarOfString expect
     9        certain default values when no misspelled (or bad grammar) string
     10        is found. They try to do that by initialising the reply arguments
     11        that go into the IPC calls, but these values are ultimately ignored (see
     12        HandleMessage.h, where the replyArguments are declared).
     13
     14        In the past, this seems to have led to various issues, (see
     15        TextCheckingHelper::findFirstMisspelling in TextCheckingHelper.cpp),
     16        where these return values are asserted and checked to be in the right range.
     17
     18        This patch initialises the values, so even if no available client
     19        implements the methods (or if the implementation forgets to do it) the callers
     20        will have their expected output.
     21
     22        However, and for a general case, we probably need a way to tell the caller
     23        that any existing value in the output arguments will be ignored.
     24
     25        * UIProcess/WebTextCheckerClient.cpp:
     26        (WebKit::WebTextCheckerClient::checkSpellingOfString):
     27        (WebKit::WebTextCheckerClient::checkGrammarOfString):
     28
    1292013-07-03  Sergio Villar Senin  <svillar@igalia.com>
    230
  • trunk/Source/WebKit2/UIProcess/WebTextCheckerClient.cpp

    r96858 r152369  
    9494void WebTextCheckerClient::checkSpellingOfString(uint64_t tag, const String& text, int32_t& misspellingLocation, int32_t& misspellingLength)
    9595{
     96    misspellingLocation = -1;
     97    misspellingLength = 0;
     98
    9699    if (!m_client.checkSpellingOfString)
    97100        return;
     
    102105void WebTextCheckerClient::checkGrammarOfString(uint64_t tag, const String& text, Vector<WebCore::GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
    103106{
     107    badGrammarLocation = -1;
     108    badGrammarLength = 0;
     109
    104110    if (!m_client.checkGrammarOfString)
    105111        return;
Note: See TracChangeset for help on using the changeset viewer.