| Index: Source/core/dom/Position.h
|
| diff --git a/Source/core/dom/Position.h b/Source/core/dom/Position.h
|
| index 643ba2b7ac41bb4b65eb16a77d280ec9ebd34753..84289dc994de9a2d8406d30b34e4696909bea2cb 100644
|
| --- a/Source/core/dom/Position.h
|
| +++ b/Source/core/dom/Position.h
|
| @@ -152,9 +152,9 @@ public:
|
| // using composed characters, the result may be inside a single user-visible character if a ligature is formed.
|
| Position previous(PositionMoveType = CodePoint) const;
|
| Position next(PositionMoveType = CodePoint) const;
|
| - static int uncheckedPreviousOffset(const Node*, int current);
|
| - static int uncheckedPreviousOffsetForBackwardDeletion(const Node*, int current);
|
| - static int uncheckedNextOffset(const Node*, int current);
|
| + static int uncheckedPreviousOffset(const Node&, int current);
|
| + static int uncheckedPreviousOffsetForBackwardDeletion(const Node&, int current);
|
| + static int uncheckedNextOffset(const Node&, int current);
|
|
|
| // These can be either inside or just before/after the node, depending on
|
| // if the node is ignored by editing or not.
|
| @@ -193,8 +193,6 @@ public:
|
| static bool nodeIsUserSelectAll(const Node*);
|
| static Node* rootUserSelectAllForNode(Node*);
|
|
|
| - static ContainerNode* findParent(const Node*);
|
| -
|
| void debugPosition(const char* msg = "") const;
|
|
|
| #ifndef NDEBUG
|
| @@ -260,21 +258,19 @@ inline Position positionInParentAfterNode(const Node& node)
|
| }
|
|
|
| // positionBeforeNode and positionAfterNode return neighbor-anchored positions, construction is O(1)
|
| -inline Position positionBeforeNode(Node* anchorNode)
|
| +inline Position positionBeforeNode(Node& anchorNode)
|
| {
|
| - ASSERT(anchorNode);
|
| - return Position(anchorNode, Position::PositionIsBeforeAnchor);
|
| + return Position(PassRefPtr<Node>(anchorNode), Position::PositionIsBeforeAnchor);
|
| }
|
|
|
| -inline Position positionAfterNode(Node* anchorNode)
|
| +inline Position positionAfterNode(Node& anchorNode)
|
| {
|
| - ASSERT(anchorNode);
|
| - return Position(anchorNode, Position::PositionIsAfterAnchor);
|
| + return Position(PassRefPtr<Node>(anchorNode), Position::PositionIsAfterAnchor);
|
| }
|
|
|
| -inline int lastOffsetInNode(Node* node)
|
| +inline int lastOffsetInNode(Node& node)
|
| {
|
| - return node->offsetInCharacters() ? node->maxCharacterOffset() : static_cast<int>(node->countChildren());
|
| + return node.offsetInCharacters() ? node.maxCharacterOffset() : static_cast<int>(node.countChildren());
|
| }
|
|
|
| // firstPositionInNode and lastPositionInNode return parent-anchored positions, lastPositionInNode construction is O(n) due to countChildren()
|
| @@ -288,7 +284,7 @@ inline Position firstPositionInNode(Node* anchorNode)
|
| inline Position lastPositionInNode(Node* anchorNode)
|
| {
|
| if (anchorNode->isTextNode())
|
| - return Position(anchorNode, lastOffsetInNode(anchorNode), Position::PositionIsOffsetInAnchor);
|
| + return Position(anchorNode, lastOffsetInNode(*anchorNode), Position::PositionIsOffsetInAnchor);
|
| return Position(anchorNode, Position::PositionIsAfterChildren);
|
| }
|
|
|
|
|