W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2019

Re: [csswg-drafts] [css-inherit] New rule to make non-inherited properties inheritable (#4395)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 08 Oct 2019 14:55:14 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-539552804-1570546513-sysbot+gh@w3.org>
This seems problematic to me. For example, the construction of the box tree creates various anonymous boxes. Currently it's not observable whether implementation really create such boxes or use alternative approaches, because selectors can't target anonymous boxes and inherited properties are safe enough. But if for example you make border inheritable, then you can see how many boxes are there.

Also, non-inherited properties are non-inherited because in most cases you don't want them to inherit. The nice thing of the `inherit` keyword is that the effect is restricted to the element in which you use it, it won't affect other elements unintentionally. But with your proposal, `.child` would inherit `50% !inherit`, so the effect would continue propagating to `.grandchild`, `.great-grandchild`, etc. This seems undesirable in most cases.

BTW, how would this fit in the cascade? E.g. which one wins here:
```css
.parent { border-radius: 50% !inherit; }
.child { border-radius: 10%; }
```
I guess it would be in https://drafts.csswg.org/css-cascade-4/#defaulting, right?

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4395#issuecomment-539552804 using your GitHub account
Received on Tuesday, 8 October 2019 14:55:15 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:54 UTC