From fecb209d4beaffe0f0438ac2e9ba34a66211f77e Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Sun, 12 Feb 2017 15:07:37 -0800 Subject: [PATCH 01/14] Reset the `active` state once the callback runs --- src/utils/debounce.html | 2 +- test/unit/debounce.html | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils/debounce.html b/src/utils/debounce.html index dec1366a..744a5dfe 100644 --- a/src/utils/debounce.html +++ b/src/utils/debounce.html @@ -36,7 +36,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN setConfig(asyncModule, cb) { this._asyncModule = asyncModule; this._callback = cb; - this._timer = this._asyncModule.run(this._callback); + this._timer = this._asyncModule.run(this.flush); }, /** diff --git a/test/unit/debounce.html b/test/unit/debounce.html index 25fa255a..1a8aa83d 100644 --- a/test/unit/debounce.html +++ b/test/unit/debounce.html @@ -113,6 +113,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); }); + test('flush debouncer', function(done) { + var callback = sinon.spy(); + var job = Polymer.Debouncer.debounce(null, Polymer.Async.microTask, callback); + + setTimeout(function() { + job.flush(); + assert.isTrue(callback.calledOnce, 'callback should be called once'); + done(); + }); + }); + test('different debouncers and multiple micro tasks', function(done) { var callback = sinon.spy(); var job1 = Polymer.Debouncer.debounce(null, Polymer.Async.microTask, callback); From 956c0a8c86959e7358530155dd5927234d64e301 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 13 Feb 2017 14:22:09 -0800 Subject: [PATCH 02/14] Fold Polymer.Attributes into Polymer.PropertyAccessors * rename _de/serializeAttribute to _de/serializeValue * ad attributeChangedCallback * add `createPropertiesForAttributes --- src/attributes/attributes.html | 207 ------------------------- src/data-elements/dom-bind.html | 3 - src/data-elements/templatize.html | 5 +- src/legacy/legacy-element.html | 4 +- src/properties/property-accessors.html | 192 ++++++++++++++++++++++- src/properties/property-effects.html | 9 +- 6 files changed, 197 insertions(+), 223 deletions(-) delete mode 100644 src/attributes/attributes.html diff --git a/src/attributes/attributes.html b/src/attributes/attributes.html deleted file mode 100644 index 1814c4af..00000000 --- a/src/attributes/attributes.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - diff --git a/src/data-elements/dom-bind.html b/src/data-elements/dom-bind.html index 67b08d86..d0b5a72e 100644 --- a/src/data-elements/dom-bind.html +++ b/src/data-elements/dom-bind.html @@ -10,9 +10,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - - - diff --git a/test/unit/async.html b/test/unit/async.html index 54dde6cb..7406ce17 100644 --- a/test/unit/async.html +++ b/test/unit/async.html @@ -13,7 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - + diff --git a/test/unit/case-map.html b/test/unit/case-map.html index 6b373855..a409409f 100644 --- a/test/unit/case-map.html +++ b/test/unit/case-map.html @@ -13,7 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - + diff --git a/test/unit/custom-style.html b/test/unit/custom-style.html index 0ca5cd9d..c52b14a2 100644 --- a/test/unit/custom-style.html +++ b/test/unit/custom-style.html @@ -300,7 +300,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN suiteSetup(function() { var customStyle = document.querySelector('style[is="custom-style"]'); - stylesBuilt = Polymer.StyleUtil.getCssBuildType(customStyle); + stylesBuilt = false; xBar = document.querySelector('x-bar'); xFoo = document.querySelector('x-foo'); diff --git a/test/unit/dom-repeat.html b/test/unit/dom-repeat.html index 984161f1..dbe51229 100644 --- a/test/unit/dom-repeat.html +++ b/test/unit/dom-repeat.html @@ -15,7 +15,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN -