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

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

Issue 2788473003: Use EphmeralRange insteadof Range in CompositeEditCommands::isNodeVisiblyContainedWithin()
Patch Set: update Created 3 years, 9 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/FormatBlockCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp b/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp
index ef9aa38619ca0c7e660aeefaa97bda058fb75337..24a81d210d3e7d6d00d819e412bb1cede8eef6c7 100644
--- a/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp
@@ -84,7 +84,7 @@ void FormatBlockCommand::formatRange(const Position& start,
? start.anchorNode()
: splitTreeToNode(start.anchorNode(), nodeToSplitTo);
Node* nodeAfterInsertionPosition = outerBlock;
- Range* range = Range::create(document(), start, endOfSelection);
+ const EphemeralRange range = EphemeralRange(start, endOfSelection);
document().updateStyleAndLayoutIgnorePendingStylesheets();
if (isElementForFormatBlock(refElement->tagQName()) &&
@@ -92,7 +92,7 @@ void FormatBlockCommand::formatRange(const Position& start,
startOfBlock(createVisiblePosition(start)).deepEquivalent() &&
(createVisiblePosition(end).deepEquivalent() ==
endOfBlock(createVisiblePosition(end)).deepEquivalent() ||
- isNodeVisiblyContainedWithin(*refElement, *range)) &&
+ isNodeVisiblyContainedWithin(*refElement, range)) &&
refElement != root && !root->isDescendantOf(refElement)) {
// Already in a block element that only contains the current paragraph
if (refElement->hasTagName(tagName()))

Powered by Google App Engine
This is Rietveld 408576698