Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/spec/callback.html

Issue 2800723002: Ensure we never remove the style attribute when syncing it from CSSOM. (Closed)
Patch Set: Nits Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/5770834-1-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/execCommand/5770834-1-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698