OLD | NEW |
1 | 1 |
2 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 // WARNING: DO NOT EDIT THIS TEMPLATE FILE. | 6 // WARNING: DO NOT EDIT THIS TEMPLATE FILE. |
7 // The template file was generated by scripts/css_code_generator.py | 7 // The template file was generated by scripts/css_code_generator.py |
8 | 8 |
9 // Source of CSS properties: | 9 // Source of CSS properties: |
10 // CSSPropertyNames.in | 10 // CSSPropertyNames.in |
11 | 11 |
12 part of $LIBRARYNAME; | 12 part of $LIBRARYNAME; |
13 | 13 |
14 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with | 14 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with |
15 $(CLASSNAME)Base $IMPLEMENTS { | 15 $(CLASSNAME)Base $IMPLEMENTS { |
16 factory $CLASSNAME() => new CssStyleDeclaration.css(''); | 16 factory $CLASSNAME() => new CssStyleDeclaration.css(''); |
17 | 17 |
18 factory $CLASSNAME.css(String css) { | 18 factory $CLASSNAME.css(String css) { |
19 final style = new Element.tag('div').style; | 19 final style = new Element.tag('div').style; |
20 style.cssText = css; | 20 style.cssText = css; |
21 return style; | 21 return style; |
22 } | 22 } |
23 | 23 |
| 24 /// Returns the value of the property if the provided *CSS* property |
| 25 /// name is supported on this element and if the value is set. Otherwise |
| 26 /// returns an empty string. |
| 27 /// |
| 28 /// Please note the property name uses camelCase, not-hyphens. |
24 String getPropertyValue(String propertyName) { | 29 String getPropertyValue(String propertyName) { |
25 var propValue = _getPropertyValueHelper(propertyName); | 30 var propValue = _getPropertyValueHelper(propertyName); |
26 return propValue != null ? propValue : ''; | 31 return propValue != null ? propValue : ''; |
27 } | 32 } |
28 | 33 |
29 String _getPropertyValueHelper(String propertyName) { | 34 String _getPropertyValueHelper(String propertyName) { |
30 if (_supportsProperty(_camelCase(propertyName))) { | 35 if (_supportsProperty(_camelCase(propertyName))) { |
31 return _getPropertyValue(propertyName); | 36 return _getPropertyValue(propertyName); |
32 } else { | 37 } else { |
33 return _getPropertyValue(Device.cssPrefix + propertyName); | 38 return _getPropertyValue(Device.cssPrefix + propertyName); |
(...skipping 4683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4717 | 4722 |
4718 /** Gets the value of "zoom" */ | 4723 /** Gets the value of "zoom" */ |
4719 String get zoom => | 4724 String get zoom => |
4720 getPropertyValue('zoom'); | 4725 getPropertyValue('zoom'); |
4721 | 4726 |
4722 /** Sets the value of "zoom" */ | 4727 /** Sets the value of "zoom" */ |
4723 set zoom(String value) { | 4728 set zoom(String value) { |
4724 setProperty('zoom', value, ''); | 4729 setProperty('zoom', value, ''); |
4725 } | 4730 } |
4726 } | 4731 } |
OLD | NEW |