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

Unified Diff: packages/web_components/lib/webcomponents-lite.js

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/web_components/lib/webcomponents.js ('k') | packages/web_components/lib/webcomponents-lite.min.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/web_components/lib/webcomponents-lite.js
diff --git a/packages/web_components/lib/webcomponents-lite.js b/packages/web_components/lib/webcomponents-lite.js
old mode 100644
new mode 100755
index 1fdb2d3acea4cc5b8a5ca9c839076a3580c342d5..10b5157d734250e438a3ac102a72aa5c0eba247c
--- a/packages/web_components/lib/webcomponents-lite.js
+++ b/packages/web_components/lib/webcomponents-lite.js
@@ -7,7 +7,7 @@
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-// @version 0.7.21
+// @version 0.7.23
(function() {
window.WebComponents = window.WebComponents || {
flags: {}
@@ -165,7 +165,7 @@
this._fragment = "#";
state = "fragment";
} else {
- if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ if (EOF != c && "\t" != c && "\n" != c && "\r" != c) {
this._schemeData += percentEscape(c);
}
}
@@ -296,7 +296,7 @@
seenAt = true;
for (var i = 0; i < buffer.length; i++) {
var cp = buffer[i];
- if (" " == cp || "\n" == cp || "\r" == cp) {
+ if ("\t" == cp || "\n" == cp || "\r" == cp) {
err("Invalid whitespace in authority.");
continue;
}
@@ -330,7 +330,7 @@
state = "relative path start";
}
continue;
- } else if (" " == c || "\n" == c || "\r" == c) {
+ } else if ("\t" == c || "\n" == c || "\r" == c) {
err("Invalid whitespace in file host.");
} else {
buffer += c;
@@ -354,7 +354,7 @@
break loop;
}
continue;
- } else if (" " != c && "\n" != c && "\r" != c) {
+ } else if ("\t" != c && "\n" != c && "\r" != c) {
if ("[" == c) {
seenBracket = true;
} else if ("]" == c) {
@@ -382,7 +382,7 @@
}
state = "relative path start";
continue;
- } else if (" " == c || "\n" == c || "\r" == c) {
+ } else if ("\t" == c || "\n" == c || "\r" == c) {
err("Invalid code point in port: " + c);
} else {
invalid.call(this);
@@ -427,7 +427,7 @@
this._fragment = "#";
state = "fragment";
}
- } else if (" " != c && "\n" != c && "\r" != c) {
+ } else if ("\t" != c && "\n" != c && "\r" != c) {
buffer += percentEscape(c);
}
break;
@@ -436,13 +436,13 @@
if (!stateOverride && "#" == c) {
this._fragment = "#";
state = "fragment";
- } else if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ } else if (EOF != c && "\t" != c && "\n" != c && "\r" != c) {
this._query += percentEscapeQuery(c);
}
break;
case "fragment":
- if (EOF != c && " " != c && "\n" != c && "\r" != c) {
+ if (EOF != c && "\t" != c && "\n" != c && "\r" != c) {
this._fragment += c;
}
break;
@@ -914,14 +914,29 @@ if (typeof WeakMap === "undefined") {
(function() {
var needsTemplate = typeof HTMLTemplateElement === "undefined";
+ if (/Trident/.test(navigator.userAgent)) {
+ (function() {
+ var importNode = document.importNode;
+ document.importNode = function() {
+ var n = importNode.apply(document, arguments);
+ if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
+ var f = document.createDocumentFragment();
+ f.appendChild(n);
+ return f;
+ } else {
+ return n;
+ }
+ };
+ })();
+ }
var needsCloning = function() {
if (!needsTemplate) {
- var frag = document.createDocumentFragment();
var t = document.createElement("template");
- frag.appendChild(t);
- t.content.appendChild(document.createElement("div"));
- var clone = frag.cloneNode(true);
- return clone.firstChild.content.childNodes.length === 0;
+ var t2 = document.createElement("template");
+ t2.content.appendChild(document.createElement("div"));
+ t.content.appendChild(t2);
+ var clone = t.cloneNode(true);
+ return clone.content.childNodes.length === 0 || clone.content.firstChild.content.childNodes.length === 0;
}
}();
var TEMPLATE_TAG = "template";
@@ -943,6 +958,9 @@ if (typeof WeakMap === "undefined") {
while (child = template.firstChild) {
template.content.appendChild(child);
}
+ template.cloneNode = function(deep) {
+ return TemplateImpl.cloneNode(this, deep);
+ };
if (canDecorate) {
try {
Object.defineProperty(template, "innerHTML", {
@@ -965,9 +983,6 @@ if (typeof WeakMap === "undefined") {
},
configurable: true
});
- template.cloneNode = function(deep) {
- return TemplateImpl.cloneNode(this, deep);
- };
} catch (err) {
canDecorate = false;
}
@@ -987,7 +1002,7 @@ if (typeof WeakMap === "undefined") {
document.createElement = function() {
"use strict";
var el = createElement.apply(document, arguments);
- if (el.localName == "template") {
+ if (el.localName === "template") {
TemplateImpl.decorate(el);
}
return el;
@@ -1015,7 +1030,7 @@ if (typeof WeakMap === "undefined") {
if (needsTemplate || needsCloning) {
var nativeCloneNode = Node.prototype.cloneNode;
TemplateImpl.cloneNode = function(template, deep) {
- var clone = nativeCloneNode.call(template);
+ var clone = nativeCloneNode.call(template, false);
if (this.decorate) {
this.decorate(clone);
}
@@ -1026,6 +1041,7 @@ if (typeof WeakMap === "undefined") {
return clone;
};
TemplateImpl.fixClonedDom = function(clone, source) {
+ if (!source.querySelectorAll) return;
var s$ = source.querySelectorAll(TEMPLATE_TAG);
var t$ = clone.querySelectorAll(TEMPLATE_TAG);
for (var i = 0, l = t$.length, t, s; i < l; i++) {
@@ -1063,13 +1079,13 @@ if (typeof WeakMap === "undefined") {
}
}
if (needsTemplate) {
- HTMLTemplateElement = TemplateImpl;
+ window.HTMLTemplateElement = TemplateImpl;
}
})();
(function(scope) {
"use strict";
- if (!window.performance) {
+ if (!(window.performance && window.performance.now)) {
var start = Date.now();
window.performance = {
now: function() {
@@ -2231,6 +2247,9 @@ window.CustomElements.addModule(function(scope) {
definition.prototype = Object.create(HTMLElement.prototype);
}
definition.__name = name.toLowerCase();
+ if (definition.extends) {
+ definition.extends = definition.extends.toLowerCase();
+ }
definition.lifecycle = definition.lifecycle || {};
definition.ancestry = ancestry(definition.extends);
resolveTagName(definition);
@@ -2403,21 +2422,6 @@ window.CustomElements.addModule(function(scope) {
}
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
wrapDomMethodToForceUpgrade(document, "importNode");
- if (isIE) {
- (function() {
- var importNode = document.importNode;
- document.importNode = function() {
- var n = importNode.apply(document, arguments);
- if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) {
- var f = document.createDocumentFragment();
- f.appendChild(n);
- return f;
- } else {
- return n;
- }
- };
- })();
- }
document.registerElement = register;
document.createElement = createElement;
document.createElementNS = createElementNS;
« no previous file with comments | « packages/web_components/lib/webcomponents.js ('k') | packages/web_components/lib/webcomponents-lite.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698