| Index: third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js b/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js
|
| index 640b155c19893618cf174b49b13c07e59d13aef1..54ad11045a388cf890ba8c6f41feda6c3e258cd4 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js
|
| @@ -418,7 +418,6 @@ var nativeRemoveChild = Element.prototype.removeChild;
|
| var nativeAppendChild = Element.prototype.appendChild;
|
| var nativeCloneNode = Element.prototype.cloneNode;
|
| var nativeImportNode = Document.prototype.importNode;
|
| -var dirtyRoots = [];
|
| var DomApi = function (node) {
|
| this.node = node;
|
| if (this.patch) {
|
| @@ -427,17 +426,12 @@ this.patch();
|
| };
|
| DomApi.prototype = {
|
| flush: function () {
|
| -for (var i = 0, host; i < dirtyRoots.length; i++) {
|
| -host = dirtyRoots[i];
|
| -host.flushDebouncer('_distribute');
|
| -}
|
| -dirtyRoots = [];
|
| +Polymer.dom.flush();
|
| },
|
| _lazyDistribute: function (host) {
|
| if (host.shadyRoot && host.shadyRoot._distributionClean) {
|
| host.shadyRoot._distributionClean = false;
|
| -host.debounce('_distribute', host._distributeContent);
|
| -dirtyRoots.push(host);
|
| +Polymer.dom.addDebouncer(host.debounce('_distribute', host._distributeContent));
|
| }
|
| },
|
| appendChild: function (node) {
|
| @@ -873,32 +867,44 @@ configurable: true
|
| },
|
| textContent: {
|
| get: function () {
|
| -if (this.node.nodeType === Node.TEXT_NODE) {
|
| +var nt = this.node.nodeType;
|
| +if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) {
|
| return this.node.textContent;
|
| } else {
|
| -return Array.prototype.map.call(this.childNodes, function (c) {
|
| -return c.textContent;
|
| -}).join('');
|
| +var tc = [];
|
| +for (var i = 0, cn = this.childNodes, c; c = cn[i]; i++) {
|
| +if (c.nodeType !== Node.COMMENT_NODE) {
|
| +tc.push(c.textContent);
|
| +}
|
| +}
|
| +return tc.join('');
|
| }
|
| },
|
| set: function (text) {
|
| +var nt = this.node.nodeType;
|
| +if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) {
|
| +this.node.textContent = text;
|
| +} else {
|
| this._clear();
|
| if (text) {
|
| this.appendChild(document.createTextNode(text));
|
| }
|
| +}
|
| },
|
| configurable: true
|
| },
|
| innerHTML: {
|
| get: function () {
|
| -if (this.node.nodeType === Node.TEXT_NODE) {
|
| +var nt = this.node.nodeType;
|
| +if (nt === Node.TEXT_NODE || nt === Node.COMMENT_NODE) {
|
| return null;
|
| } else {
|
| return getInnerHTML(this.node);
|
| }
|
| },
|
| set: function (text) {
|
| -if (this.node.nodeType !== Node.TEXT_NODE) {
|
| +var nt = this.node.nodeType;
|
| +if (nt !== Node.TEXT_NODE || nt !== Node.COMMENT_NODE) {
|
| this._clear();
|
| var d = document.createElement('div');
|
| d.innerHTML = text;
|
| @@ -1011,7 +1017,43 @@ return Polymer.EventApi.factory(obj);
|
| return factory(obj, patch);
|
| }
|
| };
|
| -Polymer.dom.flush = DomApi.prototype.flush;
|
| +Polymer.Base.extend(Polymer.dom, {
|
| +_flushGuard: 0,
|
| +_FLUSH_MAX: 100,
|
| +_needsTakeRecords: !Polymer.Settings.useNativeCustomElements,
|
| +_debouncers: [],
|
| +_finishDebouncer: null,
|
| +flush: function () {
|
| +for (var i = 0; i < this._debouncers.length; i++) {
|
| +this._debouncers[i].complete();
|
| +}
|
| +if (this._finishDebouncer) {
|
| +this._finishDebouncer.complete();
|
| +}
|
| +this._flushPolyfills();
|
| +if (this._debouncers.length && this._flushGuard < this._FLUSH_MAX) {
|
| +this._flushGuard++;
|
| +this.flush();
|
| +} else {
|
| +if (this._flushGuard >= this._FLUSH_MAX) {
|
| +console.warn('Polymer.dom.flush aborted. Flush may not be complete.');
|
| +}
|
| +this._flushGuard = 0;
|
| +}
|
| +},
|
| +_flushPolyfills: function () {
|
| +if (this._needsTakeRecords) {
|
| +CustomElements.takeRecords();
|
| +}
|
| +},
|
| +addDebouncer: function (debouncer) {
|
| +this._debouncers.push(debouncer);
|
| +this._finishDebouncer = Polymer.Debounce(this._finishDebouncer, this._finishFlush);
|
| +},
|
| +_finishFlush: function () {
|
| +Polymer.dom._debouncers = [];
|
| +}
|
| +});
|
| function getLightChildren(node) {
|
| var children = node._lightChildren;
|
| return children ? children : node.childNodes;
|
| @@ -1137,6 +1179,7 @@ this.shadyRoot._dirtyRoots = [];
|
| },
|
| _finishDistribute: function () {
|
| if (this._useContent) {
|
| +this.shadyRoot._distributionClean = true;
|
| if (hasInsertionPoint(this.shadyRoot)) {
|
| this._composeTree();
|
| } else {
|
| @@ -1150,7 +1193,6 @@ this._updateChildNodes(this, children);
|
| }
|
| }
|
| this.shadyRoot._hasDistributed = true;
|
| -this.shadyRoot._distributionClean = true;
|
| }
|
| },
|
| elementMatches: function (selector, node) {
|
|
|