Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to use pseudoclasses for synchronized highlight ? #8

Closed
marisademeglio opened this issue Jun 9, 2019 · 7 comments
Closed

Comments

@marisademeglio
Copy link
Collaborator

Need to evaluate the applicability of the :current CSS pseudo class from CSS Selectors 4 (see https://www.w3.org/TR/selectors-4/#the-current-pseudo ). The :past and :future counterparts would provide additional semantics.

@marisademeglio
Copy link
Collaborator Author

@danielweck I liked this idea of yours, any idea how feasible it would be to implement? I'm not so familiar with how to programmatically control pseudoclasses (you know, until the browser vendors want to natively implement this ;)

@danielweck
Copy link
Member

CSS Selectors Level 4:

https://www.w3.org/TR/selectors-4/#time-pseudos

W3C Working Draft, 21 November 2018

https://drafts.csswg.org/selectors-4/#time-pseudos

Editor’s Draft, 17 August 2019

https://css4-selectors.com/selector/css4/time-dimensional-pseudo-class/

Key statement from the draft specification:

These pseudo-classes classify elements with respect to the currently-displayed or active position in some timeline, such as during speech rendering of a document, or during the display of a video using WebVTT to render subtitles. CSS does not define this timeline; the host language must do so. If there is no timeline defined for an element, these pseudo-classes must not match the element.

I will venture a guess and say that the chances of seeing consistent implementations of this proposed CSS feature in multiple web browsers within a reasonable timeframe ... are slim. To be precise, I am concerned that the host context of such CSS feature (e.g. HTML, or other technologies that embed / make use of CSS) would need to consistently implement time-domain semantics, whilst at the same time somehow exposing a mechanism for "sync media" to plug into in order to render its own synchronized highlights.

@danielweck
Copy link
Member

danielweck commented Sep 11, 2019

So in response to:

Need to evaluate the applicability ...

...I would say: let's skip this for now, the specification is far from mature, let alone usable implementations.

@marisademeglio
Copy link
Collaborator Author

Ok, sounds good to me. We can start a document for future improvements and things to watch.

@danielweck
Copy link
Member

PS: possible alternative to "time dimensional" => "highlight" pseudo-classes:

https://drafts.csswg.org/css-pseudo-4/#highlight-pseudos
https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/highlight/explainer.md

Just like "time dimensional", this is probably a long shot until implementations, but I suspect consistent web browser support will be delivered sooner, because:

  1. the need for "highlighting" techniques (decorations) that do not alter the DOM is very high (e.g. Range-based content annotations),
  2. because there are no time-domain intricacies to deal with. As the "time dimensional" draft spec. says: CSS does not define this timeline; the host language must do so ... which is quite an open-ended proposition. In the sync-media case, if the "host language" is HTML, I'm not sure how the sync-media processor would hook into the web browser architecture to implement its timeline engine / to define current and previous-next playback state (e.g. installed browser plugin, Javascript authored and embedded into "web publications"?)
@danielweck
Copy link
Member

Related issues:
#21
#23

@marisademeglio
Copy link
Collaborator Author

marisademeglio commented Sep 17, 2019

We're in communication - we may be a good use case for the highlight api: w3c/csswg-drafts#4307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants