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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/custom/attribute-changed-callback.html

Issue 1446933002: Queue Custom Element attribute changes arising from style mutations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp » ('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 <script src="../../../resources/testharness.js"></script> 2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script> 3 <script src="../../../resources/testharnessreport.js"></script>
4 <body> 4 <body>
5 <script> 5 <script>
6 test(function () { 6 test(function () {
7 var attributeChangedInvocations = 0; 7 var attributeChangedInvocations = 0;
8 function attributeChanged(_, _, _) { 8 function attributeChanged(_, _, _) {
9 attributeChangedInvocations++; 9 attributeChangedInvocations++;
10 } 10 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 assert_array_equals(invocations, ['class: null => u'], 'adding a class attri bute through classList should invoke the attributeChangedCallback'); 64 assert_array_equals(invocations, ['class: null => u'], 'adding a class attri bute through classList should invoke the attributeChangedCallback');
65 65
66 b.setAttribute('data-v', 'w'); 66 b.setAttribute('data-v', 'w');
67 invocations = []; 67 invocations = [];
68 b.setAttribute('data-v', 'x'); 68 b.setAttribute('data-v', 'x');
69 assert_array_equals(invocations, ['data-v: w => x'], 'changing an attribute with setAttribute should invoke the attributeChangedCallback'); 69 assert_array_equals(invocations, ['data-v: w => x'], 'changing an attribute with setAttribute should invoke the attributeChangedCallback');
70 70
71 invocations = []; 71 invocations = [];
72 b.setAttribute('data-v', 'x'); 72 b.setAttribute('data-v', 'x');
73 assert_array_equals(invocations, [], 'setting an attribute to the existing v alue with setAttribute should not invoke the attributeChangedCallback'); 73 assert_array_equals(invocations, [], 'setting an attribute to the existing v alue with setAttribute should not invoke the attributeChangedCallback');
74
75 invocations = [];
76 b.style.color = 'red';
77 assert_array_equals(invocations, ['style: null => color: red;'], 'changing a n attribute with the styles object\'s named setter should invoke the attributeCh angedCallback');
78
79 invocations = [];
80 b.style.color = '';
81 assert_array_equals(invocations, ['style: color: red; => null'], 'changing a n attribute with the styles object\'s named setter should invoke the attributeCh angedCallback');
82
83 invocations = [];
84 b.style.cssText = 'color: pink;';
85 assert_array_equals(invocations, ['style: null => color: pink;'], 'changing an attribute with the styles object\'s cssText setter should invoke the attribut eChangedCallback');
86
87 invocations = [];
88 b.style.setProperty('color', 'red');
89 assert_array_equals(invocations, ['style: color: pink; => color: red;'], 'ch anging an attribute with the styles object\'s setProperty method should invoke t he attributeChangedCallback');
90
91 invocations = [];
92 b.style.removeProperty('color');
93 assert_array_equals(invocations, ['style: color: red; => null'], 'changing a n attribute with the styles object\'s removeProperty method should invoke the at tributeChangedCallback');
74 }, 'add, change and remove an attribute'); 94 }, 'add, change and remove an attribute');
75 </script> 95 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698