Re: [csswg-drafts] [css-properties-values-api] "Property registration cannot be scoped" differs from all implementations in a consistent way (#10541)

The CSS Working Group just discussed `[css-properties-values-api] "Property registration cannot be scoped" differs from all implementations in a consistent way`.

<details><summary>The full IRC log of that discussion</summary>
&lt;bkardell_> just will note for the record that I'm not sure people really like parts<br>
&lt;khush> astearns nobody matches the spec issue. yay<br>
&lt;khush> noamr repeat of the prev one with @property<br>
&lt;khush> i opened bugs on all browsers. browsers match but don't match the spec<br>
&lt;khush> prop descriptor has spec text that says you can define it in any scope and they are global<br>
&lt;khush> but they actually work in the global document only. prop descriptors from shadow dom are ignored<br>
&lt;khush> they are diff from everything else, global and inherited by the shadow tree<br>
&lt;khush> current way is not bad, it's actually like an api contract<br>
&lt;khush> if you have a custom element which uses custom props, you have to import the CSS which will have prop declarations. rather than relying on shadow root to declare those props. it's like a header file<br>
&lt;flackr> q+<br>
&lt;khush> ideal resolution would be prop descriptor have to be in the Document<br>
&lt;astearns> ack flackr<br>
&lt;khush> flackr i agree that it's a better model for props which are meant to be used outside. but for the ones meant to be encapsulated, would be nice if they were defined internally only<br>
&lt;astearns> +1 to flackr<br>
&lt;noamr> q+<br>
&lt;astearns> ack TabAtkins<br>
&lt;khush> TabAtkins: any shadow internal custom props being in capable of being defined, unless you also include a script or stylesheet globally is bad<br>
&lt;emilio> q+<br>
&lt;khush> the fact that they can't be scoped at all is a consequence of inheritance. being able to define them internally with a well named internal semantic is worth it<br>
&lt;khush> i can accept it being global only.<br>
&lt;astearns> ack noamr<br>
&lt;khush> noamr one way to resolve this. problem with internal props is that it could be a mismatch. so if it's defined internally, let's make it not inherited<br>
&lt;khush> then this is your own property, deal with it<br>
&lt;khush> your prop would fallback to what you defined in the descriptor as initial value and not inherit from global scope<br>
&lt;khush> TabAtkins what happens on the host element itself. can define something. otherwise the idea sounds reasonable<br>
&lt;astearns> ack emilio<br>
&lt;khush> emilio was gonna argue for currently implemented behaviour<br>
&lt;kizu> q+<br>
&lt;khush> as soon as there are name conflicts. you need to remove all the niceties of the shadow dom data encapsulated. have preference for the current behaviour. i need to think through, you have properties with same name. one is defined outside via part one is inside via regular stylesheet. that also seems fairly annoying. preference to just spec what is<br>
&lt;khush> currently there<br>
&lt;khush> TabAtkins i want to explore the behaviour noam was talking about. if we can find a less annoying version. but ok with specing current behaviour<br>
&lt;astearns> ack kizu<br>
&lt;khush> kizu: this is something i encounter without shadow dom. multiple sources define the same prop name with different values. if some element registers it with a different value, custom element on the host or regular element on itself. as soon as it reaches this by inheritance it will use initial value if there is a type mismatch<br>
&lt;khush> you define for your scope. if an internal one defines the same type then inheritance works otherwise it's overridden<br>
&lt;astearns> q+<br>
&lt;khush> TabAtkins if noam's idea is limited to defining on tree roots it matches your idea<br>
&lt;khush> and sounds reasonable behaviour to me<br>
&lt;westbrook> q+<br>
&lt;astearns> ack westbrook<br>
&lt;khush> astearns my chair hat off, i would accept what noam is proposing. prop def scoped to the shadow root. accept what's currently there, everything is global. don't accept what is currently implemented that shadow dom can't define props.<br>
&lt;iank_> q?<br>
&lt;khush> westbrook cross shadow boundary and change if there is something defined inside the shadow dom.<br>
&lt;emilio> q+<br>
&lt;khush> TabAtkins if inheritance carries a font face to the shadow, the font face being defined won't changge<br>
&lt;khush> if the outer face defines font face foo, and shadow defines the same. outer sets font-family: foo, it is referring to the outer one. when inherited it refers to the outer one<br>
&lt;khush> it won't use the internal one, name collsiion was accident<br>
&lt;khush> if the shadow says font-family foo, now it's the internal one<br>
&lt;astearns> ack emilio<br>
&lt;khush> emilio what is the implemention for font-face. gecko ignores them<br>
&lt;fantasai> strong +1 to Tab's point about binding font-family to @font-face before inheritance<br>
&lt;khush> TabAtkins it's consisntent. some ignore them internally, some make it global<br>
&lt;TabAtkins> s/consisntent/inconsistent/<br>
&lt;khush> emilio wouldn't want to expose font faces to document.fonts. haven't discussed this<br>
&lt;khush> TabAtkins that is undefined. happy to do reasonable stuff there<br>
&lt;khush> TabAtkins we don't have a version of .fonts for shadow trees<br>
&lt;noamr> q+<br>
&lt;khush> emilio all shadow roots have their fonts in document.fonts is not good behaviour<br>
&lt;astearns> ack noamr<br>
&lt;khush> TabAtkins figuring out reasonable behaviour there is more complicated<br>
&lt;chrishtr> q+<br>
&lt;khush> noamr prop is an API surface between shadow roots by definition. and the desc defines an interface point, fonts don't have any of this. they define something else. so the parallel is not right<br>
&lt;astearns> ack chrishtr<br>
&lt;khush> there's reason default scopung is not for prop<br>
&lt;khush> chrishtr let's take it back to the issue<br>
&lt;khush> astearns take it back to the issue. see if we can scope the prop definition.<br>
</details>


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


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

Received on Friday, 27 September 2024 00:13:22 UTC