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

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

Issue 2426513002: Prune createVisiblePositionDeprecated (Closed)
Patch Set: Created 4 years, 2 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
Index: third_party/WebKit/Source/core/editing/FrameCaret.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameCaret.cpp b/third_party/WebKit/Source/core/editing/FrameCaret.cpp
index 9fd6cd2de747ae369ebb45ae5ca62a23ff8a0349..34d6350969a6b7753b0c4bf66b73d21557ddcc0c 100644
--- a/third_party/WebKit/Source/core/editing/FrameCaret.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameCaret.cpp
@@ -81,9 +81,17 @@ void FrameCaret::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).
- bool paintBlockCursor =
- m_shouldShowBlockCursor && isActive() &&
- !isLogicalEndOfLine(createVisiblePositionDeprecated(caretPosition()));
+ bool paintBlockCursor = m_shouldShowBlockCursor && isActive();
+ if (paintBlockCursor) {
+ // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. see http://crbug.com/590369 for more details.
+ // In the long term, we should defer the update of the caret's appearance
+ // to prevent synchronous layout.
+ m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
+ if (isLogicalEndOfLine(createVisiblePosition(caretPosition())))
+ paintBlockCursor = false;
+ }
bool shouldBlink = !paintBlockCursor && shouldBlinkCaret();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Range.cpp ('k') | third_party/WebKit/Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698