Skip to content

Conversation

@frivoal
Copy link
Collaborator

@frivoal frivoal commented Dec 16, 2019

Exploratory Pull Request drafting what I suspect would be a good solution to #4588 (and to #4602 as well).

@frivoal frivoal requested review from fantasai and sanketj December 16, 2019 09:36
@frivoal frivoal changed the title [css-highlight-api][css-pseudo] add style attribute to pseudo-elements and Use it in css-highlight-api as a replacement for the style attribute on HighlightRangeGroup [css-highlight-api][css-pseudo] add style attribute to pseudo-elements and use it in css-highlight-api as a replacement for the style attribute on HighlightRangeGroup Dec 17, 2019
through a {{CSSStyleDeclaration}} <code>style</code> attribute.
The current functionality is limited
to that which is needed to support [[web-animations-1]].
to other pseudo-element types.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSSPseudoElement interface currently only supports ::before, ::after and ::marker (lines 876-879). These are all tree-abiding pseudo elements, meaning that they have a well-defined tree relationship with their owning element, and as a result, we can craft a sensible event flow when one of these receive an event.

CSSPseudoElement does not support (at least yet!) any pseudo elements that inherit styles from other pseudo elements, like ::selection or ::highlight, and not even pseudos that apply styles to multiple elements, like ::first-line. These seem harder to support because it's not clear what the event flow should be and how we would implement it (related issue: #4398 ). If we keep the same event path as we do currently, we probably won't deliver events to non-owning DOM elements that are covered by the pseudo. We would need to define a new event path and make sure it also works for other types of events (like pointer events - these are important for highlight events).

I'm happy to brainstorm about this further (assuming people want to expand CSSPseudoElement to non-tree abiding elements). If either you and @fantasai have any ideas or know of any discussions that have taken place about this before, I would love to hear them. I'll also ponder on this and try to bring something to discuss during our next highlight API discussion call.

@frivoal frivoal force-pushed the highlight-style-attr branch from 474641a to 461e829 Compare December 20, 2019 04:18
@frivoal frivoal changed the title [css-highlight-api][css-pseudo] add style attribute to pseudo-elements and use it in css-highlight-api as a replacement for the style attribute on HighlightRangeGroup [css-highlight-api][css-pseudo] add style attribute to pseudo-elements and use it in css-highlight-api as a replacement for the style attribute on Highlight Dec 20, 2019
Use it in css-highlight-api as a replacement for the style attribute on
Highlight.

Closes w3c#4588
Closes w3c#4602
@frivoal frivoal force-pushed the highlight-style-attr branch from 461e829 to a40b2bd Compare December 20, 2019 04:27
@frivoal
Copy link
Collaborator Author

frivoal commented Dec 27, 2019

Closed #4588 and #4602 differently. See 78f022f

@frivoal frivoal closed this Dec 27, 2019
@frivoal frivoal deleted the highlight-style-attr branch December 27, 2019 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants