| Index: Source/core/dom/Position.cpp
|
| diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
|
| index cbb1e1ed590b43906b54a9ec21e46e5ba0e69d7a..851407716b77748218f4557be5b50b7315d7e118 100644
|
| --- a/Source/core/dom/Position.cpp
|
| +++ b/Source/core/dom/Position.cpp
|
| @@ -320,6 +320,16 @@ Node* PositionAlgorithm<Strategy>::nodeAsRangeFirstNode() const
|
| return Strategy::nextSkippingChildren(*m_anchorNode);
|
| }
|
|
|
| +template <typename Strategy>
|
| +Node* PositionAlgorithm<Strategy>::nodeAsRangeLastNode() const
|
| +{
|
| + if (isNull())
|
| + return nullptr;
|
| + if (Node* pastLastNode = nodeAsRangePastLastNode())
|
| + return Strategy::previous(*pastLastNode);
|
| + return &Strategy::lastWithinOrSelf(*containerNode());
|
| +}
|
| +
|
| // An implementation of |Range::pastLastNode()|.
|
| template <typename Strategy>
|
| Node* PositionAlgorithm<Strategy>::nodeAsRangePastLastNode() const
|
|
|