Open nigelmegitt opened 6 years ago
What is the motivation for this feature, i.e. what problem is it trying to solve?
Thanks for the prompt @palemieux - I did describe this at TPAC but didn't write it down, so I will do so here:
The motivation is that we have a use case where we want to present on-video captions on video in an HTML5 context using advanced styling features not currently available in TTML2, but available in CSS. This is for "narrative text" captions branded to look similar to our video graphics captions, rather than being our traditional subtitle style.
There is a specific list of CSS properties that we would use now or soon if they were available, but attacking the problem one property at a time is brittle, and takes too long if we have to go round a non-guaranteed standardisation loop each time, which could easily take a year. There could be a branding change at any time that can be achieved in CSS but needing a few more properties. Hence the need to open up the ability to access generic CSS properties where processors can use them, and to put the processor requirement to support that behind a feature designator.
Essentially this is for presentation of timed text using styles that go beyond what is needed for translation or hard of hearing subtitle and caption presentation.
I'm not so much concerned with syntax here, but with semantics. It may not be so simple to map the semantics of CSS style properties into TTML presentation semantics. In particular, it could potentially require writing specific semantic mapping rules for each CSS property that is used in this fashion.
As for syntax, I would suggest tts:cssStyle
and tts:cssClass
or perhaps ttsx:
insteady of tts:
.
@nigelmegitt CSS styling features that are useful for timed text should simply be added to TTML as native styling properties, where they can be made to work with existing styling properties without ambiguities and inconsistencies. This process can start today if it is true that there is a specific list of CSS properties that we would use now or soon if they were available.
Completing as per the issue template:
Is your feature request related to a problem? Please describe.
As a broadcaster we want to present captions over video in an HTML5 context using advanced styling features not currently available in TTML2, but available in CSS. This is for "narrative text" captions branded to look similar to our video graphics captions, rather than being our traditional subtitle style.
In some cases the CSS properties needed would be the same as existing TTML style attributes but allowing an additional level of detail; for example tts:border
does not allow each edge to be specified differently whereas this is possible in CSS. Another potential conflict is with animations, where CSS animations may be preferred authorially to use of the animate
element in TTML, or both may be used, in which case the semantic needs to be defined.
We want to be able to change the look and feel to meet editorial change timetables and want to be able to access CSS properties not currently available in TTML without waiting for those properties to be added to the TTML specification, because that takes too long.
Describe the solution you'd like We don't have a solid view of exactly how this should work. However it works, it should be behind a profile feature designator, with a fallback behaviour to "normal TTML" (whatever that means) if not supported and the profile states that support for the feature is optional.
Some ideas include:
class
attribute and embedded or linked stylesheets to allow generic CSS styling. We would need a semantic for resolving clashes with existing TTML style attributes that map to the same CSS properties.Describe alternatives you've considered
We considered:
State if you intend for this requirement to be met by a particular specification This would need to be in TTML and also in IMSC.
Does this requirement represent a change in scope No change in scope.
Additional context None.
You should note SVG's support for CSS stylesheets alongside SVG presentation attributes ("SVG styles"), a situation that effectively mirrors this proposal. Regarding semantics for combining the two systems, see SVG 1.1 §6.4.
Thanks for that @skynavga - we should certainly look at SVG for inspiration at least.
Thanks @nigelmegitt! I think this is an important issue. It is relevant for the general strategy in enhancing TTML. There are different options and in the longrun I would not rule out this idea from @nigelmegitt:
(probably unworkable, here for completeness:) Providing a way to deprecate all or almost all TTML styles and use a CSS approach in place of TTML styling.
TTML has diverged from the HTML5 ecosystem in the past. From the styling perspective it is in a kind of parallel galaxy. Very close and easy to travel to and from HTML+CSS, but still in a different space.
From the discussions in the past it became obvious that some stakeholders would welcome a close relationship between TTML and CSS.
The approach you suggest looks tempting at first sight, but as mentioned by others: concepts in XSL-FO/TTML are very close to TTML, but not the same. So for mapping you may need to check every single CSS property.
Therefore it could indeed be one alternative to completely re-write TTML and to use directly CSS for styling timed text.
In the meantime the approach by @nigelmegitt could be used by a profile, that may not be specified by TTWG but for example an organisation as the BBC. It could be a profile that applies as a postprocessing step to TTML after it was rendered to HTML. The CSS syntax could be encapsulated by an attribute in a non-TTML namespace.
Re: https://github.com/w3c/tt-reqs/issues/2#issuecomment-457615638
TTML has diverged from the HTML5 ecosystem in the past.
This statement is inaccurate and misleading. TTML was explicitly NOT designed to be part of the HTML ecosystem in the sense that it should be an integrable language (i.e., integrate with HTML/CSS language constructs).
It was designed to be an XML language independent of a web browser context where HTML is dominant. What you are proposing is essentially to create another, non TTML language, let us call it HTTML, a language which (by your stated intent) will be closely bound to HTML5/CSS, as opposed to XML and an independent style system. While I don't have anything in principle against doing this, it should be made clear that this would not be a profile of TTML nor would it be compatible with it, and, therefore, it would provide a diverging path away from a practice that now has a nearly 20 year legacy.
Something else to consider here is that TTML has always been to some extent loose about the specifications of style attributes - although we assert that the basis is XSL-FO, this semantic basis has so far always been informative only. In TTML2 we also introduced an informative basis on CSS, observing that on all the style attributes where we did this, which also existed in TTML1, the XSL-FO definition defers to CSS.
The point I am seeking to make here is that any implementation that does something sensible has been considered valid up to now, and "something sensible" can be based on XSL-FO, CSS or something completely different. In my view this gives us some freedom which we can take advantage of.
I agree in general, with the exception that (1) in some cases XSL-FO added/clarified semantics to what it brought in from CSS, and (2) TTML has done the same with respect to properties it derived from both XSL-FO and CSS.
The Timed Text Working Group just discussed Add generic CSS property functionality tt-reqs#2
, and agreed to the following:
SUMMARY: Group agrees to look for ways to add new style properties with minimal overhead and to try to solve this in 2019.
The Timed Text Working Group just discussed Add generic CSS property functionality tt-reqs#2
.
The Timed Text Working Group just discussed Add generic CSS property functionality tt-reqs#2 (continued)
.
First take at this:
class
attribute to support CSS selectors;<span tts:color="white" css="color: red;">text</span>
be in - white or red?