blob: 64130628a56ed234cbe919a5afa8ee1c15d88dc8 [file] [log] [blame]
This test checks the behavior of the intersectsNode() method on the Range object.
It covers all configurations of the node/Range relationship and some exception conditions.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
1.1 Node starts before the range and ends before the range
PASS intersects is false
1.2 Node starts before the range, and range ends on a 1
PASS intersects is true
1.3 Node starts before the range and ends within the range
PASS intersects is true
1.4 Range starts on 0, and node starts before range and ends in range
PASS intersects is true
1.5 Node starts and ends in range
PASS intersects is true
1.6 Node starts in the range, and the range ends on 1
PASS intersects is true
1.7 Node starts in the range, and ends after the range
PASS intersects is true
1.8 Range start on 1, node starts in range and ends after
PASS intersects is true
1.9 Node starts on range start and ends on range end
PASS intersects is true
1.10 Node starts after range end and ends after range end
PASS intersects is false
1.11 Node starts before range start and ends after range end
PASS intersects is true
1.12 Node starts before range start and range begins and ends on 1
PASS intersects is true
1.13 Range starts at 0 and ends at 1
PASS intersects is true
2.1 Detached Range, attached node
PASS intersects is false
2.2 attached range, detached node
PASS intersects is false
2.3 Node has no parent
PASS range.intersectsNode(document) threw exception Error: NOT_FOUND_ERR: DOM Exception 8.
2.4 Range has no parent
PASS range.selectNode(document) threw exception Error: INVALID_NODE_TYPE_ERR: DOM Range Exception 2.
2.5 Wrong documents
PASS intersects is false
2.6 Node deleted
PASS range.intersectsNode(node) threw exception Error: NOT_FOUND_ERR: DOM Exception 8.
PASS successfullyParsed is true
TEST COMPLETE