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

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

Issue 2399773002: Prune deprecated functions from BreakBlockquoteCommand (Closed)
Patch Set: Rebased 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
index 7e872960c7d66f6b942c734563e5e9f102e2d52f..efccf08bd54d02d458f49661989a2e59d2b4f0f4 100644
--- a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
@@ -93,7 +93,9 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
if (endingSelection().isNone())
return;
- VisiblePosition visiblePos = endingSelection().visibleStartDeprecated();
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
+ VisiblePosition visiblePos = endingSelection().visibleStart();
// pos is a position equivalent to the caret. We use downstream() so that pos
// will be in the first node that we need to move (there are a few exceptions
@@ -119,7 +121,8 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
insertNodeBefore(breakElement, topBlockquote, editingState);
if (editingState->isAborted())
return;
- setEndingSelection(createVisibleSelectionDeprecated(
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+ setEndingSelection(createVisibleSelection(
Position::beforeNode(breakElement), TextAffinity::Downstream,
endingSelection().isDirectional()));
rebalanceWhitespace();
@@ -131,10 +134,12 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
if (editingState->isAborted())
return;
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
// If we're inserting the break at the end of the quoted content, we don't
// need to break the quote.
if (isLastVisPosInNode) {
- setEndingSelection(createVisibleSelectionDeprecated(
+ setEndingSelection(createVisibleSelection(
Position::beforeNode(breakElement), TextAffinity::Downstream,
endingSelection().isDirectional()));
rebalanceWhitespace();
@@ -148,7 +153,7 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
}
// Adjust the position so we don't split at the beginning of a quote.
- while (isFirstVisiblePositionInNode(createVisiblePositionDeprecated(pos),
+ while (isFirstVisiblePositionInNode(createVisiblePosition(pos),
toHTMLQuoteElement(enclosingNodeOfType(
pos, isMailHTMLBlockquoteElement)))) {
pos = previousPositionOf(pos, PositionMoveType::GraphemeCluster);
@@ -177,8 +182,9 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
// If there's nothing inside topBlockquote to move, we're finished.
if (!startNode->isDescendantOf(topBlockquote)) {
- setEndingSelection(createVisibleSelectionDeprecated(
- createVisiblePositionDeprecated(firstPositionInOrBeforeNode(startNode)),
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+ setEndingSelection(createVisibleSelection(
+ createVisiblePosition(firstPositionInOrBeforeNode(startNode)),
endingSelection().isDirectional()));
return;
}
@@ -259,10 +265,12 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
if (editingState->isAborted())
return;
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
// Put the selection right before the break.
- setEndingSelection(createVisibleSelectionDeprecated(
- Position::beforeNode(breakElement), TextAffinity::Downstream,
- endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelection(Position::beforeNode(breakElement),
+ TextAffinity::Downstream,
+ endingSelection().isDirectional()));
rebalanceWhitespace();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698