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

Side by Side Diff: tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate

Issue 12295039: Fixing CssStyleDeclaration to not throw exceptions for unsupported values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 String _cachedBrowserPrefix; 7 String _cachedBrowserPrefix;
8 8
9 String get _browserPrefix { 9 String get _browserPrefix {
10 if (_cachedBrowserPrefix == null) { 10 if (_cachedBrowserPrefix == null) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 $!MEMBERS 47 $!MEMBERS
48 48
49 String getPropertyValue(String propertyName) { 49 String getPropertyValue(String propertyName) {
50 var propValue = _getPropertyValue(propertyName); 50 var propValue = _getPropertyValue(propertyName);
51 return propValue != null ? propValue : ''; 51 return propValue != null ? propValue : '';
52 } 52 }
53 53
54 $if DART2JS 54 $if DART2JS
55 void setProperty(String propertyName, String value, [String priority]) { 55 void setProperty(String propertyName, String value, [String priority]) {
56 JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority); 56 // try/catch for IE9 which throws on unsupported values.
57 // Bug #2772, IE9 requires a poke to actually apply the value. 57 try {
58 if (JS('bool', '!!#.setAttribute', this)) { 58 JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority);
59 JS('void', '#.setAttribute(#, #)', this, propertyName, value); 59 // Bug #2772, IE9 requires a poke to actually apply the value.
60 } 60 if (JS('bool', '!!#.setAttribute', this)) {
61 JS('void', '#.setAttribute(#, #)', this, propertyName, value);
62 }
63 } catch (e) {}
61 } 64 }
62 65
63 /** 66 /**
64 * Checks to see if CSS Transitions are supported. 67 * Checks to see if CSS Transitions are supported.
65 */ 68 */
66 static bool get supportsTransitions { 69 static bool get supportsTransitions {
67 if (JS('bool', '"transition" in document.body.style')) { 70 if (JS('bool', '"transition" in document.body.style')) {
68 return true; 71 return true;
69 } 72 }
70 var propertyName = '${_browserPropertyPrefix}Transition'; 73 var propertyName = '${_browserPropertyPrefix}Transition';
(...skipping 3158 matching lines...) Expand 10 before | Expand all | Expand 10 after
3229 3232
3230 /** Gets the value of "zoom" */ 3233 /** Gets the value of "zoom" */
3231 String get zoom => 3234 String get zoom =>
3232 getPropertyValue('zoom'); 3235 getPropertyValue('zoom');
3233 3236
3234 /** Sets the value of "zoom" */ 3237 /** Sets the value of "zoom" */
3235 void set zoom(String value) { 3238 void set zoom(String value) {
3236 setProperty('zoom', value, ''); 3239 setProperty('zoom', value, '');
3237 } 3240 }
3238 } 3241 }
OLDNEW
« tests/html/element_classes_test.dart ('K') | « tests/html/element_classes_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698