From a9f9975118d837773caf8e83534c0e58bb80d06f Mon Sep 17 00:00:00 2001 From: Tomo Ueda Date: Mon, 22 Jun 2020 17:55:14 -0700 Subject: [PATCH] Loosen _attachDom return signature. --- CHANGELOG.md | 3 +++ lib/mixins/element-mixin.d.ts | 2 +- lib/mixins/element-mixin.js | 2 +- test/unit/mixin-utils.html | 2 +- test/unit/polymer.element.html | 6 ++++++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 990bf46792..5050230823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [UNRELEASED]() () +- Loosen _attachDom return signature. ([commit]()) + ## [v3.4.1](https://github.com/Polymer/polymer/tree/v3.4.1) (2020-04-29) - [ci skip] bump to 3.4.1 ([commit](https://github.com/Polymer/polymer/commit/12fa1b50)) diff --git a/lib/mixins/element-mixin.d.ts b/lib/mixins/element-mixin.d.ts index f9eef31279..9f5cd4da3f 100644 --- a/lib/mixins/element-mixin.d.ts +++ b/lib/mixins/element-mixin.d.ts @@ -218,7 +218,7 @@ interface ElementMixin extends PropertyEffects, TemplateStamp, PropertyAccessors * @param dom to attach to the element. * @returns node to which the dom has been attached. */ - _attachDom(dom: StampedTemplate|null): ShadowRoot|null; + _attachDom(dom: StampedTemplate|null): Node|null; /** * When using the ShadyCSS scoping and custom property shim, causes all diff --git a/lib/mixins/element-mixin.js b/lib/mixins/element-mixin.js index 76b7f3ff28..2b1102ee8d 100644 --- a/lib/mixins/element-mixin.js +++ b/lib/mixins/element-mixin.js @@ -731,7 +731,7 @@ export const ElementMixin = dedupingMixin(base => { * @throws {Error} * @suppress {missingReturn} * @param {StampedTemplate} dom to attach to the element. - * @return {ShadowRoot} node to which the dom has been attached. + * @return {Node} node to which the dom has been attached. */ _attachDom(dom) { const n = wrap(this); diff --git a/test/unit/mixin-utils.html b/test/unit/mixin-utils.html index 92aab93cc1..bd242b6396 100644 --- a/test/unit/mixin-utils.html +++ b/test/unit/mixin-utils.html @@ -117,4 +117,4 @@ }); - \ No newline at end of file + diff --git a/test/unit/polymer.element.html b/test/unit/polymer.element.html index c17412639a..2705904b44 100644 --- a/test/unit/polymer.element.html +++ b/test/unit/polymer.element.html @@ -80,6 +80,11 @@ this._calledReady++; } + _attachDom(dom) { + this.appendChild(dom); + return this; + } + _compute(value) { return value; } @@ -401,6 +406,7 @@

Sub template

assert.equal(el.prop, 'base'); assert.equal(el.computedPropDep, true); assert.equal(el.computedProp, true); + assert.isNull(el.shadowRoot); }); test('attributes', function() {