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

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

Issue 2650633002: Move CaretBase::invalidateCaretRect() to DragCaretController (Closed)
Patch Set: 2017-01-23T13:45:50 Created 3 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/DragCaretController.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/DragCaretController.cpp
diff --git a/third_party/WebKit/Source/core/editing/DragCaretController.cpp b/third_party/WebKit/Source/core/editing/DragCaretController.cpp
index 0ea817ca90ad3efcd4fff33d4df25c0cfa5652be..01eb293f380512962c9936a68b3bc5ecd62e543c 100644
--- a/third_party/WebKit/Source/core/editing/DragCaretController.cpp
+++ b/third_party/WebKit/Source/core/editing/DragCaretController.cpp
@@ -53,6 +53,19 @@ bool DragCaretController::isContentRichlyEditable() const {
return isRichlyEditablePosition(m_position.position());
}
+void DragCaretController::invalidateCaretRect(
+ Node* node,
+ const LayoutRect& caretLocalRect) {
+ // TODO(editing-dev): The use of updateStyleAndLayout
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // In the long term we should use idle time spell checker to prevent
+ // synchronous layout caused by spell checking (see crbug.com/517298).
+ node->document().updateStyleAndLayoutTree();
+ if (!hasEditableStyle(*node))
+ return;
+ m_caretBase->invalidateLocalCaretRect(node, caretLocalRect);
+}
+
void DragCaretController::setCaretPosition(
const PositionWithAffinity& position) {
// for querying Layer::compositingState()
@@ -61,11 +74,11 @@ void DragCaretController::setCaretPosition(
DisableCompositingQueryAsserts disabler;
if (Node* node = m_position.anchorNode())
- m_caretBase->invalidateCaretRect(node, m_caretLocalRect);
+ invalidateCaretRect(node, m_caretLocalRect);
m_position = createVisiblePosition(position).toPositionWithAffinity();
Document* document = nullptr;
if (Node* node = m_position.anchorNode()) {
- m_caretBase->invalidateCaretRect(node, m_caretLocalRect);
+ invalidateCaretRect(node, m_caretLocalRect);
document = &node->document();
setContext(document);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/DragCaretController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698