| 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 c2d3e6d0e318a359e6c23725bc00cdfafb4acd47..f561a912bf9a474152ffc9134e0e917658d1da21 100644
|
| --- a/third_party/WebKit/Source/core/editing/Position.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/Position.cpp
|
| @@ -541,6 +541,12 @@ PositionInFlatTree toPositionInFlatTree(const Position& pos) {
|
|
|
| if (anchor->isShadowRoot())
|
| return PositionInFlatTree(anchor->ownerShadowHost(), pos.anchorType());
|
| + if (anchor->canParticipateInFlatTree() &&
|
| + !FlatTreeTraversal::parent(*anchor)) {
|
| + // Since this function is a primitive function, we do not adjust |pos|
|
| + // to somewhere in flat tree.
|
| + return PositionInFlatTree();
|
| + }
|
| // TODO(yosin): Once we have a test case for SLOT or active insertion point,
|
| // this function should handle it.
|
| return PositionInFlatTree(anchor, pos.anchorType());
|
|
|