Index: Source/core/dom/Range.cpp |
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp |
index e9ddce35a9d3be597cf984417d1f11f56220618c..a72ad1be5243580d7c976cda18f879efbb76ab80 100644 |
--- a/Source/core/dom/Range.cpp |
+++ b/Source/core/dom/Range.cpp |
@@ -1326,13 +1326,18 @@ void Range::selectNode(Node* refNode, ExceptionState& es) |
return; |
} |
+ if (!refNode->parentNode()) { |
+ es.throwDOMException(InvalidNodeTypeError); |
Mike West
2013/08/22 08:17:11
1. Perhaps you could move this up above the for lo
yosin_UTC9
2013/08/22 09:48:44
Done.
|
+ return; |
+ } |
+ |
if (m_ownerDocument != refNode->document()) |
setDocument(refNode->document()); |
- setStartBefore(refNode, es); |
+ setStart(refNode->parentNode(), refNode->nodeIndex(), es); |
Mike West
2013/08/22 08:17:11
Can this throw an exception, given the node-type c
yosin_UTC9
2013/08/22 09:48:44
Done.
Mike West
2013/08/22 10:23:47
This was an honest question. I don't think it can
|
if (es.hadException()) |
return; |
- setEndAfter(refNode, es); |
+ setEnd(refNode->parentNode(), refNode->nodeIndex() + 1, es); |
Mike West
2013/08/22 08:17:11
Same here.
yosin_UTC9
2013/08/22 09:48:44
Done.
|
} |
void Range::selectNodeContents(Node* refNode, ExceptionState& es) |