3 ms·
>Styles and scripts of the main document doesn't apply to it. Ugh. I look forward to being unable to use custom JS / CSS to fix websites that have banners that
by Arnavion 8y ago
>Styles and scripts of the main document doesn't apply to it.
Ugh. I look forward to being unable to use custom JS / CSS to fix websites that have banners that cover half the page, or `max-width`s on their body to constrain themselves to tablet sizes on desktop monitors...
- RobertRoberts 8y agoI had never considered this before. Would Shadow DOM make browser plugins like Stylish useless against horribly layed out websites? There has to be a work around for this issue...
- JeremyBanks 8y agoIt used to be possible to write "shadow-piercing" CSS selectors, but this capability was removed for making it too easy to violate the encapsulation. (And indeed, I saw it frequently used to accommodate misuse of the Shadow DOM API.) https://developers.google.com/web/updates/2017/10/remove-shadow-piercing https://developers.google.com/web/updates/2017/10/remove-sha... It sounds like "Shadow Parts" will let you target subcomponents in some Shadow DOMs, once it's implemented, but I'm afraid that's probably not going to help you with misbehaving websites.
- rictic 8y agoStill definitely possible for browser plugins to do anything they want to Shadow DOM. For open shadow roots, javascript can crawl them. If handling closed shadow trees is necessary, just patch Element.prototype.attachShadow and keep a WeakMap from the Element instance to its shadow root.
- deleted 8y ago[deleted]
- NVRM 8y agoMaybe not related, but we can style frames in various shapes with css clip-path. It start to be reliable. https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path