blob: 1fe1deec940fbf2a9f31a58a2f864dd9164e3ca3 [file] [log] [blame]
Tests ChildNode.before((Node or DOMString)...)
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Test Element.before((Node or DOMString)...).
Test with no arguments.
PASS parent.childNodes.length is 1
Test with a single element.
PASS parent.childNodes.length is 2
PASS child.previousSibling is d1
Test with a single string.
PASS parent.childNodes.length is 2
PASS child.previousSibling.data is 'hello'
Test with a both strings and elements.
PASS parent.childNodes.length is 3
PASS child.previousSibling is d1
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'hello'
PASS parent.childNodes[1] is an instance of Element
PASS parent.childNodes[1] is d1
Test conversion to string
PASS parent.childNodes.length is 4
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'null'
PASS parent.childNodes[1] is an instance of Text
PASS parent.childNodes[1].data is 'undefined'
PASS parent.childNodes[2] is an instance of Text
PASS parent.childNodes[2].data is '7'
PASS parent.childNodes[3] is an instance of Element
PASS parent.childNodes[3] is child
Test a child without a parent.
PASS child.previousSibling is null
Test when there the previous sibling is not a viable previous sibling.
PASS parent.childNodes.length is 5
PASS parent.childNodes[0] is an instance of Element
PASS parent.childNodes[0] is d1
PASS parent.childNodes[1] is an instance of Text
PASS parent.childNodes[1].data is 'hello'
PASS parent.childNodes[2] is an instance of Element
PASS parent.childNodes[2] is d2
PASS parent.childNodes[3] is an instance of Text
PASS parent.childNodes[3].data is 'world'
PASS parent.childNodes[4] is an instance of Element
PASS parent.childNodes[4] is child
Test when there is no viable previous sibling.
PASS parent.childNodes.length is 5
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'hello'
PASS parent.childNodes[1] is an instance of Element
PASS parent.childNodes[1] is d1
PASS parent.childNodes[2] is an instance of Text
PASS parent.childNodes[2].data is 'world'
PASS parent.childNodes[3] is an instance of Element
PASS parent.childNodes[3] is d2
PASS parent.childNodes[4] is an instance of Element
PASS parent.childNodes[4] is child
Test Text.before((Node or DOMString)...).
Test with no arguments.
PASS parent.childNodes.length is 1
Test with a single element.
PASS parent.childNodes.length is 2
PASS child.previousSibling is d1
Test with a single string.
PASS parent.childNodes.length is 2
PASS child.previousSibling.data is 'hello'
Test with a both strings and elements.
PASS parent.childNodes.length is 3
PASS child.previousSibling is d1
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'hello'
PASS parent.childNodes[1] is an instance of Element
PASS parent.childNodes[1] is d1
Test conversion to string
PASS parent.childNodes.length is 4
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'null'
PASS parent.childNodes[1] is an instance of Text
PASS parent.childNodes[1].data is 'undefined'
PASS parent.childNodes[2] is an instance of Text
PASS parent.childNodes[2].data is '7'
PASS parent.childNodes[3] is an instance of Text
PASS parent.childNodes[3] is child
Test a child without a parent.
PASS child.previousSibling is null
Test when there the previous sibling is not a viable previous sibling.
PASS parent.childNodes.length is 5
PASS parent.childNodes[0] is an instance of Element
PASS parent.childNodes[0] is d1
PASS parent.childNodes[1] is an instance of Text
PASS parent.childNodes[1].data is 'hello'
PASS parent.childNodes[2] is an instance of Element
PASS parent.childNodes[2] is d2
PASS parent.childNodes[3] is an instance of Text
PASS parent.childNodes[3].data is 'world'
PASS parent.childNodes[4] is an instance of Text
PASS parent.childNodes[4] is child
Test when there is no viable previous sibling.
PASS parent.childNodes.length is 5
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'hello'
PASS parent.childNodes[1] is an instance of Element
PASS parent.childNodes[1] is d1
PASS parent.childNodes[2] is an instance of Text
PASS parent.childNodes[2].data is 'world'
PASS parent.childNodes[3] is an instance of Element
PASS parent.childNodes[3] is d2
PASS parent.childNodes[4] is an instance of Text
PASS parent.childNodes[4] is child
Test Comment.before((Node or DOMString)...).
Test with no arguments.
PASS parent.childNodes.length is 1
Test with a single element.
PASS parent.childNodes.length is 2
PASS child.previousSibling is d1
Test with a single string.
PASS parent.childNodes.length is 2
PASS child.previousSibling.data is 'hello'
Test with a both strings and elements.
PASS parent.childNodes.length is 3
PASS child.previousSibling is d1
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'hello'
PASS parent.childNodes[1] is an instance of Element
PASS parent.childNodes[1] is d1
Test conversion to string
PASS parent.childNodes.length is 4
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'null'
PASS parent.childNodes[1] is an instance of Text
PASS parent.childNodes[1].data is 'undefined'
PASS parent.childNodes[2] is an instance of Text
PASS parent.childNodes[2].data is '7'
PASS parent.childNodes[3] is an instance of Comment
PASS parent.childNodes[3] is child
Test a child without a parent.
PASS child.previousSibling is null
Test when there the previous sibling is not a viable previous sibling.
PASS parent.childNodes.length is 5
PASS parent.childNodes[0] is an instance of Element
PASS parent.childNodes[0] is d1
PASS parent.childNodes[1] is an instance of Text
PASS parent.childNodes[1].data is 'hello'
PASS parent.childNodes[2] is an instance of Element
PASS parent.childNodes[2] is d2
PASS parent.childNodes[3] is an instance of Text
PASS parent.childNodes[3].data is 'world'
PASS parent.childNodes[4] is an instance of Comment
PASS parent.childNodes[4] is child
Test when there is no viable previous sibling.
PASS parent.childNodes.length is 5
PASS parent.childNodes[0] is an instance of Text
PASS parent.childNodes[0].data is 'hello'
PASS parent.childNodes[1] is an instance of Element
PASS parent.childNodes[1] is d1
PASS parent.childNodes[2] is an instance of Text
PASS parent.childNodes[2].data is 'world'
PASS parent.childNodes[3] is an instance of Element
PASS parent.childNodes[3] is d2
PASS parent.childNodes[4] is an instance of Comment
PASS parent.childNodes[4] is child
PASS successfullyParsed is true
TEST COMPLETE