Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 1632673004: Get rid of a redundant parameter ResetCaretBlinkOption from FrameSelection::updateAppearance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-01-26T14:38:54 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index 9e4a90aa5ca09e01b3926c48dab31c791e8a9611..33f6b8007d851688774667939e04a40c23b139de 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -331,7 +331,8 @@ void FrameSelection::setSelectionAlgorithm(const VisibleSelectionTemplate<Strate
if (!(options & DoNotUpdateAppearance)) {
// Hits in compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents.html
DisableCompositingQueryAsserts disabler;
- updateAppearance(ResetCaretBlink);
+ stopCaretBlinkTimer();
+ updateAppearance();
}
// Always clear the x position used for vertical arrow navigation.
@@ -980,7 +981,7 @@ void FrameSelection::commitAppearanceIfNeeded(LayoutView& layoutView)
return m_pendingSelection->commit(layoutView);
}
-void FrameSelection::updateAppearance(ResetCaretBlinkOption option)
+void FrameSelection::updateAppearance()
{
// Paint a block cursor instead of a caret in overtype mode unless the caret is at the end of a line (in this case
// the FrameSelection will paint a blinking caret as usual).
@@ -990,12 +991,8 @@ void FrameSelection::updateAppearance(ResetCaretBlinkOption option)
// If the caret moved, stop the blink timer so we can restart with a
// black caret in the new location.
- if (option == ResetCaretBlink || !shouldBlink || shouldStopBlinkingDueToTypingCommand(m_frame)) {
- m_caretBlinkTimer.stop();
-
- m_shouldPaintCaret = false;
- setCaretRectNeedsUpdate();
- }
+ if (!shouldBlink || shouldStopBlinkingDueToTypingCommand(m_frame))
+ stopCaretBlinkTimer();
// Start blinking with a black caret. Be sure not to restart if we're
// already blinking in the right location.
@@ -1052,6 +1049,13 @@ void FrameSelection::caretBlinkTimerFired(Timer<FrameSelection>*)
setCaretRectNeedsUpdate();
}
+void FrameSelection::stopCaretBlinkTimer()
+{
+ m_caretBlinkTimer.stop();
+ m_shouldPaintCaret = false;
+ setCaretRectNeedsUpdate();
+}
+
void FrameSelection::notifyLayoutObjectOfSelectionChange(EUserTriggered userTriggered)
{
if (HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()))
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698