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

Unified Diff: third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js

Issue 2074813002: Roll Polymer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chromium.patch Created 4 years, 6 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
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 5d67719d637264baf180cfbd072ceb19a1b75f40..de1317dbcf60df2bb64a8ca2728503fbb16d4e9d 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
@@ -11,8 +11,7 @@ resolve();
addEventListener('DOMContentLoaded', resolve);
}
}
-}());
-window.Polymer = {
+}());window.Polymer = {
Settings: function () {
var settings = window.Polymer || {};
var parts = location.search.slice(1).split('&');
@@ -31,8 +30,7 @@ settings.useNativeShadow = settings.useShadow && settings.nativeShadow;
settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto__;
return settings;
}()
-};
-(function () {
+};(function () {
var userPolymer = window.Polymer;
window.Polymer = function (prototype) {
if (typeof prototype === 'function') {
@@ -79,15 +77,13 @@ Polymer.log && this._regLog(prototype);
dumpRegistrations: function () {
this.registrations.forEach(this._regLog);
}
-};
-Object.defineProperty(window, 'currentImport', {
+};Object.defineProperty(window, 'currentImport', {
enumerable: true,
configurable: true,
get: function () {
return (document._currentScript || document.currentScript).ownerDocument;
}
-});
-Polymer.RenderStatus = {
+});Polymer.RenderStatus = {
_ready: false,
_callbacks: [],
whenReady: function (cb) {
@@ -155,8 +151,7 @@ Polymer.RenderStatus._catchFirstRender();
Polymer.RenderStatus._catchFirstRender();
}
Polymer.ImportStatus = Polymer.RenderStatus;
-Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;
-(function () {
+Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;(function () {
'use strict';
var settings = Polymer.Settings;
Polymer.Base = {
@@ -191,6 +186,9 @@ if (proto._finishRegisterFeatures) {
proto._finishRegisterFeatures();
}
proto._doBehavior('registered');
+if (settings.usePolyfillProto && proto !== this) {
+proto.extend(this, proto);
+}
}
},
attachedCallback: function () {
@@ -201,8 +199,11 @@ self._doBehavior('attached');
});
},
detachedCallback: function () {
-this.isAttached = false;
-this._doBehavior('detached');
+var self = this;
+Polymer.RenderStatus.whenReady(function () {
+self.isAttached = false;
+self._doBehavior('detached');
+});
},
attributeChangedCallback: function (name, oldValue, newValue) {
this._attributeChangedImpl(name);
@@ -236,15 +237,36 @@ if (pd) {
Object.defineProperty(target, name, pd);
}
},
-_log: console.log.apply.bind(console.log, console),
-_warn: console.warn.apply.bind(console.warn, console),
-_error: console.error.apply.bind(console.error, console),
+_logger: function (level, args) {
+if (args.length === 1 && Array.isArray(args[0])) {
+args = args[0];
+}
+switch (level) {
+case 'log':
+case 'warn':
+case 'error':
+console[level].apply(console, args);
+break;
+}
+},
+_log: function () {
+var args = Array.prototype.slice.call(arguments, 0);
+this._logger('log', args);
+},
+_warn: function () {
+var args = Array.prototype.slice.call(arguments, 0);
+this._logger('warn', args);
+},
+_error: function () {
+var args = Array.prototype.slice.call(arguments, 0);
+this._logger('error', args);
+},
_logf: function () {
-return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(arguments, 0));
+return this._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments, 0));
}
};
Polymer.Base._logPrefix = function () {
-var color = window.chrome || /firefox/i.test(navigator.userAgent);
+var color = window.chrome && !/edge/i.test(navigator.userAgent) || /firefox/i.test(navigator.userAgent);
return color ? [
'%c[%s::%s]:',
'font-weight: bold; background-color:#EEEE00;'
@@ -271,8 +293,7 @@ Polymer.isInstance = function (obj) {
return Boolean(obj && obj.__isPolymerInstance__);
};
Polymer.telemetry.instanceCount = 0;
-}());
-(function () {
+}());(function () {
var modules = {};
var lcModules = {};
var findModule = function (id) {
@@ -325,8 +346,7 @@ CustomElements.upgrade(m);
}
}
}
-}());
-Polymer.Base._addFeature({
+}());Polymer.Base._addFeature({
_prepIs: function () {
if (!this.is) {
var module = (document._currentScript || document.currentScript).parentNode;
@@ -339,8 +359,7 @@ if (this.is) {
this.is = this.is.toLowerCase();
}
}
-});
-Polymer.Base._addFeature({
+});Polymer.Base._addFeature({
behaviors: [],
_desugarBehaviors: function () {
if (this.behaviors.length) {
@@ -421,8 +440,7 @@ attached: true,
detached: true,
attributeChanged: true,
ready: true
-};
-Polymer.Base._addFeature({
+};Polymer.Base._addFeature({
_getExtendedPrototype: function (tag) {
return this._getExtendedNativePrototype(tag);
},
@@ -439,8 +457,7 @@ return p;
getNativePrototype: function (tag) {
return Object.getPrototypeOf(document.createElement(tag));
}
-});
-Polymer.Base._addFeature({
+});Polymer.Base._addFeature({
_prepConstructor: function () {
this._factoryArgs = this.extends ? [
this.extends,
@@ -466,8 +483,7 @@ this.factoryImpl.apply(elt, args);
}
return elt;
}
-});
-Polymer.nob = Object.create(null);
+});Polymer.nob = Object.create(null);
Polymer.Base._addFeature({
properties: {},
getPropertyInfo: function (property) {
@@ -526,8 +542,7 @@ t.readOnly = s.readOnly;
}
}
}
-});
-Polymer.CaseMap = {
+});Polymer.CaseMap = {
_caseMap: {},
_rx: {
dashToCamel: /-[a-z]/g,
@@ -541,8 +556,7 @@ return m[1].toUpperCase();
camelToDashCase: function (camel) {
return this._caseMap[camel] || (this._caseMap[camel] = camel.replace(this._rx.camelToDash, '-$1').toLowerCase());
}
-};
-Polymer.Base._addFeature({
+};Polymer.Base._addFeature({
_addHostAttributes: function (attributes) {
if (!this._aggregatedAttributes) {
this._aggregatedAttributes = {};
@@ -652,9 +666,7 @@ default:
return value != null ? value : undefined;
}
}
-});
-Polymer.version = '1.4.0';
-Polymer.Base._addFeature({
+});Polymer.version = "1.5.0";Polymer.Base._addFeature({
_registerFeatures: function () {
this._prepIs();
this._prepBehaviors();

Powered by Google App Engine
This is Rietveld 408576698