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

Side by Side Diff: tests/html/cssstyledeclaration_test.dart

Issue 304293005: Have the same behavior for setting a CSS style to null versus empty string in all browsers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library CssStyleDeclarationTest; 5 library CssStyleDeclarationTest;
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_config.dart'; 7 import 'package:unittest/html_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:async'; 9 import 'dart:async';
10 import 'utils.dart'; 10 import 'utils.dart';
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 equals("color: blue;")); 48 equals("color: blue;"));
49 }); 49 });
50 50
51 test('CSS property empty getters and setters', () { 51 test('CSS property empty getters and setters', () {
52 var style = createTestStyle(); 52 var style = createTestStyle();
53 expect(style.border, equals("")); 53 expect(style.border, equals(""));
54 54
55 style.border = "1px solid blue"; 55 style.border = "1px solid blue";
56 style.border = ""; 56 style.border = "";
57 expect(style.border, equals("")); 57 expect(style.border, equals(""));
58
59 style.border = "1px solid blue";
60 style.border = null;
61 expect(style.border, equals(""));
58 }); 62 });
59 63
60 test('CSS property getters and setters', () { 64 test('CSS property getters and setters', () {
61 var style = createTestStyle(); 65 var style = createTestStyle();
62 expect(style.color, equals("blue")); 66 expect(style.color, equals("blue"));
63 expect(style.width, equals("2px")); 67 expect(style.width, equals("2px"));
64 68
65 style.color = "red"; 69 style.color = "red";
66 style.transform = "translate(10px, 20px)"; 70 style.transform = "translate(10px, 20px)";
67 71
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 expect(elements.style.backgroundColor, equals('green')); 144 expect(elements.style.backgroundColor, equals('green'));
141 elements = document.queryAll('#wat'); 145 elements = document.queryAll('#wat');
142 expect(elements.style.backgroundColor, equals('yellow')); 146 expect(elements.style.backgroundColor, equals('yellow'));
143 147
144 elements.style.borderLeftWidth = '18px'; 148 elements.style.borderLeftWidth = '18px';
145 expect(elements.style.borderLeftWidth, equals('18px')); 149 expect(elements.style.borderLeftWidth, equals('18px'));
146 elements = document.queryAll('li'); 150 elements = document.queryAll('li');
147 expect(elements.style.borderLeftWidth, equals('10px')); 151 expect(elements.style.borderLeftWidth, equals('10px'));
148 }); 152 });
149 } 153 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698