| Index: third_party/WebKit/Source/core/editing/Position.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/Position.cpp b/third_party/WebKit/Source/core/editing/Position.cpp
|
| index 1627ec17ae4afb493c3dca4d6c69ec9f1fc7b029..13777618de2d1b135122fdda1ef209f4fc7d0a28 100644
|
| --- a/third_party/WebKit/Source/core/editing/Position.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/Position.cpp
|
| @@ -112,9 +112,13 @@ PositionTemplate<Strategy>::PositionTemplate(Node* anchor_node,
|
| DCHECK_NE(anchor_type_, PositionAnchorType::kOffsetInAnchor);
|
| }
|
|
|
| +// TODO(editing-dev): Once we change type of |anchor_node_| to
|
| +// |Member<const Node>|, we should get rid of |const_cast<Node*>()|.
|
| +// See http://crbug.com/735327
|
| template <typename Strategy>
|
| -PositionTemplate<Strategy>::PositionTemplate(Node* anchor_node, int offset)
|
| - : anchor_node_(anchor_node),
|
| +PositionTemplate<Strategy>::PositionTemplate(const Node* anchor_node,
|
| + int offset)
|
| + : anchor_node_(const_cast<Node*>(anchor_node)),
|
| offset_(offset),
|
| anchor_type_(PositionAnchorType::kOffsetInAnchor) {
|
| if (anchor_node_)
|
| @@ -127,6 +131,11 @@ PositionTemplate<Strategy>::PositionTemplate(Node* anchor_node, int offset)
|
| }
|
|
|
| template <typename Strategy>
|
| +PositionTemplate<Strategy>::PositionTemplate(const Node& anchor_node,
|
| + int offset)
|
| + : PositionTemplate(&anchor_node, offset) {}
|
| +
|
| +template <typename Strategy>
|
| PositionTemplate<Strategy>::PositionTemplate(const PositionTemplate& other)
|
| : anchor_node_(other.anchor_node_),
|
| offset_(other.offset_),
|
|
|