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; |