| 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 01f0364a006e652f08bdf32c1affcd23bf5451aa..f343ff8c18335bef246b6139249fc1e44f5d87ac 100644
|
| --- a/third_party/WebKit/Source/core/editing/Position.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/Position.cpp
|
| @@ -35,10 +35,20 @@
|
| namespace blink {
|
|
|
| #if DCHECK_IS_ON()
|
| -static bool canBeAnchorNode(Node* node)
|
| +template <typename Strategy>
|
| +static bool canBeAnchorNode(Node*);
|
| +
|
| +template <>
|
| +bool canBeAnchorNode<EditingStrategy>(Node* node)
|
| {
|
| return !node || !node->isPseudoElement();
|
| }
|
| +
|
| +template <>
|
| +bool canBeAnchorNode<EditingInFlatTreeStrategy>(Node* node)
|
| +{
|
| + return canBeAnchorNode<EditingStrategy>(node) && node->canParticipateInFlatTree();
|
| +}
|
| #endif
|
|
|
| template <typename Strategy>
|
| @@ -89,7 +99,7 @@ PositionTemplate<Strategy>::PositionTemplate(Node* anchorNode, PositionAnchorTyp
|
| return;
|
| }
|
| #if DCHECK_IS_ON()
|
| - DCHECK(canBeAnchorNode(m_anchorNode.get()));
|
| + DCHECK(canBeAnchorNode<Strategy>(m_anchorNode.get())) << m_anchorNode;
|
| #endif
|
| DCHECK_NE(m_anchorType, PositionAnchorType::OffsetInAnchor);
|
| }
|
| @@ -105,7 +115,7 @@ PositionTemplate<Strategy>::PositionTemplate(Node* anchorNode, int offset)
|
| else
|
| DCHECK_EQ(offset, 0);
|
| #if DCHECK_IS_ON()
|
| - DCHECK(canBeAnchorNode(m_anchorNode.get()));
|
| + DCHECK(canBeAnchorNode<Strategy>(m_anchorNode.get())) << m_anchorNode;
|
| #endif
|
| }
|
|
|
|
|