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

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

Issue 2414263002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in toNormalizedEphemeralRange (Closed)
Patch Set: fix nit 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/VisibleSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
index 0eee09a79d238487d598111db1374098c6df1a16..17b7cafa73c6632b4c0ed700c3ca1e4a0ef59613 100644
--- a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
@@ -316,13 +316,9 @@ VisibleSelectionTemplate<Strategy>::toNormalizedEphemeralRange() const {
// Make sure we have an updated layout since this function is called
// in the course of running edit commands which modify the DOM.
- // Failing to call this can result in equivalentXXXPosition calls returning
+ // Failing to ensure this can result in equivalentXXXPosition calls returning
// incorrect results.
- m_start.document()->updateStyleAndLayout();
-
- // Check again, because updating layout can clear the selection.
- if (isNone())
- return EphemeralRangeTemplate<Strategy>();
+ DCHECK(!m_start.document()->needsLayoutTreeUpdate());
if (isCaret()) {
// If the selection is a caret, move the range start upstream. This

Powered by Google App Engine
This is Rietveld 408576698