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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 3 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/ApplyBlockElementCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
index eb76b9898a3349727c647a127620d83f97bcce2d..7637e37afb66b1fff908e116c22bea9b2d363542 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
@@ -73,7 +73,7 @@ void ApplyBlockElementCommand::doApply(EditingState* editingState)
// margin/padding, but not others. We should make the gap painting more
// consistent and then use a left margin/padding rule here.
if (visibleEnd.deepEquivalent() != visibleStart.deepEquivalent() && isStartOfParagraphDeprecated(visibleEnd)) {
- VisibleSelection newSelection(visibleStart, previousPositionOf(visibleEnd, CannotCrossEditingBoundary), endingSelection().isDirectional());
+ VisibleSelection newSelection = createVisibleSelectionDeprecated(visibleStart, previousPositionOf(visibleEnd, CannotCrossEditingBoundary), endingSelection().isDirectional());
if (newSelection.isNone())
return;
setEndingSelection(newSelection);
@@ -102,7 +102,7 @@ void ApplyBlockElementCommand::doApply(EditingState* editingState)
VisiblePosition start(visiblePositionForIndex(startIndex, startScope));
VisiblePosition end(visiblePositionForIndex(endIndex, endScope));
if (start.isNotNull() && end.isNotNull())
- setEndingSelection(VisibleSelection(start, end, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(start, end, endingSelection().isDirectional()));
}
}
@@ -126,7 +126,7 @@ void ApplyBlockElementCommand::formatSelection(const VisiblePosition& startOfSel
appendNode(placeholder, blockquote, editingState);
if (editingState->isAborted())
return;
- setEndingSelection(VisibleSelection(Position::beforeNode(placeholder), TextAffinity::Downstream, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(Position::beforeNode(placeholder), TextAffinity::Downstream, endingSelection().isDirectional()));
return;
}

Powered by Google App Engine
This is Rietveld 408576698