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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnits.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 | « third_party/WebKit/Source/core/editing/VisiblePosition.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 64e14e90d098de8b049eb51b7e28470008ecdbf0..7e2fa2ab4574295da3dcfb4581c3e71d33ac20bf 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -102,7 +102,7 @@ static PositionType canonicalPosition(const PositionType& passedPosition)
return PositionType();
DCHECK(position.document());
- position.document()->updateStyleAndLayoutIgnorePendingStylesheets();
+ DCHECK(!position.document()->needsLayoutTreeUpdate());
Node* node = position.computeContainerNode();
@@ -1240,6 +1240,12 @@ bool inSameLineAlgorithm(const PositionWithAffinityTemplate<Strategy>& position1
{
if (position1.isNull() || position2.isNull())
return false;
+ DCHECK_EQ(position1.position().document(), position2.position().document());
+
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ position1.position().document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
PositionWithAffinityTemplate<Strategy> startOfLine1 = startOfLine(position1);
PositionWithAffinityTemplate<Strategy> startOfLine2 = startOfLine(position2);
if (startOfLine1 == startOfLine2)
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisiblePosition.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698