Changeset 102413 in webkit
- Timestamp:
- Dec 8, 2011 6:28:27 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102410 r102413 1 2011-12-08 Van Lam <vanlam@google.com> 2 3 Caret keeps blinking during forward-delete 4 https://bugs.webkit.org/show_bug.cgi?id=38564 5 6 Reviewed by Darin Adler. 7 8 Currently updateAppearance determines if the caret should stop blinking 9 based on whether or not the editing operation changed the position of 10 the caret; so the caret stops blinking in case of typing text and 11 backwards delete (which always displace the caret) but does not stop 12 blinking in the case of forward delete (which does not displace the 13 caret). 14 15 Added a boolean member function shouldStopCaretBlinking in EditCommand 16 which will return true if the object is a TypingCommand (my 17 understanding here is that all TypingCommands should stop the caret 18 from blinking for a cycle, currently 0.5 seconds). Then used this 19 function to stop the caret from blinking if the last editing command 20 is a TypingCommand. 21 22 * editing/EditCommand.h: 23 (WebCore::EditCommand::shouldStopCaretBlinking): 24 * editing/FrameSelection.cpp: 25 (WebCore::FrameSelection::updateAppearance): 26 * editing/TypingCommand.h: 27 (WebCore::TypingCommand::shouldStopCaretBlinking): 28 1 29 2011-12-08 Adam Klein <adamk@chromium.org> 2 30 -
trunk/Source/WebCore/editing/EditCommand.h
r102357 r102413 66 66 virtual bool shouldRetainAutocorrectionIndicator() const; 67 67 virtual void setShouldRetainAutocorrectionIndicator(bool); 68 virtual bool shouldStopCaretBlinking() const { return false; } 68 69 69 70 protected: -
trunk/Source/WebCore/editing/FrameSelection.cpp
r102252 r102413 1657 1657 bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled(); 1658 1658 bool shouldBlink = caretIsVisible() && isCaret() && (isContentEditable() || caretBrowsing); 1659 1660 EditCommand* lastEditCommand = m_frame ? m_frame->editor()->lastEditCommand() : 0; 1661 bool shouldStopBlinkingDueToTypingCommand = lastEditCommand && lastEditCommand->shouldStopCaretBlinking(); 1659 1662 1660 1663 // If the caret moved, stop the blink timer so we can restart with a 1661 1664 // black caret in the new location. 1662 if (caretRectChanged || !shouldBlink )1665 if (caretRectChanged || !shouldBlink || shouldStopBlinkingDueToTypingCommand) 1663 1666 m_caretBlinkTimer.stop(); 1664 1667 -
trunk/Source/WebCore/editing/TypingCommand.h
r102225 r102413 104 104 virtual bool shouldRetainAutocorrectionIndicator() const { return m_shouldRetainAutocorrectionIndicator; } 105 105 virtual void setShouldRetainAutocorrectionIndicator(bool retain) { m_shouldRetainAutocorrectionIndicator = retain; } 106 virtual bool shouldStopCaretBlinking() const { return true; } 106 107 void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellChecking = prevent; } 107 108
Note: See TracChangeset
for help on using the changeset viewer.