| Index: third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js b/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js
|
| index 1927c935f35462f58e7255c370315063f2e222ba..38293de2cb21a9a66dc6853bf3a177bc178cddc9 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js
|
| @@ -12,7 +12,7 @@ addEventListener('DOMContentLoaded', resolve);
|
| }
|
| }
|
| }());
|
| -Polymer = {
|
| +window.Polymer = {
|
| Settings: function () {
|
| var user = window.Polymer || {};
|
| location.search.slice(1).split('&').forEach(function (o) {
|
| @@ -40,15 +40,21 @@ useNativeCustomElements: useNativeCustomElements
|
| (function () {
|
| var userPolymer = window.Polymer;
|
| window.Polymer = function (prototype) {
|
| -var ctor = desugar(prototype);
|
| -prototype = ctor.prototype;
|
| +if (typeof prototype === 'function') {
|
| +prototype = prototype.prototype;
|
| +}
|
| +if (!prototype) {
|
| +prototype = {};
|
| +}
|
| +var factory = desugar(prototype);
|
| +prototype = factory.prototype;
|
| var options = { prototype: prototype };
|
| if (prototype.extends) {
|
| options.extends = prototype.extends;
|
| }
|
| Polymer.telemetry._registrate(prototype);
|
| document.registerElement(prototype.is, options);
|
| -return ctor;
|
| +return factory;
|
| };
|
| var desugar = function (prototype) {
|
| var base = Polymer.Base;
|
| @@ -125,6 +131,8 @@ _addFeature: function (feature) {
|
| this.extend(this, feature);
|
| },
|
| registerCallback: function () {
|
| +this._desugarBehaviors();
|
| +this._doBehavior('beforeRegister');
|
| this._registerFeatures();
|
| this._doBehavior('registered');
|
| },
|
| @@ -209,6 +217,9 @@ Polymer.telemetry.instanceCount = 0;
|
| (function () {
|
| var modules = {};
|
| var lcModules = {};
|
| +var findModule = function (id) {
|
| +return modules[id] || lcModules[id.toLowerCase()];
|
| +};
|
| var DomModule = function () {
|
| return document.createElement('dom-module');
|
| };
|
| @@ -227,31 +238,27 @@ lcModules[id.toLowerCase()] = this;
|
| }
|
| },
|
| import: function (id, selector) {
|
| -var m = modules[id] || lcModules[id.toLowerCase()];
|
| +if (id) {
|
| +var m = findModule(id);
|
| if (!m) {
|
| forceDocumentUpgrade();
|
| -m = modules[id];
|
| +m = findModule(id);
|
| }
|
| if (m && selector) {
|
| m = m.querySelector(selector);
|
| }
|
| return m;
|
| }
|
| +}
|
| });
|
| var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
| -if (cePolyfill) {
|
| -var ready = CustomElements.ready;
|
| -CustomElements.ready = true;
|
| -}
|
| document.registerElement('dom-module', DomModule);
|
| -if (cePolyfill) {
|
| -CustomElements.ready = ready;
|
| -}
|
| function forceDocumentUpgrade() {
|
| if (cePolyfill) {
|
| var script = document._currentScript || document.currentScript;
|
| -if (script) {
|
| -CustomElements.upgradeAll(script.ownerDocument);
|
| +var doc = script && script.ownerDocument;
|
| +if (doc) {
|
| +CustomElements.upgradeAll(doc);
|
| }
|
| }
|
| }
|
| @@ -272,11 +279,17 @@ this.is = this.is.toLowerCase();
|
| });
|
| Polymer.Base._addFeature({
|
| behaviors: [],
|
| -_prepBehaviors: function () {
|
| +_desugarBehaviors: function () {
|
| if (this.behaviors.length) {
|
| -this.behaviors = this._flattenBehaviorsList(this.behaviors);
|
| +this.behaviors = this._desugarSomeBehaviors(this.behaviors);
|
| }
|
| -this._prepAllBehaviors(this.behaviors);
|
| +},
|
| +_desugarSomeBehaviors: function (behaviors) {
|
| +behaviors = this._flattenBehaviorsList(behaviors);
|
| +for (var i = behaviors.length - 1; i >= 0; i--) {
|
| +this._mixinBehavior(behaviors[i]);
|
| +}
|
| +return behaviors;
|
| },
|
| _flattenBehaviorsList: function (behaviors) {
|
| var flat = [];
|
| @@ -291,15 +304,6 @@ this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for miss
|
| }, this);
|
| return flat;
|
| },
|
| -_prepAllBehaviors: function (behaviors) {
|
| -for (var i = behaviors.length - 1; i >= 0; i--) {
|
| -this._mixinBehavior(behaviors[i]);
|
| -}
|
| -for (var i = 0, l = behaviors.length; i < l; i++) {
|
| -this._prepBehavior(behaviors[i]);
|
| -}
|
| -this._prepBehavior(this);
|
| -},
|
| _mixinBehavior: function (b) {
|
| Object.getOwnPropertyNames(b).forEach(function (n) {
|
| switch (n) {
|
| @@ -323,6 +327,15 @@ break;
|
| }
|
| }, this);
|
| },
|
| +_prepBehaviors: function () {
|
| +this._prepFlattenedBehaviors(this.behaviors);
|
| +},
|
| +_prepFlattenedBehaviors: function (behaviors) {
|
| +for (var i = 0, l = behaviors.length; i < l; i++) {
|
| +this._prepBehavior(behaviors[i]);
|
| +}
|
| +this._prepBehavior(this);
|
| +},
|
| _doBehavior: function (name, args) {
|
| this.behaviors.forEach(function (b) {
|
| this._invokeBehavior(b, name, args);
|
| @@ -555,7 +568,7 @@ debouncer.stop();
|
| }
|
| }
|
| });
|
| -Polymer.version = '1.0.9';
|
| +Polymer.version = '1.1.3';
|
| Polymer.Base._addFeature({
|
| _registerFeatures: function () {
|
| this._prepIs();
|
|
|