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

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

Issue 10917148: Fixing up setting styles to invalidate on IE9. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merging with latest. Created 8 years, 3 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
« no previous file with comments | « lib/html/templates/html/impl/impl_CSSStyleDeclaration.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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('../../pkg/unittest/unittest.dart'); 6 #import('../../pkg/unittest/unittest.dart');
7 #import('../../pkg/unittest/html_config.dart'); 7 #import('../../pkg/unittest/html_config.dart');
8 #import('dart:html'); 8 #import('dart:html');
9 9
10 main() { 10 main() {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 expect(style.color, equals("red")); 57 expect(style.color, equals("red"));
58 expect(style.transform, equals("translate(10px, 20px)")); 58 expect(style.transform, equals("translate(10px, 20px)"));
59 }); 59 });
60 60
61 test('Browser prefixes', () { 61 test('Browser prefixes', () {
62 var element = new DivElement(); 62 var element = new DivElement();
63 element.style.transform = 'translateX(10px)'; 63 element.style.transform = 'translateX(10px)';
64 document.body.elements.add(element); 64 document.body.elements.add(element);
65 65
66 var style = new CSSStyleDeclaration();
67
68 element.getComputedStyle('').then(expectAsync1( 66 element.getComputedStyle('').then(expectAsync1(
69 (CSSStyleDeclaration style) { 67 (CSSStyleDeclaration style) {
70 // Some browsers will normalize this, so it'll be a matrix rather than 68 // Some browsers will normalize this, so it'll be a matrix rather than
71 // the original string. Just check that it's something other than null. 69 // the original string. Just check that it's something other than null.
72 expect(style.transform.length, greaterThan(3)); 70 expect(style.transform.length, greaterThan(3));
73 } 71 }
74 )); 72 ));
75 }); 73 });
74
75 // IE9 requires an extra poke for some properties to get applied.
76 test('IE9 Invalidation', () {
77 var element = new DivElement();
78 document.body.elements.add(element);
79
80 // Need to wait one tick after the element has been added to the page.
81 window.setTimeout(expectAsync0(() {
82 element.style.textDecoration = 'underline';
83 element.getComputedStyle('').then(expectAsync1(
84 (CSSStyleDeclaration style) {
85 expect(style.textDecoration, equals('underline'));
86 }
87 ));
88 }), 10);
89 });
76 } 90 }
OLDNEW
« no previous file with comments | « lib/html/templates/html/impl/impl_CSSStyleDeclaration.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698