Re: [csswg-drafts] [css-highlight-api-4] Inline styles for HighlightRangeGroups should apply on top of styles provided by ::highlight (#4588)

This difference was deliberate when I drafted the document, but it's not something I'm completely sure about either, and did want to discuss. Here's the logic I had when I wrote this:

1) There was already a "default styling" behavior for the built-in pseudos, used for ::selection and ::active selection, defining how styles using the pseudo-element and styles coming from elsewhere would interact, so I thought that it made sense to try and use the same mechanics there rather than define something similar but different.

2) If it overrides the styles coming from the stylesheet, then it feels a lot like the style attribute on DOM elements. But in that case, this feels like something that we should extend to all pseudo elements, no just the ::highlight() ones, in part because that would be generally useful, and in part because otherwise, how exactly does it work? does it override all uses of ::highlight(), or only :root:highlight() or…? What about !important? Does it replace the ::highlight() value at specified, or computed, or used value time? How does it interact with animations? How do the APIs to inspect the CSSOM account for it? How does it interact with [`var()`](https://drafts.csswg.org/css-variables-1/) or [`attr()`](https://drafts.csswg.org/css-values/#attr-notation)? Etc...These questions are easily answered if it's a generic style attribute for pseudo-elements that fit the normal cascading model the same way the style attribute for DOM elements does, but they're all open questions if we come up with something new.

So my general idea was that if it is specific to overlays, it probably should work like the default for ::selection (and we still need to answer some of these open questions), but probably it should be replaced by something that works on all pseudo-elements, including, but not limited to ::highlight().

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4588#issuecomment-565314273 using your GitHub account

Received on Friday, 13 December 2019 06:10:06 UTC