OLD | NEW |
1 // Copyright (c) 2012, 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 // WARNING: Do not edit. | 5 // WARNING: Do not edit. |
6 // This file was generated by html/scripts/css_code_generator.py | 6 // This file was generated by html/scripts/css_code_generator.py |
7 | 7 |
8 // Source of CSS properties: | 8 // Source of CSS properties: |
9 // Source/WebCore/css/CSSPropertyNames.in | 9 // Source/WebCore/css/CSSPropertyNames.in |
10 | 10 |
11 // TODO(jacobr): add versions that take numeric values in px, miliseconds, etc. | 11 // TODO(jacobr): add versions that take numeric values in px, miliseconds, etc. |
12 | 12 |
13 class CSSStyleDeclarationWrappingImplementation extends DOMWrapperBase implement
s CSSStyleDeclaration { | 13 class CSSStyleDeclarationWrappingImplementation extends DOMWrapperBase implement
s CSSStyleDeclaration { |
14 static String _cachedBrowserPrefix; | 14 static String _cachedBrowserPrefix; |
15 /** | |
16 * The element this style declaration is associated with if any. This | |
17 * should only be set to a non-null value if modifying this object | |
18 * will change the associated element. Thus this should not be set for | |
19 * computed styles. | |
20 */ | |
21 final ElementWrappingImplementation _element; | |
22 | 15 |
23 CSSStyleDeclarationWrappingImplementation._wrap(ptr) | 16 CSSStyleDeclarationWrappingImplementation._wrap(ptr) : super._wrap(ptr) {} |
24 : super._wrap(ptr), _element = null; | |
25 CSSStyleDeclarationWrappingImplementation._wrapWithElement( | |
26 ptr, this._element) : super._wrap(ptr); | |
27 | 17 |
28 factory CSSStyleDeclarationWrappingImplementation.css(String css) { | 18 factory CSSStyleDeclarationWrappingImplementation.css(String css) { |
29 var style = new Element.tag('div').style; | 19 var style = new Element.tag('div').style; |
30 style.cssText = css; | 20 style.cssText = css; |
31 return style; | 21 return style; |
32 } | 22 } |
33 | 23 |
34 factory CSSStyleDeclarationWrappingImplementation() { | 24 factory CSSStyleDeclarationWrappingImplementation() { |
35 return new CSSStyleDeclarationWrappingImplementation.css(''); | 25 return new CSSStyleDeclarationWrappingImplementation.css(''); |
36 } | 26 } |
37 | 27 |
38 static String get _browserPrefix() { | 28 static String get _browserPrefix() { |
39 if (_cachedBrowserPrefix === null) { | 29 if (_cachedBrowserPrefix === null) { |
40 if (_Device.isFirefox) { | 30 if (_Device.isFirefox) { |
41 _cachedBrowserPrefix = '-moz-'; | 31 _cachedBrowserPrefix = '-moz-'; |
42 } else { | 32 } else { |
43 _cachedBrowserPrefix = '-webkit-'; | 33 _cachedBrowserPrefix = '-webkit-'; |
44 } | 34 } |
45 // TODO(jacobr): support IE and Opera as well. | 35 // TODO(jacobr): support IE 9.0 and Opera as well. |
46 } | 36 } |
47 return _cachedBrowserPrefix; | 37 return _cachedBrowserPrefix; |
48 } | 38 } |
49 | 39 |
50 String get cssText() => _ptr.cssText; | 40 String get cssText() { return _ptr.cssText; } |
51 | 41 |
52 bool get _inDocument() { | 42 void set cssText(String value) { _ptr.cssText = value; } |
53 return _element !== null && _element._inDocument; | |
54 } | |
55 | |
56 void set cssText(String value) { | |
57 assert(!_inMeasurementFrame || !_inDocument); | |
58 _ptr.cssText = value; | |
59 } | |
60 | 43 |
61 int get length() { return _ptr.length; } | 44 int get length() { return _ptr.length; } |
62 | 45 |
63 CSSRule get parentRule() { return LevelDom.wrapCSSRule(_ptr.parentRule); } | 46 CSSRule get parentRule() { return LevelDom.wrapCSSRule(_ptr.parentRule); } |
64 | 47 |
65 CSSValue getPropertyCSSValue(String propertyName) { | 48 CSSValue getPropertyCSSValue(String propertyName) { |
66 return LevelDom.wrapCSSValue(_ptr.getPropertyCSSValue(propertyName)); | 49 return LevelDom.wrapCSSValue(_ptr.getPropertyCSSValue(propertyName)); |
67 } | 50 } |
68 | 51 |
69 String getPropertyPriority(String propertyName) { | 52 String getPropertyPriority(String propertyName) { |
(...skipping 10 matching lines...) Expand all Loading... |
80 | 63 |
81 bool isPropertyImplicit(String propertyName) { | 64 bool isPropertyImplicit(String propertyName) { |
82 return _ptr.isPropertyImplicit(propertyName); | 65 return _ptr.isPropertyImplicit(propertyName); |
83 } | 66 } |
84 | 67 |
85 String item(int index) { | 68 String item(int index) { |
86 return _ptr.item(index); | 69 return _ptr.item(index); |
87 } | 70 } |
88 | 71 |
89 String removeProperty(String propertyName) { | 72 String removeProperty(String propertyName) { |
90 assert(!_inMeasurementFrame || !_inDocument); | |
91 return _ptr.removeProperty(propertyName); | 73 return _ptr.removeProperty(propertyName); |
92 } | 74 } |
93 | 75 |
94 void setProperty(String propertyName, var value, [String priority = '']) { | 76 void setProperty(String propertyName, var value, [String priority = '']) { |
95 assert(!_inMeasurementFrame || !_inDocument); | |
96 _ptr.setProperty(propertyName, '$value', priority); | 77 _ptr.setProperty(propertyName, '$value', priority); |
97 } | 78 } |
98 | 79 |
| 80 String get typeName() { return "CSSStyleDeclaration"; } |
| 81 |
| 82 |
99 /** Gets the value of "animation" */ | 83 /** Gets the value of "animation" */ |
100 String get animation() => | 84 String get animation() => |
101 getPropertyValue('${_browserPrefix}animation'); | 85 getPropertyValue('${_browserPrefix}animation'); |
102 | 86 |
103 /** Sets the value of "animation" */ | 87 /** Sets the value of "animation" */ |
104 void set animation(var value) { | 88 void set animation(var value) { |
105 setProperty('${_browserPrefix}animation', value, ''); | 89 setProperty('${_browserPrefix}animation', value, ''); |
106 } | 90 } |
107 | 91 |
108 /** Gets the value of "animation-delay" */ | 92 /** Gets the value of "animation-delay" */ |
(...skipping 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 | 2836 |
2853 /** Gets the value of "zoom" */ | 2837 /** Gets the value of "zoom" */ |
2854 String get zoom() => | 2838 String get zoom() => |
2855 getPropertyValue('zoom'); | 2839 getPropertyValue('zoom'); |
2856 | 2840 |
2857 /** Sets the value of "zoom" */ | 2841 /** Sets the value of "zoom" */ |
2858 void set zoom(var value) { | 2842 void set zoom(var value) { |
2859 setProperty('zoom', value, ''); | 2843 setProperty('zoom', value, ''); |
2860 } | 2844 } |
2861 } | 2845 } |
OLD | NEW |