| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Custom Elements: Create an element when definition is non-null and synchr
onous flag not set</title> | 2 <title>Custom Elements: Create an element when definition is non-null and synchr
onous flag not set</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script src="resources/custom-elements-helpers.js"></script> | 5 <script src="resources/custom-elements-helpers.js"></script> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 (() => { | 10 (() => { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 element.style.color = 'red'; | 98 element.style.color = 'red'; |
| 99 assert_equals(logs.length, 1); | 99 assert_equals(logs.length, 1); |
| 100 assert_log_is_type(logs, 0, attributeChanged, element, ['style', null, 'colo
r: red;', null]); | 100 assert_log_is_type(logs, 0, attributeChanged, element, ['style', null, 'colo
r: red;', null]); |
| 101 | 101 |
| 102 element.style.color = 'green'; | 102 element.style.color = 'green'; |
| 103 assert_equals(logs.length, 2); | 103 assert_equals(logs.length, 2); |
| 104 assert_log_is_type(logs, 1, attributeChanged, element, ['style', 'color: red
;', 'color: green;', null]); | 104 assert_log_is_type(logs, 1, attributeChanged, element, ['style', 'color: red
;', 'color: green;', null]); |
| 105 | 105 |
| 106 element.style.color = ''; | 106 element.style.color = ''; |
| 107 assert_equals(logs.length, 3); | 107 assert_equals(logs.length, 3); |
| 108 assert_log_is_type(logs, 2, attributeChanged, element, ['style', 'color: gre
en;', null, null]); | 108 assert_log_is_type(logs, 2, attributeChanged, element, ['style', 'color: gre
en;', "", null]); |
| 109 }, 'style.color should enqueue attributeChangedCallback for style attribute'); | 109 }, 'style.color should enqueue attributeChangedCallback for style attribute'); |
| 110 | 110 |
| 111 test_with_window(w => { | 111 test_with_window(w => { |
| 112 let document = w.document; | 112 let document = w.document; |
| 113 let element = document.createElement('a-a'); | 113 let element = document.createElement('a-a'); |
| 114 document.body.appendChild(element); | 114 document.body.appendChild(element); |
| 115 let logs = define_logger(w, ['style']); | 115 let logs = define_logger(w, ['style']); |
| 116 | 116 |
| 117 logs.length = 0; | 117 logs.length = 0; |
| 118 element.style.cssText = 'color: red'; | 118 element.style.cssText = 'color: red'; |
| 119 assert_equals(logs.length, 1); | 119 assert_equals(logs.length, 1); |
| 120 assert_log_is_type(logs, 0, attributeChanged, element, ['style', null, 'colo
r: red;', null]); | 120 assert_log_is_type(logs, 0, attributeChanged, element, ['style', null, 'colo
r: red;', null]); |
| 121 }, 'style.cssText should enqueue attributeChangedCallback for style attribute'
); | 121 }, 'style.cssText should enqueue attributeChangedCallback for style attribute'
); |
| 122 | 122 |
| 123 test_with_window(w => { | 123 test_with_window(w => { |
| 124 let document = w.document; | 124 let document = w.document; |
| 125 let element = document.createElement('a-a'); | 125 let element = document.createElement('a-a'); |
| 126 document.body.appendChild(element); | 126 document.body.appendChild(element); |
| 127 let logs = define_logger(w, ['style']); | 127 let logs = define_logger(w, ['style']); |
| 128 | 128 |
| 129 logs.length = 0; | 129 logs.length = 0; |
| 130 element.style.setProperty('color', 'red'); | 130 element.style.setProperty('color', 'red'); |
| 131 assert_equals(logs.length, 1); | 131 assert_equals(logs.length, 1); |
| 132 assert_log_is_type(logs, 0, attributeChanged, element, ['style', null, 'colo
r: red;', null]); | 132 assert_log_is_type(logs, 0, attributeChanged, element, ['style', null, 'colo
r: red;', null]); |
| 133 | 133 |
| 134 element.style.removeProperty('color', 'red'); | 134 element.style.removeProperty('color', 'red'); |
| 135 assert_equals(logs.length, 2); | 135 assert_equals(logs.length, 2); |
| 136 assert_log_is_type(logs, 1, attributeChanged, element, ['style', 'color: red
;', null, null]); | 136 assert_log_is_type(logs, 1, attributeChanged, element, ['style', 'color: red
;', "", null]); |
| 137 }, 'style.setProperty/removeProperty should enqueue attributeChangedCallback f
or style attribute'); | 137 }, 'style.setProperty/removeProperty should enqueue attributeChangedCallback f
or style attribute'); |
| 138 | 138 |
| 139 test_with_window(w => { | 139 test_with_window(w => { |
| 140 let document = w.document; | 140 let document = w.document; |
| 141 let element = document.createElement('a-a'); | 141 let element = document.createElement('a-a'); |
| 142 document.body.appendChild(element); | 142 document.body.appendChild(element); |
| 143 let logs = define_logger(w, ['style']); | 143 let logs = define_logger(w, ['style']); |
| 144 | 144 |
| 145 logs.length = 0; | 145 logs.length = 0; |
| 146 element.style.cssFloat = 'left'; | 146 element.style.cssFloat = 'left'; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 let logs = define_logger(w); | 196 let logs = define_logger(w); |
| 197 | 197 |
| 198 logs.length = 0; | 198 logs.length = 0; |
| 199 element.remove(); | 199 element.remove(); |
| 200 assert_log_is_type(logs, 0, disconnected, element); | 200 assert_log_is_type(logs, 0, disconnected, element); |
| 201 assert_equals(logs.length, 1); | 201 assert_equals(logs.length, 1); |
| 202 }, 'remove should enqueue disconnectedCallback'); | 202 }, 'remove should enqueue disconnectedCallback'); |
| 203 })(); | 203 })(); |
| 204 </script> | 204 </script> |
| 205 </body> | 205 </body> |
| OLD | NEW |