Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

Commit 69704ab

Browse files
authored
Merge pull request #61 from webcomponents/last-instance-is
Fix last spot where element.is is checked
2 parents 39eccce + e10429d commit 69704ab

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

scoping-shim.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scoping-shim.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/style-properties.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class StyleProperties {
303303
return;
304304
}
305305
let {is, typeExtension} = StyleUtil.getIsExtends(scope);
306-
let hostScope = scope.is ?
306+
let hostScope = is ?
307307
StyleTransformer._calcHostScope(is, typeExtension) :
308308
'html';
309309
let parsedSelector = rule['parsedSelector'];

tests/scoping.html

+22
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,19 @@
304304
<slot></slot>
305305
</template>
306306

307+
<template id="self-test">
308+
<style>
309+
:host {
310+
--border: 10px solid rgb(123, 123, 123);
311+
}
312+
313+
a {
314+
border: var(--border);
315+
}
316+
</style>
317+
<a>I should be red.</a>
318+
</template>
319+
307320
<script>
308321
(function() {
309322
function assertComputed(element, value, property, pseudo) {
@@ -688,6 +701,15 @@
688701
document.body.removeChild(e2);
689702
});
690703

704+
test('self-use is supported', function() {
705+
makeElement('self-test');
706+
var e = document.createElement('self-test');
707+
document.body.appendChild(e);
708+
flush();
709+
assertComputed(e.shadowRoot.firstElementChild, '10px');
710+
document.body.removeChild(e);
711+
});
712+
691713
});
692714

693715
})();

0 commit comments

Comments
 (0)