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

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

Issue 2729823002: Make FormatBlockCommand::elementForFormatBlockCommand() to take EphemeralRange (Closed)
Patch Set: 2017-03-09T13:09:11 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h ('k') | 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/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 e85532bc813cdd65e91ae6b3a0a084a3cf793fbb..ef9aa38619ca0c7e660aeefaa97bda058fb75337 100644
--- a/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp
@@ -139,18 +139,17 @@ void FormatBlockCommand::formatRange(const Position& start,
insertBlockPlaceholder(lastParagraphInBlockNode, editingState);
}
-Element* FormatBlockCommand::elementForFormatBlockCommand(Range* range) {
- if (!range)
- return 0;
-
- Node* commonAncestor = range->commonAncestorContainer();
+Element* FormatBlockCommand::elementForFormatBlockCommand(
+ const EphemeralRange& range) {
+ Node* commonAncestor = range.commonAncestorContainer();
while (commonAncestor && !isElementForFormatBlock(commonAncestor))
commonAncestor = commonAncestor->parentNode();
if (!commonAncestor)
return 0;
- Element* element = rootEditableElement(*range->startContainer());
+ Element* element =
+ rootEditableElement(*range.startPosition().computeContainerNode());
if (!element || commonAncestor->contains(element))
return 0;
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698