Scoped CSS incorrectly applied to Light DOM elements in IE11
Markup
<hx-modal>
<!-- shadow root -->
<div id="hxModal">
<button id="hxClose" type="button">X</button>
<slot></slot>
</div>
<!-- /shadow root -->
<hx-modalhead>...</hx-modalhead>
<hx-modalbody>...</hx-modalbody>
<hx-modalfoot>...</hx-modalfoot>
</hx-modal>
Firefox 61
ShadyCSS in Firefox 61 correctly applies the .hx-modal class to ShadyDOM elements only (i.e., #hxModal.hx-modal, #hxClose.hx-modal, etc.).
IE11
However, in IE 11, it is incorrectly applying the .hx-modal class to LightDOM children (i.e., hx-modalhead.hx-modal, hx-modalhead h3.hx-modal, etc.) which is causing Shady CSS styles to bleed into the light dom.
@CITguy could you provide a JSBin that shows the issue? You can start with http://jsbin.com/birajez/edit?html,output to illustrate the problem.
I'm not able to replicate the issue any more. I'll close this issue, but I've attached additional information for context, should this problem show up again.
The bug was fixed between @webcomponents/webcomponentsjs version 1.2.2/2.0.2 and 1.2.3/2.0.3 when it updated @webcomponents/shadycss from 1.3.1 to 1.3.5.
I think it may have been fixed in #191 (released with v1.3.2), but I can't fully replicate with an online sandbox.
webcomponentsjs 2.0.2 (or 1.2.2)
https://s.codepen.io/CITguy/debug/qMvobB
@webcomponents/[email protected](shipped with@webcomponents/[email protected])
Version 2.0.2/1.2.2 is the last version that shows symptoms of the original issue.
It doesn't add all the classes as described above, but it does add empty class="" attributes to Light DOM children.
IE 11
<div class="style-scope ui-modal" id="uiModal">
<button class="style-scope ui-modal" id="uiClose" type="button">X</button>
<slot class="style-scope ui-modal"></slot>
</div>
<html>
<head>...</head>
<body>
<ui-modal>
<header class="">Modal Head</header>
<div class="">Modal Body</div>
<footer class="">Modal Footer</footer>
</ui-modal>
</body>
</html>
Firefox 62.0.2
<div id="uiModal" class="style-scope ui-modal">
<button id="uiClose" type="button" class="style-scope ui-modal">X</button>
<header class="">Modal Head</header>
<div class="">Modal Body</div>
<footer class="">Modal Footer</footer>
</div>
webcomponentsjs 2.0.3 (or 1.2.3)
https://s.codepen.io/CITguy/debug/PdgjRK
@webcomponents/[email protected](shipped with@webcomponents/[email protected])
Version 2.0.3/1.2.3 is the first version of @webcomponents/webcomponentsjs that no longer adds empty class="" attributes.
IE 11
<div class="style-scope ui-modal" id="uiModal">
<button class="style-scope ui-modal" id="uiClose" type="button">X</button>
<slot class="style-scope ui-modal"></slot>
</div>
<html>
<head>...</head>
<body>
<ui-modal>
<header>Modal Head</header>
<div>Modal Body</div>
<footer>Modal Footer</footer>
</ui-modal>
</body>
</html>
Firefox 62.0.2
<div id="uiModal" class="style-scope ui-modal">
<button id="uiClose" type="button" class="style-scope ui-modal">X</button>
<header>Modal Head</header>
<div>Modal Body</div>
<footer>Modal Footer</footer>
</div>