| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |