Changeset 118740 in webkit


Ignore:
Timestamp:
May 29, 2012 2:10:41 AM (12 years ago)
Author:
hbono@chromium.org
Message:

Use WebSpellCheckClient::spellcheck to retrieve suggestions.
https://bugs.webkit.org/show_bug.cgi?id=87690

Reviewed by Hajime Morita.

This change uses WebSpellCheckClient::spellcheck as a fallback method to
retrieve suggestions when a marker does not have any suggestions. (It consumes
lots of CPU power to get suggestions for misspelled word, i.e. Chromium cannot
afford to attach suggestions to all spelling markers.)

  • src/ContextMenuClientImpl.cpp:

(WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): Retrieve suggestions if markers do not have any.

Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r118723 r118740  
     12012-05-29  Hironori Bono  <hbono@chromium.org>
     2
     3        Use WebSpellCheckClient::spellcheck to retrieve suggestions.
     4        https://bugs.webkit.org/show_bug.cgi?id=87690
     5
     6        Reviewed by Hajime Morita.
     7
     8        This change uses WebSpellCheckClient::spellcheck as a fallback method to
     9        retrieve suggestions when a marker does not have any suggestions. (It consumes
     10        lots of CPU power to get suggestions for misspelled word, i.e. Chromium cannot
     11        afford to attach suggestions to all spelling markers.)
     12
     13        * src/ContextMenuClientImpl.cpp:
     14        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): Retrieve suggestions if markers do not have any.
     15
    1162012-05-28  Takashi Toyoshima  <toyoshim@chromium.org>
    217
  • trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp

    r118479 r118740  
    291291                        }
    292292                    }
    293                     data.dictionarySuggestions = suggestions;
    294293                    data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
     294                    if (!suggestions.isEmpty())
     295                        data.dictionarySuggestions = suggestions;
     296                    else if (m_webView->spellCheckClient()) {
     297                        int misspelledOffset, misspelledLength;
     298                        m_webView->spellCheckClient()->spellCheck(data.misspelledWord, misspelledOffset, misspelledLength, &data.dictionarySuggestions);
     299                    }
    295300                }
    296301            }
Note: See TracChangeset for help on using the changeset viewer.