I have a better idea:
We'll soon have new technology: The `revert-rule` keyword, https://github.com/w3c/csswg-drafts/blob/main/css-cascade-5/revert-rule-explainer.md
I think that will allow you do change e.g.:
```
/* TODO(crbug.com/357649033): This line-height rule can't be undone for
* customizable select multiple because we can't put !important inside
* -internal-auto-base(). */
select:-internal-list-box option,
select:-internal-list-box optgroup {
line-height: initial !important;
}
```
into:
```
/* This line-height rule CAN be undone for
* customizable select. */
select:-internal-list-box option,
select:-internal-list-box optgroup {
line-height: -internal-auto-base(initial, revert-rule) !important;
}
```
While this `line-height` declaration will always win the cascade (the whole thing is `!important`), we'll roll back to the previous winning declaration if the `revert-rule` branch is chosen.
I think this gives the behavior you want?
It requires making `revert-rule` valid in UA mode; it's behind a flag right now. (Expected shipment is Q1.)
// This manually implements !important inside -internal-auto-base() because
// -internal-auto-base() doesn't support !important.I'm not sure that's a valid description of what's going on here.
(It's hard to tell what's going on here, but it's not implementing !important.)
builder.SetLineHeight(It's too late to set line-height during style adjustment. It needs to apply very early in the process due to `lh` units.
line-height: -internal-auto-base(initial !important, unset);Isn't this just invalid here? (Specifically, `!`-tokens.)
In any case, you don't want to add `!important` here in _addition_ to style adjustment?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I have a better idea:
We'll soon have new technology: The `revert-rule` keyword, https://github.com/w3c/csswg-drafts/blob/main/css-cascade-5/revert-rule-explainer.md
I think that will allow you do change e.g.:
```
/* TODO(crbug.com/357649033): This line-height rule can't be undone for
* customizable select multiple because we can't put !important inside
* -internal-auto-base(). */
select:-internal-list-box option,
select:-internal-list-box optgroup {
line-height: initial !important;
}
```into:
```
/* This line-height rule CAN be undone for
* customizable select. */
select:-internal-list-box option,
select:-internal-list-box optgroup {
line-height: -internal-auto-base(initial, revert-rule) !important;
}
```While this `line-height` declaration will always win the cascade (the whole thing is `!important`), we'll roll back to the previous winning declaration if the `revert-rule` branch is chosen.
I think this gives the behavior you want?
It requires making `revert-rule` valid in UA mode; it's behind a flag right now. (Expected shipment is Q1.)
If it means that authors can't override the value in auto appearance but can override in base appearance, then yes that will probably do it!
I'm happy to wait, this patch is much uglier
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Joey ArharI have a better idea:
We'll soon have new technology: The `revert-rule` keyword, https://github.com/w3c/csswg-drafts/blob/main/css-cascade-5/revert-rule-explainer.md
I think that will allow you do change e.g.:
```
/* TODO(crbug.com/357649033): This line-height rule can't be undone for
* customizable select multiple because we can't put !important inside
* -internal-auto-base(). */
select:-internal-list-box option,
select:-internal-list-box optgroup {
line-height: initial !important;
}
```into:
```
/* This line-height rule CAN be undone for
* customizable select. */
select:-internal-list-box option,
select:-internal-list-box optgroup {
line-height: -internal-auto-base(initial, revert-rule) !important;
}
```While this `line-height` declaration will always win the cascade (the whole thing is `!important`), we'll roll back to the previous winning declaration if the `revert-rule` branch is chosen.
I think this gives the behavior you want?
It requires making `revert-rule` valid in UA mode; it's behind a flag right now. (Expected shipment is Q1.)
If it means that authors can't override the value in auto appearance but can override in base appearance, then yes that will probably do it!
I'm happy to wait, this patch is much uglier
Hmm, looks this won't actually work. Let me think about it some more ...
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
OK, it *should* work, I just found a bug in `revert-rule`. https://issues.chromium.org/issues/478178033
Thanks so much, that did the trick!
// This manually implements !important inside -internal-auto-base() because
// -internal-auto-base() doesn't support !important.I'm not sure that's a valid description of what's going on here.
(It's hard to tell what's going on here, but it's not implementing !important.)
Done
It's too late to set line-height during style adjustment. It needs to apply very early in the process due to `lh` units.
Done
line-height: -internal-auto-base(initial !important, unset);Isn't this just invalid here? (Specifically, `!`-tokens.)
In any case, you don't want to add `!important` here in _addition_ to style adjustment?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Manually implement !important inside -internal-auto-base()| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Manually implement !important inside -internal-auto-base()Make update the description.
I meant: _Maybe_ update the description.
( XD )