Index: Source/core/dom/Range.cpp |
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp |
index 4fa8b8b9c967ac96e518ae08f00915e822a667e9..e1082726394eb3dd883200f8501702732b7511dd 100644 |
--- a/Source/core/dom/Range.cpp |
+++ b/Source/core/dom/Range.cpp |
@@ -399,12 +399,8 @@ bool Range::intersectsNode(Node* refNode, ExceptionState& exceptionState) |
ContainerNode* parentNode = refNode->parentNode(); |
int nodeIndex = refNode->nodeIndex(); |
- if (!parentNode) { |
- // if the node is the top document we should return NODE_BEFORE_AND_AFTER |
- // but we throw to match firefox behavior |
- exceptionState.throwDOMException(NotFoundError, "The node provided has no parent."); |
- return false; |
- } |
+ if (!parentNode) |
sof
2015/09/25 09:17:04
Could you move this up to the line after where par
pals
2015/09/28 11:29:06
Done.
|
+ return true; |
if (comparePoint(parentNode, nodeIndex, exceptionState) < 0 // starts before start |
&& comparePoint(parentNode, nodeIndex + 1, exceptionState) < 0) { // ends before start |
@@ -429,12 +425,8 @@ bool Range::intersectsNode(Node* refNode, const Position& start, const Position& |
ContainerNode* parentNode = refNode->parentNode(); |
int nodeIndex = refNode->nodeIndex(); |
- if (!parentNode) { |
- // if the node is the top document we should return NODE_BEFORE_AND_AFTER |
- // but we throw to match firefox behavior |
- exceptionState.throwDOMException(NotFoundError, "The node provided has no parent."); |
- return false; |
- } |
+ if (!parentNode) |
sof
2015/09/25 09:17:04
Ditto.
pals
2015/09/28 11:29:06
Done.
|
+ return true; |
Node* startContainerNode = start.computeContainerNode(); |
int startOffset = start.computeOffsetInContainerNode(); |