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

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

Issue 2338233003: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in previous/nextLinePosition (Closed)
Patch Set: Rebased 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/SelectionModifier.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionModifier.cpp b/third_party/WebKit/Source/core/editing/SelectionModifier.cpp
index 9445d8f9a1f7f5fdc946ff040beabe4b49d02032..d40e8c706628e731ce1b21819f64f9a52a19b06e 100644
--- a/third_party/WebKit/Source/core/editing/SelectionModifier.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionModifier.cpp
@@ -532,6 +532,12 @@ static void setSelectionStart(VisibleSelection* selection, const VisiblePosition
bool SelectionModifier::modify(EAlteration alter, SelectionDirection direction, TextGranularity granularity)
{
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
+ DocumentLifecycle::DisallowTransitionScope disallowTransition(frame()->document()->lifecycle());
+
willBeModified(alter, direction);
bool wasRange = m_selection.isRange();
@@ -636,6 +642,9 @@ bool SelectionModifier::modifyWithPageGranularity(EAlteration alter, unsigned ve
if (!verticalDistance)
return false;
+ DCHECK(!frame()->document()->needsLayoutTreeUpdate());
+ DocumentLifecycle::DisallowTransitionScope disallowTransition(frame()->document()->lifecycle());
+
willBeModified(alter, direction == FrameSelection::DirectionUp ? DirectionBackward : DirectionForward);
VisiblePosition pos;
« 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