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

Unified Diff: third_party/WebKit/Source/core/editing/EphemeralRange.cpp

Issue 2725603002: createFragmentFromMarkupWithContext() should use EphemeralRange. (Closed)
Patch Set: Created 3 years, 10 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/EphemeralRange.cpp
diff --git a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
index 641d8b1fabc3f86d48086de4d370729b5ff2d0e4..275f4917904044c5734a2aadbb4785aa0fd96285 100644
--- a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
+++ b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
@@ -109,6 +109,20 @@ PositionTemplate<Strategy> EphemeralRangeTemplate<Strategy>::endPosition()
}
template <typename Strategy>
+Node* EphemeralRangeTemplate<Strategy>::commonAncestorContainer() const
+{
+ return commonAncestorContainer(m_startPosition.computeContainerNode(), m_endPosition.computeContainerNode());
+}
+
+template <typename Strategy>
+Node* EphemeralRangeTemplate<Strategy>::commonAncestorContainer(const Node* containerA, const Node* containerB)
+{
+ if (!containerA || !containerB)
+ return nullptr;
+ return containerA->commonAncestor(*containerB, NodeTraversal::parent);
Xiaocheng 2017/02/28 19:26:31 Should return |Strategy::commonAncestor(*container
tanvir 2017/03/02 14:59:14 Done.
+}
+
+template <typename Strategy>
bool EphemeralRangeTemplate<Strategy>::isCollapsed() const {
DCHECK(isValid());
return m_startPosition == m_endPosition;

Powered by Google App Engine
This is Rietveld 408576698