Index: pkg/polymer/lib/src/instance.dart |
diff --git a/pkg/polymer/lib/src/instance.dart b/pkg/polymer/lib/src/instance.dart |
index c9d5adea2d321aad19278e217e974aa89f8c2f79..c089bd2e4d314e8af437655b1bbdff340358b045 100644 |
--- a/pkg/polymer/lib/src/instance.dart |
+++ b/pkg/polymer/lib/src/instance.dart |
@@ -352,7 +352,10 @@ abstract class Polymer implements Element, Observable, NodeBindExtension { |
'incorrect binding types.'); |
} |
prepareElement(); |
- if (!isTemplateStagingDocument(ownerDocument)) { |
+ |
+ // TODO(sorvell): replace when ShadowDOMPolyfill issue is corrected |
+ // https://github.com/Polymer/ShadowDOM/issues/420 |
+ if (!isTemplateStagingDocument(ownerDocument) || _hasShadowDomPolyfill) { |
makeElementReady(); |
} |
} |
@@ -371,6 +374,7 @@ abstract class Polymer implements Element, Observable, NodeBindExtension { |
_element = _getDeclaration(_name); |
// install property storage |
createPropertyObserver(); |
+ // TODO (sorvell): temporarily open observer when created |
openPropertyObserver(); |
// install boilerplate attributes |
copyInstanceAttributes(); |
@@ -520,6 +524,11 @@ abstract class Polymer implements Element, Observable, NodeBindExtension { |
void shadowRootReady(Node root) { |
// locate nodes with id and store references to them in this.$ hash |
marshalNodeReferences(root); |
+ |
+ // set up polymer gestures |
+ if (_PolymerGestures != null) { |
+ _PolymerGestures.callMethod('register', [root]); |
+ } |
} |
/// Locate nodes with id and store references to them in [$] hash. |
@@ -1017,10 +1026,7 @@ abstract class Polymer implements Element, Observable, NodeBindExtension { |
// by default supports 1 thing being bound. |
events.forEach((type, methodName) { |
// Dart note: the getEventHandler method is on our PolymerExpressions. |
- _PolymerGestures.callMethod( |
- 'addEventListener', |
- [this, type, Zone.current.bindUnaryCallback( |
- element.syntax.getEventHandler(this, this, methodName))]); |
+ on[type].listen(element.syntax.getEventHandler(this, this, methodName)); |
}); |
} |
@@ -1167,7 +1173,7 @@ abstract class Polymer implements Element, Observable, NodeBindExtension { |
if (scope == null) return; |
- if (_hasShadowDomPolyfill) { |
+ if (_ShadowCss != null) { |
cssText = _shimCssText(cssText, scope is ShadowRoot ? scope.host : null); |
} |
var style = element.cssTextToScopeStyle(cssText, |