1 Test WebKitMutationObserver.observe on attributes
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 Testing basic aspects of attribute observation.
7 ...can attribute changes be observed at all
8 PASS mutations.length is 1
9 PASS mutations[0].type is "attributes"
10 PASS mutations[0].attributeName is "foo"
11 PASS mutations[0].attributeNamespace is null
12 ...observer.disconnect() should prevent further delivery of mutations.
13 PASS mutations is null
14 ...re-observing after disconnect works with the same observer.
15 PASS mutations.length is 2
16 PASS mutations[0].type is "attributes"
17 PASS mutations[0].attributeName is "foo"
18 PASS mutations[0].attributeNamespace is null
19 PASS mutations[1].type is "attributes"
20 PASS mutations[1].attributeName is "bar"
21 PASS mutations[1].attributeNamespace is null
23 Testing that observing without specifying "attributes" does not result in hearing about attribute changes.
24 PASS mutations is null
26 Testing that re-observing the same node with the same observer has the effect of resetting the options.
28 PASS mutations.length is 1
29 PASS mutations[0].type is "attributes"
30 PASS mutations[0].attributeName is "foo"
31 PASS mutations is null
33 Testing that multiple observers can be registered to a given node and both receive mutations.
34 PASS mutations.length is 1
35 PASS mutations[0].type is "attributes"
36 PASS mutations[0].attributeName is "foo"
37 PASS mutations2.length is 1
38 PASS mutations2[0].type is "attributes"
39 PASS mutations2[0].attributeName is "foo"
41 Testing that "attributeNamespace" value is delivered properly.
42 PASS mutations.length is 1
43 PASS mutations[0].type is "attributes"
44 PASS mutations[0].attributeName is "foo"
45 PASS mutations[0].attributeNamespace is "http://www.foo.com/bar"
47 Testing that modifications to node properties which delegate to attribute storage deliver mutations.
48 PASS mutations.length is 2
49 PASS mutations[0].type is "attributes"
50 PASS mutations[0].attributeName is "src"
51 PASS mutations[1].type is "attributes"
52 PASS mutations[1].attributeName is "href"
54 Testing mutation records are enqueued for attributes before DOMSubtreeModified is dispatched.
55 PASS mutations.length is 2
56 PASS mutations[0].type is "attributes"
57 PASS mutations[0].attributeName is "foo"
58 PASS mutations[1].type is "attributes"
59 PASS mutations[1].attributeName is "baz"
61 Testing basic oldValue delivery.
62 PASS mutations.length is 2
63 PASS mutations[0].type is "attributes"
64 PASS mutations[0].attributeName is "foo"
65 PASS mutations[0].oldValue is null
66 PASS mutations[1].type is "attributes"
67 PASS mutations[1].attributeName is "foo"
68 PASS mutations[1].oldValue is "bar"
70 Testing that oldValue is delivered as requested (or not).
71 PASS mutationsWithOldValue.length is 1
72 PASS mutationsWithOldValue[0].type is "attributes"
73 PASS mutationsWithOldValue[0].attributeName is "foo"
74 PASS mutationsWithOldValue[0].oldValue is "bar"
75 PASS mutations.length is 1
76 PASS mutations[0].type is "attributes"
77 PASS mutations[0].attributeName is "foo"
78 PASS mutations[0].oldValue is null
80 An observer with multiple observations will get attributeOldValue if any entries request it.
81 PASS mutations.length is 1
82 PASS mutations[0].type is "attributes"
83 PASS mutations[0].attributeName is "foo"
84 PASS mutations[0].oldValue is "bar"
86 Testing setting an attribute via reflected IDL attribute.
87 PASS mutations.length is 2
88 PASS mutations[0].type is "attributes"
89 PASS mutations[0].attributeName is "id"
90 PASS mutations[0].oldValue is null
91 PASS mutations[1].type is "attributes"
92 PASS mutations[1].attributeName is "id"
93 PASS mutations[1].oldValue is "foo"
95 Testing that attributeFilter works as expected and ignores case with HTML elements.
96 ...only foo, bar & boom should be received.
97 PASS mutations.length is 3
98 PASS mutations[0].type is "attributes"
99 PASS mutations[0].attributeName is "foo"
100 PASS mutations[0].attributeNamespace is null
101 PASS mutations[1].type is "attributes"
102 PASS mutations[1].attributeName is "bar"
103 PASS mutations[1].attributeNamespace is null
104 PASS mutations[2].type is "attributes"
105 PASS mutations[2].attributeName is "boom"
106 PASS mutations[2].attributeNamespace is null
108 Testing the behavior of attributeFilter when the same observer observes at multiple nodes in a subtree with different filter options.
109 ...only foo, bar & bat should be received.
110 PASS mutations.length is 3
111 PASS mutations[0].type is "attributes"
112 PASS mutations[0].attributeName is "foo"
113 PASS mutations[0].attributeNamespace is null
114 PASS mutations[1].type is "attributes"
115 PASS mutations[1].attributeName is "bar"
116 PASS mutations[1].attributeNamespace is null
117 PASS mutations[2].type is "attributes"
118 PASS mutations[2].attributeName is "bat"
119 PASS mutations[2].attributeNamespace is null
120 ...bar, bat & baz should all be received.
121 PASS mutations.length is 3
122 PASS mutations[0].type is "attributes"
123 PASS mutations[0].attributeName is "bar"
124 PASS mutations[0].attributeNamespace is null
125 PASS mutations[1].type is "attributes"
126 PASS mutations[1].attributeName is "bat"
127 PASS mutations[1].attributeNamespace is null
128 PASS mutations[2].type is "attributes"
129 PASS mutations[2].attributeName is "baz"
130 PASS mutations[2].attributeNamespace is null
132 Testing that attributeFilter respects case with non-HTML elements.
133 ...pathLength should be received.
134 PASS mutations.length is 1
135 PASS mutations[0].type is "attributes"
136 PASS mutations[0].attributeName is "pathLength"
137 PASS mutations[0].attributeNamespace is "http://www.w3.org/2000/svg"
139 Testing that attributeFilter respects case with non-HTML elements.
140 ...only ID, id, booM, pathLength should be received.
141 PASS mutations.length is 4
142 PASS mutations[0].type is "attributes"
143 PASS mutations[0].attributeName is "ID"
144 PASS mutations[0].attributeNamespace is null
145 PASS mutations[1].type is "attributes"
146 PASS mutations[1].attributeName is "id"
147 PASS mutations[1].attributeNamespace is null
148 PASS mutations[2].type is "attributes"
149 PASS mutations[2].attributeName is "booM"
150 PASS mutations[2].attributeNamespace is null
151 PASS mutations[3].type is "attributes"
152 PASS mutations[3].attributeName is "pathLength"
153 PASS mutations[3].attributeNamespace is "http://www.w3.org/2000/svg"
155 Testing that modifying an elements style property dispatches Mutation Records.
156 PASS mutations.length is 3
157 PASS mutations[0].type is "attributes"
158 PASS mutations[0].attributeName is "style"
159 PASS mutations[0].oldValue is null
160 PASS mutations[1].type is "attributes"
161 PASS mutations[1].attributeName is "style"
162 PASS mutations[1].oldValue is null
163 PASS mutations[2].type is "attributes"
164 PASS mutations[2].attributeName is "style"
165 PASS mutations[2].oldValue is null
166 ...mutation record created.
167 PASS mutations is null
169 Testing that modifying an elements style property dispatches Mutation Records with correct oldValues.
170 PASS mutations.length is 3
171 PASS mutations[0].type is "attributes"
172 PASS mutations[0].attributeName is "style"
173 PASS mutations[0].oldValue is "color: yellow; width: 100px; "
174 PASS mutations[1].type is "attributes"
175 PASS mutations[1].attributeName is "style"
176 PASS mutations[1].oldValue is "width: 100px; color: red; "
177 PASS mutations[2].type is "attributes"
178 PASS mutations[2].attributeName is "style"
179 PASS mutations[2].oldValue is "color: red; width: 200px; "
180 ...mutation record created.
181 PASS mutations is null
183 PASS successfullyParsed is true