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

Unified Diff: tools/dom/scripts/css_code_generator.py

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/web_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/dartdomgenerator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/css_code_generator.py
diff --git a/tools/dom/scripts/css_code_generator.py b/tools/dom/scripts/css_code_generator.py
index fc437dd3c9c46672a542e0c91fd39e52363eb0f7..3a00dde0224a1ba904d292e704a7c52fec73ce4e 100644
--- a/tools/dom/scripts/css_code_generator.py
+++ b/tools/dom/scripts/css_code_generator.py
@@ -102,8 +102,18 @@ part of $LIBRARYNAME;
class_file.write("""
+$if DART2JS
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
+ $(CLASSNAME)Base $IMPLEMENTS {
+$else
+ $if JSINTEROP
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS) class $CLASSNAME extends
+ $(CLASSNAME)Base $IMPLEMENTS {
+ $else
$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
$(CLASSNAME)Base $IMPLEMENTS {
+ $endif
+$endif
factory $CLASSNAME() => new CssStyleDeclaration.css('');
factory $CLASSNAME.css(String css) {
@@ -150,10 +160,14 @@ $else
return _hasProperty(propertyName);
$endif
}
-$if DARTIUM
+$if DARTIUM
bool _hasProperty(String propertyName) =>
+ $if JSINTEROP
+ _blink.BlinkCSSStyleDeclaration.instance.$__propertyQuery___Callback_1_(unwrap_jso(this), propertyName) != null;
+ $else
_blink.BlinkCSSStyleDeclaration.$__propertyQuery___Callback_1(this, propertyName);
+ $endif
$endif
@DomName('CSSStyleDeclaration.setProperty')
@@ -252,7 +266,15 @@ $if DART2JS
$endif
}
+$if DART2JS
class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
+$else
+ $if JSINTEROP
+class _CssStyleDeclarationSet extends CssStyleDeclarationBase {
+ $else
+class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
+ $endif
+$endif
final Iterable<Element> _elementIterable;
Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
@@ -302,9 +324,23 @@ $endif
// items in the MEMBERS set if you want that functionality.
}
+$if DART2JS
abstract class CssStyleDeclarationBase {
String getPropertyValue(String propertyName);
void setProperty(String propertyName, String value, [String priority]);
+$else
+ $if JSINTEROP
+class CssStyleDeclarationBase {
+ String getPropertyValue(String propertyName) =>
+ throw new StateError('getProperty not overridden in dart:html');
+ void setProperty(String propertyName, String value, [String priority]) =>
+ throw new StateError('setProperty not overridden in dart:html');
+ $else
+abstract class CssStyleDeclarationBase {
+ String getPropertyValue(String propertyName);
+ void setProperty(String propertyName, String value, [String priority]);
+ $endif
+$endif
""")
class_lines = [];
« no previous file with comments | « sdk/lib/web_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/dartdomgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698