From fb522f63a251cf162a911d1991dfa3147fae640e Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Thu, 4 Jan 2018 17:38:11 -0800 Subject: [PATCH 1/3] Allow adding type="custom" to avoid deprecation warning. Fixes #5017 --- lib/elements/custom-style.html | 14 ++++++++++---- test/unit/custom-style-import.html | 4 ++-- test/unit/custom-style.html | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/elements/custom-style.html b/lib/elements/custom-style.html index 651fe94bbf..1229bcf07a 100644 --- a/lib/elements/custom-style.html +++ b/lib/elements/custom-style.html @@ -13,8 +13,9 @@ (function() { 'use strict'; - const attr = 'include'; - + const INCLUDE = 'include'; + const TYPE = 'type'; + const CustomStyleInterface = window.ShadyCSS.CustomStyleInterface; /** @@ -86,9 +87,9 @@ return null; } this._style = style; - const include = style.getAttribute(attr); + const include = style.getAttribute(INCLUDE); if (include) { - style.removeAttribute(attr); + style.removeAttribute(INCLUDE); style.textContent = Polymer.StyleGather.cssFromModules(include) + style.textContent; } /* @@ -102,6 +103,11 @@ cases of ordering w.r.t the main document styles. */ if (this.ownerDocument !== window.document) { + // Allow users to add `type="custom"` to