From 40058aeb782f3ca75695a758c8df7506c92b5860 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Wed, 18 Oct 2017 11:58:12 -0700 Subject: [PATCH 1/4] Skip tests of ::shadow and /deep/ under native Shadow DOM These features have been removed from the only native implementation of Shadow DOM v0 (Chrome). --- test/unit/custom-style.html | 6 ++++++ test/unit/preserve-style-include/styling-scoped.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test/unit/custom-style.html b/test/unit/custom-style.html index 3e926a51a7..25990dc06f 100644 --- a/test/unit/custom-style.html +++ b/test/unit/custom-style.html @@ -404,11 +404,17 @@ }); test('::shadow styles applied', function() { + if (Polymer.Settings.useNativeShadow) { + this.skip(); + } assertComputed(xFoo.$.bar2, '2px'); assertComputed(xFoo.$.bar2.$.baz, '3px'); }); test('/deep/ styles applied', function() { + if (Polymer.Settings.useNativeShadow) { + this.skip(); + } assertComputed(xFoo.$.bar3, '4px'); assertComputed(xFoo.$.bar3.$.baz, '5px'); }); diff --git a/test/unit/preserve-style-include/styling-scoped.html b/test/unit/preserve-style-include/styling-scoped.html index a6b5aa9e60..2a4e5fefc8 100644 --- a/test/unit/preserve-style-include/styling-scoped.html +++ b/test/unit/preserve-style-include/styling-scoped.html @@ -213,10 +213,16 @@ }); test('::shadow selectors', function() { + if (Polymer.Settings.useNativeShadow) { + this.skip(); + } assertComputed(styled.$.child.$.shadow, '7px'); }); test('/deep/ selectors', function() { + if (Polymer.Settings.useNativeShadow) { + this.skip(); + } assertComputed(styled.$.child.$.deep, '8px'); }); From 90697bf2da446312ea010dd34cc0600fd16076ae Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Wed, 18 Oct 2017 12:12:48 -0700 Subject: [PATCH 2/4] Add support for styles with a `shady-unscoped` attribute Since `/deep/` has been removed from Shady DOM v0, users must share styles between elements via style modules (e.g. ` + + + + + + + + + diff --git a/test/unit/shady-unscoped-style.html b/test/unit/shady-unscoped-style.html new file mode 100644 index 0000000000..24305987e6 --- /dev/null +++ b/test/unit/shady-unscoped-style.html @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From bba3f5ab0eaa1d5e547e730ad76ec0713ec6f232 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Thu, 19 Oct 2017 15:13:10 -0700 Subject: [PATCH 3/4] Fix tests on Firefox. --- test/unit/shady-unscoped-style.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/shady-unscoped-style.html b/test/unit/shady-unscoped-style.html index 24305987e6..2032ae8f71 100644 --- a/test/unit/shady-unscoped-style.html +++ b/test/unit/shady-unscoped-style.html @@ -94,7 +94,7 @@ }); test('shared and @apply apply when used with unscoped styles', function() { - assertComputed(el1.$.fromStyle, '10px', 'padding'); + assertComputed(el1.$.fromStyle, '10px', 'padding-top'); assertComputed(el1.$.normal, '3px'); assertComputed(el2.$.normal, '3px'); }) @@ -110,8 +110,8 @@ if (Polymer.Settings.useNativeShadow) { this.skip(); } - assertComputed(el1.$.fromStyle, '0px', 'margin'); - assertComputed(el2.$.fromStyle, '0px', 'margin'); + assertComputed(el1.$.fromStyle, '0px', 'margin-top'); + assertComputed(el2.$.fromStyle, '0px', 'margin-top'); }) From 471dc9aaae074b5189f0787f9d3f5f80064b202e Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 19 Oct 2017 17:02:32 -0700 Subject: [PATCH 4/4] fix license issues --- test/unit/shady-unscoped-style-import-css.html | 3 --- test/unit/shady-unscoped-style-import.css | 12 ++++++++++++ test/unit/shady-unscoped-style-import.html | 13 +++++++++++-- test/unit/shady-unscoped-style.html | 9 +++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) delete mode 100644 test/unit/shady-unscoped-style-import-css.html create mode 100644 test/unit/shady-unscoped-style-import.css diff --git a/test/unit/shady-unscoped-style-import-css.html b/test/unit/shady-unscoped-style-import-css.html deleted file mode 100644 index 3e99a3189c..0000000000 --- a/test/unit/shady-unscoped-style-import-css.html +++ /dev/null @@ -1,3 +0,0 @@ -.import { - border: 2px solid yellow; -} \ No newline at end of file diff --git a/test/unit/shady-unscoped-style-import.css b/test/unit/shady-unscoped-style-import.css new file mode 100644 index 0000000000..ebc79b19e0 --- /dev/null +++ b/test/unit/shady-unscoped-style-import.css @@ -0,0 +1,12 @@ +/* +@license +Copyright (c) 2017 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt +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 +*/ +.import { + border: 2px solid yellow; +} \ No newline at end of file diff --git a/test/unit/shady-unscoped-style-import.html b/test/unit/shady-unscoped-style-import.html index 5fe5c6ae4f..808fd49490 100644 --- a/test/unit/shady-unscoped-style-import.html +++ b/test/unit/shady-unscoped-style-import.html @@ -1,5 +1,14 @@ + - +