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/templates/html/impl/impl_CSSStyleDeclaration.darttemplate

Issue 12211099: Fixing TransitionEnd event. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
index 67152b1fadbe9d50f14152cd2c54f9fb0ffb9303..6c732494100a92b36c4a390737b2b962badcc236 100644
--- a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
@@ -21,6 +21,24 @@ String get _browserPrefix {
return _cachedBrowserPrefix;
}
+String _cachedBrowserPropertyPrefix;
+
+/// Prefix as used for JS property names.
+String get _browserPropertyPrefix {
+ if (_cachedBrowserPropertyPrefix == null) {
+ if (_Device.isFirefox) {
+ _cachedBrowserPropertyPrefix = 'moz';
+ } else if (_Device.isIE) {
+ _cachedBrowserPropertyPrefix = 'ms';
+ } else if (_Device.isOpera) {
+ _cachedBrowserPropertyPrefix = 'o';
+ } else {
+ _cachedBrowserPropertyPrefix = 'webkit';
+ }
+ }
+ return _cachedBrowserPropertyPrefix;
+}
+
$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
factory $CLASSNAME() => _$(CLASSNAME)FactoryProvider.create$CLASSNAME();
factory $CLASSNAME.css(String css) =>
@@ -41,6 +59,22 @@ $if DART2JS
JS('void', '#.setAttribute(#, #)', this, propertyName, value);
}
}
+
+ /**
+ * Checks to see if CSS Transitions are supported.
+ */
+ static bool get supportsTransitions {
+ if (JS('bool', '"transition" in document.body.style')) {
+ return true;
+ }
+ var propertyName = '${_browserPropertyPrefix}Transition';
+ return JS('bool', '# in document.body.style', propertyName);
+ }
+$else
+ /**
+ * Checks to see if CSS Transitions are supported.
+ */
+ static bool get supportsTransitions => true;
$endif
// TODO(jacobr): generate this list of properties using the existing script.
@@ -2970,10 +3004,18 @@ $endif
}
/** Gets the value of "transition" */
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
String get transition =>
getPropertyValue('${_browserPrefix}transition');
/** Sets the value of "transition" */
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
void set transition(String value) {
setProperty('${_browserPrefix}transition', value, '');
}
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698