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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp

Issue 2705373002: Remove unnecessary layout updates from InsertInto/DeleteFromTextNodeCommand (Closed)
Patch Set: Add layout updates for clients requiring that explicitly Created 3 years, 10 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/commands/ReplaceSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index 114e8543491a09cf284e8fc10fe4fc55a10228b0..be050c577b543684bebcf2db806d8497d7d3345c 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -950,7 +950,11 @@ void ReplaceSelectionCommand::mergeEndIfNeeded(EditingState* editingState) {
editingState);
if (editingState->isAborted())
return;
+
+ // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets()
+ // needs to be audited. See http://crbug.com/590369 for more details.
document().updateStyleAndLayoutIgnorePendingStylesheets();
+
destination = VisiblePosition::beforeNode(placeholder);
startOfParagraphToMove =
createVisiblePosition(startOfParagraphToMove.toPositionWithAffinity());
@@ -1988,6 +1992,8 @@ bool ReplaceSelectionCommand::performTrivialReplace(
if (end.isNull())
return false;
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
if (nodeAfterInsertionPos && nodeAfterInsertionPos->parentNode() &&
isHTMLBRElement(*nodeAfterInsertionPos) &&
shouldRemoveEndBR(toHTMLBRElement(nodeAfterInsertionPos),

Powered by Google App Engine
This is Rietveld 408576698