Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: third_party/WebKit/Source/core/editing/DOMSelection.cpp

Issue 1867703002: DevTools: allow builds with asserions when using DevTools front-end. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698