Shadow DOM enabled in Firefox nightly
bugzilla.mozilla.org
bugzilla.mozilla.org
I'm hopeful that the day will come when WebComponents provide a superior experience to the megabytes of JS that are imposed on a user's experience, but seeing how long it took IE to die I'm pessimistic
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...
There has to be a work around for this issue...
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.
---
> It can act in the shadow too, allowing parallel computing. Is it the great beginning of «in browser javascript multi threading»?
Unless something has recently changed, this is not true.
Shadow DOM elements are still part of the same JavaScript execution environment as the Light DOM; there's no concurrency at that level.
If you want browser multi-threading, we've had WebWorkers for years and they keep getting better (OffscreenCanvas and module support being current examples).
There are also a lot of existing web components libraries that have been developed in anticipation of first class support for Shadow DOM in all browsers. See https://en.m.wikipedia.org/wiki/Web_Components#Libraries
Of the less-major ones, I only know that Polymer uses it - which makes sense, since this is one of the APIs it was explicitly created to push.
All I need is a fail safe way of modifying style inside shadow containers without the 3rd party adding support for it (right now we are modifying an angular material based site, because, you know, before the release the most important thing is that how these elements animate or how their drop shadow look), fail safe meaning that it should not be possible to accidentally overwrite stuff inside shadows (like generic link styling).
But probably it's a conflict of interest... everyone wants perfectly contained elements (because css is scary) but wants to retain maximum customizability without modifying the upstream package, plus we don't want shadow contained css to be duplicated. Not sure if there's a good solution for that.
https://developer.mozilla.org/en-US/docs/Web/Web_Components/...
And as for what it is, you know how a given web page has global css/query selector scope? Shadow dom is like a membrane in there, where styles and other things don't go in (unless you explicitly poke a hole). It's like a whole new document that you can nest inside an existing document. It's encapsulation inside browsers
It sounds like a powerful way to make reusable components where some css can't be overridden because it would break the component (eg. Layout, shape) while allowing other parts to be overridden (colour, size, font, etc.)
Polymer has a tendency to get confused by its own loading process and go into infinite loops. Are there any other shadow DOM polyfills out there?
(And last I checked, Polymer was polyfilling the old proposal, not the one that is currently being implemented in browsers.)
The webcomponentsjs package has polyfilled the v1 Web Components specs for over a year. Polymer 2.x was the version that used the new specs instead of the older v0 specs.
https://bugzilla.mozilla.org/show_bug.cgi?id=1256031 has an example of a page using polymer that runs into this problem.
Also, that's an old version of the polyfills, before Polymer 2.0, it might have been fixed on our end quite a while ago.
if it works, it works, though.
30 play buttons 30 vulume sliders 30 pause buttons Etc
That's a lot in the DOM.
So intead you put the html5 video player components in shadowDOM and reference as needed. Only have them once then.
Is the state separated from structure ?
Is this about a better API or something?
Edit: Ohh, I must have enabled it in about:config manually back then. It's existed since at least Jan 2015 [0], but was disabled by default until this just now in Nightly.
[0] https://www.designedbyaturtle.co.uk/2015/how-to-enable-web-c...
I tried it on the new chrome manage bookmarks page to reduce the whitespace but I could only edit a single instance; I couldn't adjust the whole page the way you can with normal CSS.
As far as I can tell, shadow-dom and web components are anti-tinker in that they don't allow users to play with the underlying definitions in order to learn how to use those technologies themselves. I think that will be a big barrier to adoption.