diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-11 19:54:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-11 19:54:20 +0200 |
commit | 88a04ac016f57c2d78e714682445dff2e7db4ade (patch) | |
tree | a48ca81ee3b29953121308168db22532d5b57fe2 /Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp | |
parent | 284837daa07b29d6a63a748544a90b1f5842ac5c (diff) | |
download | qtwebkit-88a04ac016f57c2d78e714682445dff2e7db4ade.tar.gz |
Imported WebKit commit 42d95198c30c2d1a94a5081181aad0b2be7c316c (http://svn.webkit.org/repository/webkit/trunk@128206)
This includes the rewrite of the configure part of the build system which should fix the QtQuick2 detection
and allow for further simplifications in the future
Diffstat (limited to 'Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp')
-rw-r--r-- | Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp index 7e5d46262..6e8715a5e 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp @@ -338,6 +338,17 @@ static VirtualKeyboardEnterKeyType keyboardEnterKeyTypeAttribute(const WebCore:: return VKBEnterKeyNotSet; } +void InputHandler::setProcessingChange(bool processingChange) +{ + if (processingChange == m_processingChange) + return; + + m_processingChange = processingChange; + + if (!m_processingChange) + m_webPage->m_selectionHandler->inputHandlerDidFinishProcessingChange(); +} + WTF::String InputHandler::elementText() { if (!isActiveTextEdit()) @@ -927,14 +938,24 @@ void InputHandler::spellCheckBlock(VisibleSelection& visibleSelection, TextCheck PassRefPtr<Range> InputHandler::getRangeForSpellCheckWithFineGranularity(VisiblePosition startPosition, VisiblePosition endPosition) { VisiblePosition endOfCurrentWord = endOfWord(startPosition); - RefPtr<Range> rangeForSpellChecking; - while (endOfCurrentWord != endPosition) { - rangeForSpellChecking = VisibleSelection(startPosition, endOfCurrentWord).toNormalizedRange(); - // If we exceed the MaxSpellCheckingStringLength limit, then go back one word and return this range. - if (rangeForSpellChecking->text().length() >= MaxSpellCheckingStringLength) - return VisibleSelection(startPosition, endOfWord(previousWordPosition(endOfCurrentWord))).toNormalizedRange(); - endOfCurrentWord = endOfWord(nextWordPosition(endOfCurrentWord)); + // Keep iterating until one of our cases is hit, or we've incremented the starting position right to the end. + while (startPosition != endPosition) { + // Check the text length within this range. + if (VisibleSelection(startPosition, endOfCurrentWord).toNormalizedRange()->text().length() >= MaxSpellCheckingStringLength) { + // If this is not the first word, return a Range with end boundary set to the previous word. + if (startOfWord(endOfCurrentWord, LeftWordIfOnBoundary) != startPosition) + return VisibleSelection(startPosition, endOfWord(previousWordPosition(endOfCurrentWord), LeftWordIfOnBoundary)).toNormalizedRange(); + + // Our first word has gone over the character limit. Increment the starting position past an uncheckable word. + startPosition = endOfCurrentWord; + } else if (endOfCurrentWord == endPosition) { + // Return the last segment if the end of our word lies at the end of the range. + return VisibleSelection(startPosition, endPosition).toNormalizedRange(); + } else { + // Increment the current word. + endOfCurrentWord = endOfWord(nextWordPosition(endOfCurrentWord)); + } } return 0; } @@ -980,9 +1001,9 @@ bool InputHandler::openColorPopup(HTMLInputElement* element) // Check if popup already exists, close it if does. m_webPage->m_page->chrome()->client()->closePagePopup(0); + ColorPickerClient* client = new ColorPickerClient(element->value(), m_webPage, element); - m_webPage->m_page->chrome()->client()->openPagePopup(client, WebCore::IntRect()); - return true; + return m_webPage->m_page->chrome()->client()->openPagePopup(client, WebCore::IntRect()); } void InputHandler::setInputValue(const WTF::String& value) |