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

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

Issue 1308663003: The node and allowPartialContainment arguments for Selection API should not be optional (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « LayoutTests/editing/selection/containsNode-expected.txt ('k') | Source/core/editing/Selection.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/DOMSelection.cpp
diff --git a/Source/core/editing/DOMSelection.cpp b/Source/core/editing/DOMSelection.cpp
index 0468dbc358f711e80df97db3fcc79745064fb840..8a5c09edec63b4455100156251ece7ca11188e3f 100644
--- a/Source/core/editing/DOMSelection.cpp
+++ b/Source/core/editing/DOMSelection.cpp
@@ -456,12 +456,14 @@ void DOMSelection::deleteFromDocument()
bool DOMSelection::containsNode(const Node* n, bool allowPartial) const
{
+ ASSERT(n);
+
if (!m_frame)
return false;
FrameSelection& selection = m_frame->selection();
- if (!n || m_frame->document() != n->document() || selection.isNone())
+ if (m_frame->document() != n->document() || selection.isNone())
return false;
unsigned nodeIndex = n->nodeIndex();
« no previous file with comments | « LayoutTests/editing/selection/containsNode-expected.txt ('k') | Source/core/editing/Selection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698