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

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

Issue 2142903003: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in DocumentMarkerController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now with cool scope thingy. 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.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/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 1c898c525dc5c9c8d5a403062637151d0d85db74..9eccfbddb1dcec1a50c203f9a5a24f57c5adbb16 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -582,10 +582,17 @@ void CompositeEditCommand::replaceTextInNodePreservingMarkers(Text* node, unsign
Vector<DocumentMarker::MarkerType> types;
Vector<String> descriptions;
copyMarkerTypesAndDescriptions(markerController.markersInRange(EphemeralRange(Position(node, offset), Position(node, offset + count)), DocumentMarker::AllMarkers()), types, descriptions);
+
replaceTextInNode(node, offset, count, replacementText);
+
+ // Re-adding markers requires a clean tree.
+ document().updateStyleAndLayout();
+
+ DocumentLifecycle::DisallowTransitionScope(document().lifecycle());
Position startPosition(node, offset);
Position endPosition(node, offset + replacementText.length());
DCHECK_EQ(types.size(), descriptions.size());
+
for (size_t i = 0; i < types.size(); ++i)
markerController.addMarker(startPosition, endPosition, types[i], descriptions[i]);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698