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

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_delete.html

Issue 2867883003: [CSS Typed OM] Delete obsolete number and length classes from Typed OM (Closed)
Patch Set: rebase Created 3 years, 6 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
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 4
5 <div id="testElement"></div> 5 <div id="testElement"></div>
6 6
7 <script> 7 <script>
8 8
9 // Delete 9 // Delete
10 test(function() { 10 test(function() {
11 testElement.style.width = '80px'; 11 testElement.style.width = '80px';
12 assert_equals(testElement.styleMap.get('width').cssText, '80px'); 12 assert_equals(testElement.styleMap.get('width').cssText, '80px');
13 13
14 testElement.styleMap.delete('width'); 14 testElement.styleMap.delete('width');
15 assert_equals(testElement.styleMap.get('width'), null); 15 assert_equals(testElement.styleMap.get('width'), null);
16 assert_equals(testElement.style.width, ''); 16 assert_equals(testElement.style.width, '');
17 }, "delete() removes the value from the property when set in element.style"); 17 }, "delete() removes the value from the property when set in element.style");
18 18
19 test(function() { 19 test(function() {
20 testElement.styleMap.set('width', new CSSSimpleLength(100, 'px')); 20 testElement.styleMap.set('width', new CSSUnitValue(100, 'px'));
21 assert_equals(testElement.styleMap.get('width').cssText, '100px'); 21 assert_equals(testElement.styleMap.get('width').cssText, '100px');
22 22
23 testElement.styleMap.delete('width'); 23 testElement.styleMap.delete('width');
24 assert_equals(testElement.styleMap.get('width'), null); 24 assert_equals(testElement.styleMap.get('width'), null);
25 assert_equals(testElement.style.width, ''); 25 assert_equals(testElement.style.width, '');
26 }, "delete() removes the value from the property when set in element.styleMap"); 26 }, "delete() removes the value from the property when set in element.styleMap");
27 27
28 test(function() { 28 test(function() {
29 testElement.style.width = '90px'; 29 testElement.style.width = '90px';
30 assert_equals(testElement.styleMap.get('width').cssText, '90px'); 30 assert_equals(testElement.styleMap.get('width').cssText, '90px');
(...skipping 11 matching lines...) Expand all
42 42
43 test(function() { 43 test(function() {
44 assert_throws(new TypeError(), function() { 44 assert_throws(new TypeError(), function() {
45 testElement.styleMap.delete('lemons'); 45 testElement.styleMap.delete('lemons');
46 }); 46 });
47 }, "Attempting to delete an invalid property throws"); 47 }, "Attempting to delete an invalid property throws");
48 48
49 // TODO(meade): Test deleting a property containing multiple values once that ha s been implemented. 49 // TODO(meade): Test deleting a property containing multiple values once that ha s been implemented.
50 50
51 </script> 51 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698