Changeset 128183 in webkit
- Timestamp:
- Sep 11, 2012 7:30:18 AM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/ChangeLog
r128142 r128183 1 2012-09-11 Arvid Nilsson <anilsson@rim.com> 2 3 [BlackBerry] SelectionHandler drops caret change notifications 4 https://bugs.webkit.org/show_bug.cgi?id=96378 5 6 Reviewed by Antonio Gomes. 7 8 The selection handler deliberately drops caret change notifications 9 while the input handler is processing changes, to avoid displaying 10 intermediate state during a complex change. 11 12 However, this meant that the client was never informed of the final 13 caret position. 14 15 Fixed by notifying client about caret change after processing ends, if 16 one or more caret change notifications were dropped during processing. 17 18 PR #205073 19 20 Reviewed internally by Mike Fenton. 21 22 * WebKitSupport/InputHandler.cpp: 23 (BlackBerry::WebKit::InputHandler::setProcessingChange): 24 (WebKit): 25 * WebKitSupport/InputHandler.h: 26 (InputHandler): 27 * WebKitSupport/SelectionHandler.cpp: 28 (BlackBerry::WebKit::SelectionHandler::SelectionHandler): 29 (BlackBerry::WebKit::SelectionHandler::inputHandlerDidFinishProcessingChange): 30 (WebKit): 31 (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged): 32 (BlackBerry::WebKit::SelectionHandler::notifyCaretPositionChangedIfNeeded): 33 * WebKitSupport/SelectionHandler.h: 34 (SelectionHandler): 35 1 36 2012-09-10 Antonio Gomes <agomes@rim.com> 2 37 -
trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
r127817 r128183 339 339 } 340 340 341 void InputHandler::setProcessingChange(bool processingChange) 342 { 343 if (processingChange == m_processingChange) 344 return; 345 346 m_processingChange = processingChange; 347 348 if (!m_processingChange) 349 m_webPage->m_selectionHandler->inputHandlerDidFinishProcessingChange(); 350 } 351 341 352 WTF::String InputHandler::elementText() 342 353 { -
trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
r126925 r128183 111 111 112 112 bool processingChange() const { return m_processingChange; } 113 void setProcessingChange(bool processingChange) { m_processingChange = processingChange; }113 void setProcessingChange(bool); 114 114 115 115 WTF::String elementText(); -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
r127894 r128183 71 71 , m_caretActive(false) 72 72 , m_lastUpdatedEndPointIsValid(false) 73 , m_didSuppressCaretPositionChangedNotification(false) 73 74 { 74 75 } … … 269 270 270 271 SelectionLog(LogLevelInfo, "SelectionHandler::setCaretPosition point valid, cursor updated"); 272 } 273 274 void SelectionHandler::inputHandlerDidFinishProcessingChange() 275 { 276 if (m_didSuppressCaretPositionChangedNotification) 277 notifyCaretPositionChangedIfNeeded(); 271 278 } 272 279 … … 854 861 if (m_webPage->m_inputHandler->isInputMode() && m_webPage->m_inputHandler->processingChange()) { 855 862 m_webPage->m_client->cancelSelectionVisuals(); 856 return; 857 } 858 859 if (m_caretActive || (m_webPage->m_inputHandler->isInputMode() && m_webPage->focusedOrMainFrame()->selection()->isCaret())) { 860 // This may update the caret to no longer be active. 861 caretPositionChanged(); 862 } 863 864 // Since we're not calling notifyCaretPositionChangedIfNeeded now, we have to do so at the end of processing 865 // to avoid dropping a notification. 866 m_didSuppressCaretPositionChangedNotification = true; 867 return; 868 } 869 870 notifyCaretPositionChangedIfNeeded(); 863 871 864 872 // Enter selection mode if selection type is RangeSelection, and disable selection if … … 949 957 } 950 958 959 960 void SelectionHandler::notifyCaretPositionChangedIfNeeded() 961 { 962 m_didSuppressCaretPositionChangedNotification = false; 963 964 if (m_caretActive || (m_webPage->m_inputHandler->isInputMode() && m_webPage->focusedOrMainFrame()->selection()->isCaret())) { 965 // This may update the caret to no longer be active. 966 caretPositionChanged(); 967 } 968 } 969 951 970 // NOTE: This function is not in WebKit coordinates. 952 971 void SelectionHandler::caretPositionChanged() -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h
r124050 r128183 72 72 bool lastUpdatedEndPointIsValid() const { return m_lastUpdatedEndPointIsValid; } 73 73 74 void inputHandlerDidFinishProcessingChange(); 75 74 76 private: 77 void notifyCaretPositionChangedIfNeeded(); 75 78 void caretPositionChanged(); 76 79 void regionForTextQuads(WTF::Vector<WebCore::FloatQuad>&, BlackBerry::Platform::IntRectRegion&, bool shouldClipToVisibleContent = true) const; … … 90 93 bool m_caretActive; 91 94 bool m_lastUpdatedEndPointIsValid; 95 bool m_didSuppressCaretPositionChangedNotification; 92 96 BlackBerry::Platform::IntRectRegion m_lastSelectionRegion; 93 97
Note: See TracChangeset
for help on using the changeset viewer.