Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| index 27cd215fe716607ca37b4b44533a735d84442dc5..54993df70d47a20209b689c88dbc2f1bcef7e877 100644 |
| --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| @@ -383,9 +383,12 @@ RawPtr<Range> DOMSelection::getRangeAt(int index, ExceptionState& exceptionState |
| if (!anchor.anchorNode()->isInShadowTree()) |
| return m_frame->selection().firstRange(); |
| + Node* node = shadowAdjustedNode(anchor); |
| + if (!node) // crbug.com/595100 |
|
yosin_UTC9
2016/04/07 01:25:39
Could you add a layout test for this case and for
|
| + return nullptr; |
| if (!visibleSelection().isBaseFirst()) |
| - return Range::create(*anchor.document(), focusNode(), focusOffset(), shadowAdjustedNode(anchor), anchorOffset()); |
| - return Range::create(*anchor.document(), shadowAdjustedNode(anchor), anchorOffset(), focusNode(), focusOffset()); |
| + return Range::create(*anchor.document(), focusNode(), focusOffset(), node, anchorOffset()); |
| + return Range::create(*anchor.document(), node, anchorOffset(), focusNode(), focusOffset()); |
| } |
| void DOMSelection::removeAllRanges() |