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

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

Issue 2932643003: Move InSameBlock() to InsertParagraphSeparatorCommand.cpp (Closed)
Patch Set: 2017-06-08T17:36:13 Created 3 years, 6 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/VisibleUnits.cpp ('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/InsertParagraphSeparatorCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
index e3c6f79b419b3394ba566234618139004b1da284..7e2d71e0bb139fb119ba0f0817e59ded6200335c 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
@@ -61,6 +61,14 @@ static Element* HighestVisuallyEquivalentDivBelowRoot(Element* start_block) {
return cur_block;
}
+static bool InSameBlock(const VisiblePosition& a, const VisiblePosition& b) {
+ DCHECK(a.IsValid()) << a;
+ DCHECK(b.IsValid()) << b;
+ return !a.IsNull() &&
+ EnclosingBlock(a.DeepEquivalent().ComputeContainerNode()) ==
+ EnclosingBlock(b.DeepEquivalent().ComputeContainerNode());
+}
+
InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand(
Document& document,
bool must_use_default_paragraph_element,
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698