Closed palemieux closed 2 years ago
I'm not sure how useful this is, given that it adds complexity, and the HRM is primarily a high-water-mark guide? My concerns are that not all implementations will optimise the drawing in ways that we can see could be possible, but the document contents should be processable even by such non-optimised implementations.
The background being transparent is not the only optimisation we might guess that implementations would make. Another is the case that a background color is specified on an element but does not need to be drawn, because it would never be visible, because there's another element on which a different background color is specified, that occupies an entirely overlapping portion of the rendering area.
For example if a region
sets tts:backgroundColor
and body
also sets tts:backgroundColor
(see also w3c/imsc-hrm#2 ), then the region
's background will never be seen - I haven't checked but there might need to be additional checks here for padding on the region, in case there are "edge cases" where edges are visible.
I suggest making no change here.
In what circumstances would a background ever be drawn if the alpha channel is 0 or the color is transparent?
In what circumstances would a background ever be drawn if the alpha channel is 0 or the color is transparent?
If the implementer hadn't tested for that and optimised it out, but simply saw "there's a background, better go draw it".
If the implementer hadn't tested for that and optimised it out, but simply saw "there's a background, better go draw it".
They should optimize it... just like the model assumes that identical glyphs are copied rather than rendered twice.
They should optimize it
That's extra work, when the content author should omit the tts:backgroundColor
style, if it has no opacity.
Working out which optimisations to factor into the HRM and which to leave out is a line-drawing exercise. It doesn't much matter as long as everyone gets the same answer. Computing the HRM values is hard enough work already without having to factor this kind of thing in, and my guess is that it's a tiny edge case in terms of the amount of content that would trigger the optimisation. My feeling here is that it is not a particularly important change to make.
nd my guess is that it's a tiny edge case in terms of the amount of content that would trigger the optimisation. My feeling here is that it is not a particularly important change to make.
I agree. Which is why I think the change is easy to make :)
I agree. Which is why I think the change is easy to make :)
But also the change has little benefit, right?
But also the change has little benefit, right?
I am concerned with needlessly penalizing tools that write tts:backgroundColor="transparent"
(which is the initial value) expecting nothing to happen. I have seen these examples in the wild.
A related questions is: does specifying a background color with transparent alpha the same as specifying tts:backgroundColor="transparent"
?
See https://github.com/w3c/csswg-drafts/issues/2722 for additional entertainment regarding "transparent" - we possibly do need to take into account blending across animations of colour values towards transparency.
The Timed Text Working Group just discussed NBG(R_i) counts transparent backgrounds w3c/imsc#570
, and agreed to the following:
SUMMARY: Pierre @palemieux to open a pull request as per the above discussion.
@nigelmegitt I have create w3c/imsc#572.
The quantity NBG(Ri) counts
tts:backgroundColor
attributes even when the color is transparent, which should result in no drawing.tts:backgroundColor
with transparent colors should be ignored.