| Index: Source/core/dom/Position.h
|
| diff --git a/Source/core/dom/Position.h b/Source/core/dom/Position.h
|
| index b29bca737b8a3dabe204e9fa67aff1cfa8279ea3..2fbcab9f245c343415cab4042dabcd3dbcde3c71 100644
|
| --- a/Source/core/dom/Position.h
|
| +++ b/Source/core/dom/Position.h
|
| @@ -105,6 +105,12 @@ public:
|
| int computeOffsetInContainerNode() const; // O(n) for before/after-anchored positions, O(1) for parent-anchored positions
|
| Position parentAnchoredEquivalent() const; // Convenience method for DOM positions that also fixes up some positions for editing
|
|
|
| + // Returns |PositionIsAnchor| type |Position| which is compatible with
|
| + // |RangeBoundaryPoint| as safe to pass |Range| constructor. Return value
|
| + // of this function is different from |parentAnchoredEquivalent()| which
|
| + // returns editing specific position.
|
| + Position toOffsetInAnchor() const;
|
| +
|
| // Inline O(1) access for Positions which callers know to be parent-anchored
|
| int offsetInContainerNode() const
|
| {
|
| @@ -124,6 +130,16 @@ public:
|
| Node* computeNodeBeforePosition() const;
|
| Node* computeNodeAfterPosition() const;
|
|
|
| + // Returns node as |Range::firstNode()|. This position must be a
|
| + // |PositionIs::OffsetInAhcor| to behave as |Range| boundary point.
|
| + Node* nodeAsRangeFirstNode() const;
|
| +
|
| + // Returns a node as past last as same as |Range::pastLastNode()|. This
|
| + // function is supposed to used in HTML serialization and plain text
|
| + // iterator. This position must be a |PositionIs::OffsetInAhcor| to
|
| + // behave as |Range| boundary point.
|
| + Node* nodeAsRangePastLastNode() const;
|
| +
|
| Node* anchorNode() const { return m_anchorNode.get(); }
|
|
|
| // FIXME: Callers should be moved off of node(), node() is not always the container for this position.
|
|
|