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

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

Issue 2003793002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in PlainTextRange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated some comments. Created 4 years, 5 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/CompositeEditCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
index ae58cce1d8a8334d62d187c27a89cbe1347474b4..941d250336b3dc915246ef6fff597859216bd0a9 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -1365,6 +1365,10 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
Element* documentElement = document().documentElement();
if (!documentElement)
return;
+
+ // We need clean layout in order to compute plain-text ranges below.
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
// Fragment creation (using createMarkup) incorrectly uses regular spaces
// instead of nbsps for some spaces that were rendered (11475), which causes
// spaces to be collapsed during the move operation. This results in a call

Powered by Google App Engine
This is Rietveld 408576698