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

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

Issue 2415613003: Ensure clean layout for all (but deprecated) functions creating VisiblePositions (Closed)
Patch Set: Created 4 years, 2 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 8eb0a68903c3f44877963fd63a676222468c6d78..2242aaecc2ae818d1407ca041066d4f19fa182e4 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -627,6 +627,8 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(
AtomicString(newInlineStyle->style()->asText()));
}
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
// FIXME: Tolerate differences in id, class, and style attributes.
if (element->parentNode() && isNonTableCellHTMLBlockElement(element) &&
areIdenticalElements(*element, *element->parentNode()) &&
@@ -1475,6 +1477,7 @@ void ReplaceSelectionCommand::doApply(EditingState* editingState) {
return;
}
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
if (endBR &&
(plainTextFragment ||
(shouldRemoveEndBR(endBR, originalVisPosBeforeEndBR) &&
@@ -1611,6 +1614,7 @@ void ReplaceSelectionCommand::doApply(EditingState* editingState) {
if (editingState->isAborted())
return;
}
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
setEndingSelection(
VisiblePosition::afterNode(insertedNodes.lastLeafInserted()));
// Select up to the paragraph separator that was added.
@@ -1625,6 +1629,7 @@ void ReplaceSelectionCommand::doApply(EditingState* editingState) {
insertNodeAfter(newListItem, enclosingBlockElement, editingState);
if (editingState->isAborted())
return;
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
setEndingSelection(VisiblePosition::firstPositionInNode(newListItem));
} else {
// Use a default paragraph element (a plain div) for the empty

Powered by Google App Engine
This is Rietveld 408576698