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

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

Issue 1173403004: Changed to use JSInterop (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Re-gen'd somehow diffs stopped showing up in CL Created 5 years, 5 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
OLDNEW
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 $if DART2JS
14 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with 15 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
15 $(CLASSNAME)Base $IMPLEMENTS { 16 $(CLASSNAME)Base $IMPLEMENTS {
17 $else
18 $if JSINTEROP
19 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS) class $CLASSNAME extends
20 $(CLASSNAME)Base $IMPLEMENTS {
21 $else
22 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
23 $(CLASSNAME)Base $IMPLEMENTS {
24 $endif
25 $endif
16 factory $CLASSNAME() => new CssStyleDeclaration.css(''); 26 factory $CLASSNAME() => new CssStyleDeclaration.css('');
17 27
18 factory $CLASSNAME.css(String css) { 28 factory $CLASSNAME.css(String css) {
19 final style = new Element.tag('div').style; 29 final style = new Element.tag('div').style;
20 style.cssText = css; 30 style.cssText = css;
21 return style; 31 return style;
22 } 32 }
23 33
24 String getPropertyValue(String propertyName) { 34 String getPropertyValue(String propertyName) {
25 var propValue = _getPropertyValueHelper(propertyName); 35 var propValue = _getPropertyValueHelper(propertyName);
(...skipping 26 matching lines...) Expand all
52 return JS('bool', '# in #', propertyName, this); 62 return JS('bool', '# in #', propertyName, this);
53 $else 63 $else
54 // You can't just check the value of a property, because there is no way 64 // You can't just check the value of a property, because there is no way
55 // to distinguish between property not being present in the browser and 65 // to distinguish between property not being present in the browser and
56 // not having a value at all. (Ultimately we'll want the native method to 66 // not having a value at all. (Ultimately we'll want the native method to
57 // return null if the property doesn't exist and empty string if it's 67 // return null if the property doesn't exist and empty string if it's
58 // defined but just doesn't have a value. 68 // defined but just doesn't have a value.
59 return _hasProperty(propertyName); 69 return _hasProperty(propertyName);
60 $endif 70 $endif
61 } 71 }
72
62 $if DARTIUM 73 $if DARTIUM
63
64 bool _hasProperty(String propertyName) => 74 bool _hasProperty(String propertyName) =>
75 $if JSINTEROP
76 _blink.BlinkCSSStyleDeclaration.instance.$__propertyQuery___Callback_1_(un wrap_jso(this), propertyName) != null;
77 $else
65 _blink.BlinkCSSStyleDeclaration.$__propertyQuery___Callback_1(this, proper tyName); 78 _blink.BlinkCSSStyleDeclaration.$__propertyQuery___Callback_1(this, proper tyName);
79 $endif
66 $endif 80 $endif
67 81
68 @DomName('CSSStyleDeclaration.setProperty') 82 @DomName('CSSStyleDeclaration.setProperty')
69 void setProperty(String propertyName, String value, [String priority]) { 83 void setProperty(String propertyName, String value, [String priority]) {
70 return _setPropertyHelper(_browserPropertyName(propertyName), 84 return _setPropertyHelper(_browserPropertyName(propertyName),
71 value, priority); 85 value, priority);
72 } 86 }
73 87
74 String _browserPropertyName(String propertyName) { 88 String _browserPropertyName(String propertyName) {
75 String name = _readCache(propertyName); 89 String name = _readCache(propertyName);
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 void set zIndex(String value) { 1139 void set zIndex(String value) {
1126 _zIndex = value == null ? '' : value; 1140 _zIndex = value == null ? '' : value;
1127 } 1141 }
1128 @Returns('String') 1142 @Returns('String')
1129 @JSName('zIndex') 1143 @JSName('zIndex')
1130 String _zIndex; 1144 String _zIndex;
1131 1145
1132 $endif 1146 $endif
1133 } 1147 }
1134 1148
1149 $if DART2JS
1135 class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase { 1150 class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
1151 $else
1152 $if JSINTEROP
1153 class _CssStyleDeclarationSet extends CssStyleDeclarationBase {
1154 $else
1155 class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
1156 $endif
1157 $endif
1136 final Iterable<Element> _elementIterable; 1158 final Iterable<Element> _elementIterable;
1137 Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable; 1159 Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
1138 1160
1139 _CssStyleDeclarationSet(this._elementIterable) { 1161 _CssStyleDeclarationSet(this._elementIterable) {
1140 _elementCssStyleDeclarationSetIterable = new List.from( 1162 _elementCssStyleDeclarationSetIterable = new List.from(
1141 _elementIterable).map((e) => e.style); 1163 _elementIterable).map((e) => e.style);
1142 } 1164 }
1143 1165
1144 String getPropertyValue(String propertyName) => 1166 String getPropertyValue(String propertyName) =>
1145 _elementCssStyleDeclarationSetIterable.first.getPropertyValue( 1167 _elementCssStyleDeclarationSetIterable.first.getPropertyValue(
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 1633
1612 $endif 1634 $endif
1613 1635
1614 // Important note: CssStyleDeclarationSet does NOT implement every method 1636 // Important note: CssStyleDeclarationSet does NOT implement every method
1615 // available in CssStyleDeclaration. Some of the methods don't make so much 1637 // available in CssStyleDeclaration. Some of the methods don't make so much
1616 // sense in terms of having a resonable value to return when you're 1638 // sense in terms of having a resonable value to return when you're
1617 // considering a list of Elements. You will need to manually add any of the 1639 // considering a list of Elements. You will need to manually add any of the
1618 // items in the MEMBERS set if you want that functionality. 1640 // items in the MEMBERS set if you want that functionality.
1619 } 1641 }
1620 1642
1643 $if DART2JS
1621 abstract class CssStyleDeclarationBase { 1644 abstract class CssStyleDeclarationBase {
1622 String getPropertyValue(String propertyName); 1645 String getPropertyValue(String propertyName);
1623 void setProperty(String propertyName, String value, [String priority]); 1646 void setProperty(String propertyName, String value, [String priority]);
1647 $else
1648 $if JSINTEROP
1649 class CssStyleDeclarationBase {
1650 String getPropertyValue(String propertyName) =>
1651 throw new StateError('getProperty not overridden in dart:html');
1652 void setProperty(String propertyName, String value, [String priority]) =>
1653 throw new StateError('setProperty not overridden in dart:html');
1654 $else
1655 abstract class CssStyleDeclarationBase {
1656 String getPropertyValue(String propertyName);
1657 void setProperty(String propertyName, String value, [String priority]);
1658 $endif
1659 $endif
1624 1660
1625 /** Gets the value of "align-content" */ 1661 /** Gets the value of "align-content" */
1626 String get alignContent => 1662 String get alignContent =>
1627 getPropertyValue('align-content'); 1663 getPropertyValue('align-content');
1628 1664
1629 /** Sets the value of "align-content" */ 1665 /** Sets the value of "align-content" */
1630 void set alignContent(String value) { 1666 void set alignContent(String value) {
1631 setProperty('align-content', value, ''); 1667 setProperty('align-content', value, '');
1632 } 1668 }
1633 1669
(...skipping 3065 matching lines...) Expand 10 before | Expand all | Expand 10 after
4699 4735
4700 /** Gets the value of "zoom" */ 4736 /** Gets the value of "zoom" */
4701 String get zoom => 4737 String get zoom =>
4702 getPropertyValue('zoom'); 4738 getPropertyValue('zoom');
4703 4739
4704 /** Sets the value of "zoom" */ 4740 /** Sets the value of "zoom" */
4705 void set zoom(String value) { 4741 void set zoom(String value) {
4706 setProperty('zoom', value, ''); 4742 setProperty('zoom', value, '');
4707 } 4743 }
4708 } 4744 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698