Re: [csswg-drafts] Inheritance makes shadow roots observable (#3248)

The CSS Working Group just discussed `Inheritance makes shadow roots observable`.

<details><summary>The full IRC log of that discussion</summary>
&lt;kbabbitt> emilio: this came up a couple times ebcause we don't have ... things like select object and a couple others media as well<br>
&lt;kbabbitt> ... are elements that in some implementations use shadow DOM to implement their behavior<br>
&lt;kbabbitt> ... but it has some implications with inheritance<br>
&lt;kbabbitt> ... where inheritance works as, if you slot the contents, if you do something like inherited and noninherited properties might get different values than you expect if you don' tuse shadow dom<br>
&lt;kbabbitt> ... this has bit us a couple ties, maybe we need to explicitly define which elements use shadow DOM<br>
&lt;kbabbitt> ... option and select in Gecko<br>
&lt;kbabbitt> .. do people have strong opinions on this? or should we just define specific shadow trees for this<br>
&lt;kbabbitt> astearns: I thought one reason to allow but not require UAs to use shadow DOM was that we wanted that wiggle room across various implementations<br>
&lt;kbabbitt> emilio: generally yes but that's been less and less the case with appearance:base<br>
&lt;kbabbitt> ... we need to define, ideally it shouldn't affect inheritance behavior, falls out of shadow DOM definition<br>
&lt;kbabbitt> ... works across flat tree instead of regular DOM tree<br>
&lt;kbabbitt> ... different option would be something like explicit inheritance works through DOM tree, but thats weird and you have 2 styles to inherit from<br>
&lt;kbabbitt> ... a number of options discussed in HTML issue that annevk linked<br>
&lt;kbabbitt> ... don't think we need a resolution here, unless we feel strongly we don't want to change behavior of shaodw DOM and this should be sorted out in HTML<br>
&lt;kbabbitt> ... HTML should define behaviuor of shadow trees<br>
&lt;kbabbitt> ... just wanted to get some eyes on it, take a look at some different options<br>
&lt;kbabbitt> ... people working on appearance:base and form controls, would be useful to explicitly define how these work<br>
&lt;kbabbitt> astearns: one option is to just exhaustively define the shadow trees so that there isn't a difference in observable behavior<br>
&lt;kbabbitt> ... which sounds like a lot of work, may not be feasible<br>
&lt;keithamus> q+<br>
&lt;kbabbitt> astearns: second option I heard was we could change our inheritance behavior in some way<br>
&lt;lwarlow> q+<br>
&lt;kbabbitt> ... that sounded also like a nonstarter for backcompat reasons, right?<br>
&lt;kbabbitt> emilio: not necessarily, we can change it, especially if we define this for UA shadow roots at least<br>
&lt;astearns> ack fantasai<br>
&lt;kbabbitt> ... would be a nonstarter for changing all shadow DOM, but could say UAs are not allowed to expose shadow roots via inheritance<br>
&lt;kbabbitt> ... inherit keyword would need ot be friendly for shadow roots<br>
&lt;kbabbitt> ... for option 1, may not be as painful as it seems, only matters for elements that have children<br>
&lt;kbabbitt> ... video, object, selecty<br>
&lt;kbabbitt> ... children that would be slotted somewhere<br>
&lt;kbabbitt> s/selecty/select/<br>
&lt;kbabbitt> astearns: are there other options discussed in WHATWG issue?<br>
&lt;kbabbitt> emilio: main one was about chaning how inherit works<br>
&lt;kbabbitt> ... could also change explicit vs non-explicit inheritance but that might be weirder<br>
&lt;kbabbitt> ... affects regular shadow roots to some extent but I don't think that's changeable at this point<br>
&lt;astearns> ack keithamus<br>
&lt;kbabbitt> keithamus: don't think it's that big a lift to define these shadow roots, there aren;t hundreds of them<br>
&lt;kbabbitt> ... we don't have to do at once, mostlyu observable with children and there's maybe 3 of those<br>
&lt;kbabbitt> ... could have some definition of a well specified UA shadow root<br>
&lt;kbabbitt> ... that allows for precise inheritance rules that are well defined \<br>
&lt;kbabbitt> ... elss specified an dundefined ones<br>
&lt;astearns> ack lwarlow<br>
&lt;kbabbitt> lwarlow: I don't know that we've identified them in all cases<br>
&lt;kbabbitt> ... HTML very strongly makes these UA defined in all implementations<br>
&lt;kbabbitt> ... different browsers almost definitely have different shadow roots in ways that can';t be changed<br>
&lt;kbabbitt> s/identified/defined/<br>
&lt;keithamus> q+<br>
&lt;kbabbitt> ... maybe it's okay if we want to change them but<br>
&lt;emilio> q+<br>
&lt;kbabbitt> ... just ones which allow children but others such as input would just be observable if you did weird stuff with DOM APIs<br>
&lt;kbabbitt> ... we're going to define shadow trees for input for appearance:base but that doesn't help with appearance:auto<br>
&lt;kbabbitt> ... meter, progress can't have children currenlty<br>
&lt;kbabbitt> ... I imagine the way the web is, UAs could have shadow roots that aren't the same<br>
&lt;astearns> ack keithamus<br>
&lt;kbabbitt> keithamus: don't think that's substantially different<br>
&lt;kbabbitt> ... details is a slot with summary and a slot with content<br>
&lt;kbabbitt> .;.. we don't need to express everything about those<br>
&lt;kbabbitt> ... we don't have to specify exact HTML structure, just that it can be composed at these 3 elements<br>
&lt;kbabbitt> ... just enough detail to supply correct information for this issue around inheritance<br>
&lt;kbabbitt> ... doesn't necessitate enumerating entire HTML in every instance, just observable bits<br>
&lt;kbabbitt> ... style tag in closed UA shadow root, no need to specify whether that's allowed because not web observable<br>
&lt;kbabbitt> lwarlow: would something like, meter or color input in Firefox with one less level of nesting, might be observable<br>
&lt;astearns> ack emilio<br>
&lt;kbabbitt> emilio: for things that cannot have children, as long as you don't have a slot, this is not observable. observable that there's a shadow tree because element would start or stop being in flat tree<br>
&lt;kbabbitt> ... if you say this element has a shadow tree with no slots, then the specifics are not observable<br>
&lt;kbabbitt> ... element outside of flat tree shouldn't e3xpose its style<br>
&lt;kbabbitt> ... for this you don't need to define the complete shadow tree, just parts of shadow tree with ? slots<br>
&lt;kbabbitt> lwarlow: seems more palatable to me<br>
&lt;kbabbitt> ... still problems with stuff like video<br>
&lt;kbabbitt> emilio: for those you need to define that they have a slot<br>
&lt;kbabbitt> ... styles of slots<br>
&lt;kbabbitt> ... maybe say there's a slot with display:none for example and that would be enough<br>
&lt;kbabbitt> ... or define that there are no slots<br>
&lt;lwarlow> I think this could work then<br>
&lt;kbabbitt> astearns: is this something we should take up in form controls task force?<br>
&lt;kbabbitt> ... to get a few other WHATWG folks to be part of the discussion<br>
&lt;kbabbitt> lwarlow: or in WHATNOT itself<br>
&lt;kbabbitt> ... Apple's input on this would be useful, they generally have strong opinoins on shadow root stuff<br>
&lt;kbabbitt> ... if it's just defining a shadow root exists and a slot exists, that seems doable<br>
&lt;kbabbitt> ... we have task force tomorrow, can bring it up there<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3248#issuecomment-4345665182 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 29 April 2026 16:38:23 UTC