82 lines
3.0 KiB
Plaintext
82 lines
3.0 KiB
Plaintext
Test WebKitMutationObserver.observe on a subtree
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
Testing basic aspects of subtree observation.
|
|
...attribute and characterData changes in subtree
|
|
PASS mutations.length is 2
|
|
PASS mutations[0].type is "attributes"
|
|
PASS mutations[0].target is subDiv
|
|
PASS mutations[0].attributeName is "foo"
|
|
PASS mutations[0].attributeNamespace is null
|
|
PASS mutations[1].type is "characterData"
|
|
PASS mutations[1].target is subDiv.firstChild
|
|
|
|
Testing two observers at different depths.
|
|
PASS mutations.length is 1
|
|
PASS mutations[0].type is "attributes"
|
|
PASS mutations[0].target is subDiv
|
|
PASS mutations[0].attributeName is "foo"
|
|
PASS mutations[0].attributeNamespace is null
|
|
PASS mutations2.length is 1
|
|
PASS mutations2[0].type is "attributes"
|
|
PASS mutations2[0].target is subDiv
|
|
PASS mutations2[0].attributeName is "foo"
|
|
PASS mutations2[0].attributeNamespace is null
|
|
|
|
Testing one observer at two different depths.
|
|
PASS calls is 1
|
|
PASS mutations.length is 1
|
|
PASS mutations[0].type is "attributes"
|
|
PASS mutations[0].target is subDiv
|
|
PASS mutations[0].attributeName is "foo"
|
|
PASS mutations[0].attributeNamespace is null
|
|
|
|
Testing that transiently detached nodes are still observed via subtree.
|
|
...both changes should be received. Change detached subDiv again.
|
|
PASS mutations.length is 2
|
|
PASS mutations[0].type is "attributes"
|
|
PASS mutations[0].target is subDiv
|
|
PASS mutations[0].attributeName is "foo"
|
|
PASS mutations[1].type is "attributes"
|
|
PASS mutations[1].target is subDiv
|
|
PASS mutations[1].attributeName is "test"
|
|
...transient subtree observation was stopped after delivery, so subDiv change should not be received. Reattach and change again.
|
|
PASS mutations is null
|
|
...reattached subtree should now be observable. Try detaching and re-observing.
|
|
PASS mutations.length is 1
|
|
PASS mutations[0].type is "attributes"
|
|
PASS mutations[0].target is subDiv
|
|
PASS mutations[0].attributeName is "foo"
|
|
...The change made before re-observing should be received, but not the one after.
|
|
PASS mutations.length is 1
|
|
PASS mutations[0].type is "characterData"
|
|
PASS mutations[0].target is subDiv.firstChild
|
|
|
|
Testing correct behavior of transient observation with complex movement .
|
|
...All changes should be received except for setting the "d" attribute on subDiv3 before it was reachable from div.
|
|
PASS mutations.length is 6
|
|
PASS mutations[0].type is "attributes"
|
|
PASS mutations[0].target is subDiv
|
|
PASS mutations[0].attributeName is "a"
|
|
PASS mutations[1].type is "attributes"
|
|
PASS mutations[1].target is subDiv2
|
|
PASS mutations[1].attributeName is "b"
|
|
PASS mutations[2].type is "characterData"
|
|
PASS mutations[2].target is text
|
|
PASS mutations[3].type is "attributes"
|
|
PASS mutations[3].target is subDiv2
|
|
PASS mutations[3].attributeName is "e"
|
|
PASS mutations[4].type is "attributes"
|
|
PASS mutations[4].target is subDiv3
|
|
PASS mutations[4].attributeName is "f"
|
|
PASS mutations[5].type is "attributes"
|
|
PASS mutations[5].target is subDiv2
|
|
PASS mutations[5].attributeName is "g"
|
|
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|