Chromium Code Reviews| Index: Source/core/dom/Position.cpp |
| diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp |
| index dacff4069ead02e8d5f39e0d2d15bf0d9294ea25..73cbdfa2bde2a5301f165e8c1380bfafbc5efbff 100644 |
| --- a/Source/core/dom/Position.cpp |
| +++ b/Source/core/dom/Position.cpp |
| @@ -1286,6 +1286,19 @@ TextDirection Position::primaryDirection() const |
| return primaryDirection; |
| } |
| +PassRefPtrWillBeRawPtr<Range> makeRange(const Position& start, const Position& end) |
| +{ |
| + if (start.isNull() || end.isNull()) |
| + return nullptr; |
| + |
| + Position s = start.parentAnchoredEquivalent(); |
| + Position e = end.parentAnchoredEquivalent(); |
|
Yuta Kitamura
2014/06/06 08:57:30
What's the point of getting parent-anchored versio
mlamouri (slow - plz ping)
2014/06/06 09:23:15
Removed. I'm calling directly Range::create() inst
|
| + if (s.isNull() || e.isNull()) |
| + return nullptr; |
| + |
| + return Range::create(s.containerNode()->document(), s.containerNode(), s.offsetInContainerNode(), e.containerNode(), e.offsetInContainerNode()); |
| +} |
| + |
| void Position::trace(Visitor* visitor) |
| { |
| visitor->trace(m_anchorNode); |