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

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

Issue 2332723002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in canonicalPosition (Closed)
Patch Set: Change if to DCHECK Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/VisiblePosition.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisiblePosition.cpp b/third_party/WebKit/Source/core/editing/VisiblePosition.cpp
index 96df893fd0da153e1c29f0650eae693f937bc1a1..efe277be9972a9c7953cca7536689b38654a22b8 100644
--- a/third_party/WebKit/Source/core/editing/VisiblePosition.cpp
+++ b/third_party/WebKit/Source/core/editing/VisiblePosition.cpp
@@ -60,6 +60,15 @@ VisiblePositionTemplate<Strategy> VisiblePositionTemplate<Strategy>::create(cons
if (positionWithAffinity.isNull())
return VisiblePositionTemplate<Strategy>();
DCHECK(positionWithAffinity.position().isConnected()) << positionWithAffinity;
+
+ Document& document = *positionWithAffinity.position().document();
+
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ document.updateStyleAndLayoutIgnorePendingStylesheets();
+
+ DocumentLifecycle::DisallowTransitionScope disallowTransition(document.lifecycle());
+
const PositionTemplate<Strategy> deepPosition = canonicalPositionOf(positionWithAffinity.position());
if (deepPosition.isNull())
return VisiblePositionTemplate<Strategy>();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698