39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
Tests parameters of document.createTreeWalker() API.
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
No parameters
|
|
PASS document.createTreeWalker() threw exception TypeError: Not enough arguments.
|
|
|
|
Null root node
|
|
PASS document.createTreeWalker(null) threw exception TypeError: Argument 1 ('root') to Document.createTreeWalker must be an instance of Node.
|
|
|
|
Primitive (string) NodeFilter callback
|
|
PASS document.createTreeWalker(document, null, 'str') threw exception TypeError: Argument 3 ('filter') to Document.createTreeWalker must be an object.
|
|
|
|
Default parameters
|
|
walker = document.createTreeWalker(document)
|
|
PASS walker.root is document
|
|
PASS walker.currentNode is document
|
|
PASS walker.whatToShow is 0xFFFFFFFF
|
|
PASS walker.filter is null
|
|
|
|
Passing null for optional parameters
|
|
walker = document.createTreeWalker(document, null, null)
|
|
PASS walker.root is document
|
|
PASS walker.currentNode is document
|
|
PASS walker.whatToShow is 0
|
|
PASS walker.filter is null
|
|
|
|
Passing undefined for optional parameters
|
|
walker = document.createTreeWalker(document, undefined, undefined)
|
|
PASS walker.root is document
|
|
PASS walker.currentNode is document
|
|
PASS walker.whatToShow is 0xFFFFFFFF
|
|
PASS walker.filter is null
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|