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

Unified Diff: Source/core/editing/Caret.cpp

Issue 431983005: FrameSelection::updateApperance for caret should not cause layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test failures Created 6 years, 4 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: Source/core/editing/Caret.cpp
diff --git a/Source/core/editing/Caret.cpp b/Source/core/editing/Caret.cpp
index 4b8ae4aa90f15136e1eb283945b84ae0b462d57b..06424f29cea82ea09e9d712c7592ef1c9382e5df 100644
--- a/Source/core/editing/Caret.cpp
+++ b/Source/core/editing/Caret.cpp
@@ -70,10 +70,12 @@ void DragCaretController::setCaretPosition(const VisiblePosition& position)
invalidateCaretRect(node);
document = &node->document();
}
- if (m_position.isNull() || m_position.isOrphan())
+ if (m_position.isNull() || m_position.isOrphan()) {
clearCaretRect();
- else
+ } else {
+ document->updateRenderTreeIfNeeded();
updateCaretRect(document, m_position);
+ }
}
static bool removingNodeRemovesPosition(Node& node, const Position& position)
@@ -134,7 +136,6 @@ RenderBlock* CaretBase::caretRenderer(Node* node)
bool CaretBase::updateCaretRect(Document* document, const PositionWithAffinity& caretPosition)
{
- document->updateRenderTreeIfNeeded();
m_caretLocalRect = LayoutRect();
m_caretRectNeedsUpdate = false;
« no previous file with comments | « LayoutTests/fast/repaint/paint-caret-in-div-with-negative-indent-expected.txt ('k') | Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698