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

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

Issue 2623103003: [Experiment] DCHECK clean layout tree in mostForward/BackwardCaretPosition (Closed)
Patch Set: Wed Jan 11 14:41:30 JST 2017 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/FrameSelection.cpp ('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/VisibleUnits.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index 02aa28ad9febd56dfd8818de2bec1b76af3997b5..1c7bc8bf2184903859299416aeaaee20b540c408 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -2821,6 +2821,8 @@ static PositionTemplate<Strategy> mostBackwardCaretPosition(
if (!startNode)
return PositionTemplate<Strategy>();
+ if (!startNode->document().frame()->selection().inUpdateSelectionIfNeeded())
+ DCHECK(!startNode->document().needsLayoutTreeUpdate());
// iterate backward from there, looking for a qualified position
Node* boundary = enclosingVisualBoundary<Strategy>(startNode);
// FIXME: PositionIterator should respect Before and After positions.
@@ -2995,6 +2997,8 @@ PositionTemplate<Strategy> mostForwardCaretPosition(
if (!startNode)
return PositionTemplate<Strategy>();
+ if (!startNode->document().frame()->selection().inUpdateSelectionIfNeeded())
+ DCHECK(!startNode->document().needsLayoutTreeUpdate());
// iterate forward from there, looking for a qualified position
Node* boundary = enclosingVisualBoundary<Strategy>(startNode);
// FIXME: PositionIterator should respect Before and After positions.
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698