-
Notifications
You must be signed in to change notification settings - Fork 73
Leak of [hidden] CSS rule with !important
declaration
#86
Comments
I believe this is a limitation of the shady DOM shim. There's no true encapsulation of styles, so it's true that if you include this somewhere, the style for the I'm not sure I understand exactly why this is a problem -- if you're expecting |
@notwaldorf: Thanks for your feedback. My main concern is that things break when switching to shadow DOM while they work fine with shady DOM. Please see this example to get a better understanding what I'm talking about. Because of the leaked If such a low-level element like Since the CSS declaration is required only for IE, I would like to get rid of it and fix it in another way which would not impact other code that much. If I would know which IE issues are fixed with it, I could look into it. |
@uwolfer To make sure the shadow DOM works in the same way, shouldn't you import |
@notwaldorf: |
@uwolfer is right. We don’t use iron-flex-layout directly in any of our elements. It’s pulled in by other iron-* elements. |
There is a related comment by @kevinpschaaf about |
@uwolfer In your original JSBin, I don't see a difference between using the shady and shadow DOM. I had created a PR to encapsulate the style, but I'm seeing the same result. I can't run your gerrit example, unfortunately -- would you mind putting together a JSBin with a smaller We added the |
@notwaldorf: Thanks a lot, I've verified that it fixes things as expected. I've also re-checked my JSBin. You are right, it behaves the same way in both shady and shadow DOM. I think it is related to the fact that in the JSBin all includes (and elements) are in one 'file' (also the You can check out the Gerrit example without installing anything:
You can see for example that the star icon in front of list items is visible in shadow mode while it is hidden in shady. It is hidden because of the leaked Important note: I really think you should mark this as breaking change (and add a big note in release notes) and release a new major version of |
Oh, I didn't say I would merge #89, if it's a breaking change (which it might be) -- I just wanted to understand whether that was causing your problem. 😊 |
I suggest simply removing the The root issue here is that the A work around for this is to "fix" the hidden selector by making it apply |
I fully agree with @sorvell. Btw, I think the label "pending-response" can be removed. Or do you require any information from me? |
The
iron-flex-layout
element leaks[hidden]
CSS rule with!important
declaration.Expected outcome
The element should not leak CSS with important declaration.
Actual outcome
As soon as this element is included (when using shady DOM), it leaks following CSS:
https://github.com/PolymerElements/iron-flex-layout/blob/master/iron-flex-layout.html#L51-L53
Steps to reproduce
I have prepared a JS Bin. When you remove the (unused)
iron-flex-layout
import, the output is different.The main issue is that the outcome is different when using shady DOM or shadow DOM. When using shady DOM, the CSS rule is leaked and thing look "correct". As soon as you switch to shadow DOM, things break when you use a
display
CSS property (see my JS Bin).This issue got introduced with #26 which as required for IE according to the description. If you can provide a description which bug it fixes exactly, I'm happy to look into this issue and create a PR if possible.
Tested with Chromium 50.
The text was updated successfully, but these errors were encountered: