| Index: third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js b/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| index eaf5154a9902cc911d276334b87f334548ffa310..e11ba9f1d3c8034cda7883274e102a11db4ea17a 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| @@ -339,7 +339,15 @@ this.listen(node, name, listeners[key]);
|
| }
|
| },
|
| listen: function (node, eventName, methodName) {
|
| -this._listen(node, eventName, this._createEventHandler(node, eventName, methodName));
|
| +var handler = this._recallEventHandler(this, eventName, node, methodName);
|
| +if (!handler) {
|
| +handler = this._createEventHandler(node, eventName, methodName);
|
| +}
|
| +if (handler._listening) {
|
| +return;
|
| +}
|
| +this._listen(node, eventName, handler);
|
| +handler._listening = true;
|
| },
|
| _boundListenerKey: function (eventName, methodName) {
|
| return eventName + ':' + methodName;
|
| @@ -378,6 +386,7 @@ host[methodName](e, e.detail);
|
| host._warn(host._logf('_createEventHandler', 'listener method `' + methodName + '` not defined'));
|
| }
|
| };
|
| +handler._listening = false;
|
| this._recordEventHandler(host, eventName, node, methodName, handler);
|
| return handler;
|
| },
|
| @@ -385,6 +394,7 @@ unlisten: function (node, eventName, methodName) {
|
| var handler = this._recallEventHandler(this, eventName, node, methodName);
|
| if (handler) {
|
| this._unlisten(node, eventName, handler);
|
| +handler._listening = false;
|
| }
|
| },
|
| _listen: function (node, eventName, handler) {
|
| @@ -1232,6 +1242,12 @@ elt[n] = props[n];
|
| }
|
| }
|
| return elt;
|
| +},
|
| +isLightDescendant: function (node) {
|
| +return this.contains(node) && Polymer.dom(this).getOwnerRoot() === Polymer.dom(node).getOwnerRoot();
|
| +},
|
| +isLocalDescendant: function (node) {
|
| +return this.root === Polymer.dom(node).getOwnerRoot();
|
| }
|
| });
|
| Polymer.Bind = {
|
| @@ -2033,6 +2049,22 @@ if (args.length) {
|
| this._notifySplice(array, path, 0, args.length, []);
|
| }
|
| return ret;
|
| +},
|
| +prepareModelNotifyPath: function (model) {
|
| +this.mixin(model, {
|
| +fire: Polymer.Base.fire,
|
| +notifyPath: Polymer.Base.notifyPath,
|
| +_EVENT_CHANGED: Polymer.Base._EVENT_CHANGED,
|
| +_notifyPath: Polymer.Base._notifyPath,
|
| +_pathEffector: Polymer.Base._pathEffector,
|
| +_annotationPathEffect: Polymer.Base._annotationPathEffect,
|
| +_complexObserverPathEffect: Polymer.Base._complexObserverPathEffect,
|
| +_annotatedComputationPathEffect: Polymer.Base._annotatedComputationPathEffect,
|
| +_computePathEffect: Polymer.Base._computePathEffect,
|
| +_modelForPath: Polymer.Base._modelForPath,
|
| +_pathMatchesEffect: Polymer.Base._pathMatchesEffect,
|
| +_notifyBoundPaths: Polymer.Base._notifyBoundPaths
|
| +});
|
| }
|
| });
|
| }());
|
| @@ -3239,6 +3271,7 @@ properties: { __hideTemplateChildren__: { observer: '_showHideChildren' } },
|
| _instanceProps: Polymer.nob,
|
| _parentPropPrefix: '_parent_',
|
| templatize: function (template) {
|
| +this._templatized = template;
|
| if (!template._content) {
|
| template._content = template.content;
|
| }
|
| @@ -3249,11 +3282,11 @@ return;
|
| }
|
| var archetype = Object.create(Polymer.Base);
|
| this._customPrepAnnotations(archetype, template);
|
| +this._prepParentProperties(archetype, template);
|
| archetype._prepEffects();
|
| this._customPrepEffects(archetype);
|
| archetype._prepBehaviors();
|
| archetype._prepBindings();
|
| -this._prepParentProperties(archetype, template);
|
| archetype._notifyPath = this._notifyPathImpl;
|
| archetype._scopeElementClass = this._scopeElementClassImpl;
|
| archetype.listen = this._listenImpl;
|
| @@ -3336,6 +3369,7 @@ delete parentProps[prop];
|
| proto = archetype._parentPropProto = Object.create(null);
|
| if (template != this) {
|
| Polymer.Bind.prepareModel(proto);
|
| +Polymer.Base.prepareModelNotifyPath(proto);
|
| }
|
| for (prop in parentProps) {
|
| var parentProp = this._parentPropPrefix + prop;
|
| @@ -3354,6 +3388,7 @@ Polymer.Bind.prepareInstance(template);
|
| template._forwardParentProp = this._forwardParentProp.bind(this);
|
| }
|
| this._extendTemplate(template, proto);
|
| +template._pathEffector = this._pathEffectorImpl.bind(this);
|
| }
|
| },
|
| _createForwardPropEffector: function (prop) {
|
| @@ -3364,7 +3399,7 @@ this._forwardParentProp(prop, value);
|
| _createHostPropEffector: function (prop) {
|
| var prefix = this._parentPropPrefix;
|
| return function (source, value) {
|
| -this.dataHost[prefix + prop] = value;
|
| +this.dataHost._templatized[prefix + prop] = value;
|
| };
|
| },
|
| _createInstancePropEffector: function (prop) {
|
| @@ -3396,16 +3431,17 @@ var dot = path.indexOf('.');
|
| var root = dot < 0 ? path : path.slice(0, dot);
|
| dataHost._forwardInstancePath.call(dataHost, this, path, value);
|
| if (root in dataHost._parentProps) {
|
| -dataHost.notifyPath(dataHost._parentPropPrefix + path, value);
|
| +dataHost._templatized.notifyPath(dataHost._parentPropPrefix + path, value);
|
| }
|
| },
|
| -_pathEffector: function (path, value, fromAbove) {
|
| +_pathEffectorImpl: function (path, value, fromAbove) {
|
| if (this._forwardParentPath) {
|
| if (path.indexOf(this._parentPropPrefix) === 0) {
|
| -this._forwardParentPath(path.substring(8), value);
|
| +var subPath = path.substring(this._parentPropPrefix.length);
|
| +this._forwardParentPath(subPath, value);
|
| }
|
| }
|
| -Polymer.Base._pathEffector.apply(this, arguments);
|
| +Polymer.Base._pathEffector.call(this._templatized, path, value, fromAbove);
|
| },
|
| _constructorImpl: function (model, host) {
|
| this._rootDataHost = host._getRootDataHost();
|
| @@ -3448,8 +3484,9 @@ return host._scopeElementClass(node, value);
|
| stamp: function (model) {
|
| model = model || {};
|
| if (this._parentProps) {
|
| +var templatized = this._templatized;
|
| for (var prop in this._parentProps) {
|
| -model[prop] = this[this._parentPropPrefix + prop];
|
| +model[prop] = templatized[this._parentPropPrefix + prop];
|
| }
|
| }
|
| return new this.ctor(model, this);
|
| @@ -4057,7 +4094,7 @@ this.deselect(item);
|
| }
|
| } else {
|
| this.push('selected', item);
|
| -skey = this._selectedColl.getKey(item);
|
| +var skey = this._selectedColl.getKey(item);
|
| this.linkPaths('selected.' + skey, 'items.' + key);
|
| }
|
| } else {
|
|
|