You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-ruby][css-text-decor-4] Add over-most-under-last value to ruby-position & text-emphasis-position for captioning #2998
TTML has requested a value to ruby-position (and text-emphasis-position) that would place the annotation above on all lines except the last one in the block. Names proposed include outside and auto.
@upsuper Seems like overkill. Not really something that needs to cascade independently afaik, doesn't have complex interactions with anything... Adding a value makes much more sense than adding a property.
I think outside or outer is sufficiently clear, personally. The main concern I have is “What is the last line?”.
For justification we use the last line before any forced break. For text-indent we use the first line of a non-anonymous block. I have no idea what TTML’s markup model would require here...
I don't think they are clear, tbh. over and under are relative to the base text, but outer or outside in this context is relative to the whole paragraph. It would be great if there is some specific name for this behavior...
I also thought about the last line, and that feels non-trivial to implement and may add some complexity, because ruby-position is a inline-level property, and is handled in the progress of laying out a line. You cannot know whether a line is the last line until it is fully laid out, which means we may need to reprocess the line if we have such ruby position. This may not be that hard but does seem to be more complicated than its usefulness...
If we change it to only do different thing on first line, that would probably make it easier to implement.
Equivalent to before for (1) the only line area of or (2) the first line area of the last block area generated by a p element which contains annotated text; otherwise, equivalent to after.
So I think the answer is it is based on the line areas generated by layout of the base text, with ruby and text emphasis then inserted in the appropriate position as a later step.
The Working Group just discussed Add over-most-under-last value to ruby-position & text-emphasis-position for captioning.
The full IRC log of that discussion
<dael> Topic: Add over-most-under-last value to ruby-position & text-emphasis-position for captioning
<dael> github: https://github.com//issues/2998
<dael> astearns: fantasai added to agenda, updates by Nigel
<dael> fantasai: The overall question was to add new value to ruby position prop to handle ttml behavior. First line has ruby on top, second on bottom. 3+ lines they're all on bottom. Question from WG is do we add it. There's details on how to segment text, block, linebreaks, etc?
<dael> astearns: Is there a use case for changing behavior based on forced line break?
<dael> fantasai: Use case is for captions, don't know what markup looks like. Guessing not on forced line breaks.
<dael> dbaron: I can see why it's useful f or captions, but feels hard to impl for general case. What's previously local now needs bigger area
<dael> florian: Solve by special case first line and having first line be over and rest under?
<dael> florian: Since use case if for 2 line what we do for not 2 lines is error driven by use case so might as well do simple thing
<dael> s/use case if/use case is
<dael> florian: Then again why can't use first-line pseudo
<dael> astearns: First-line psuedo is interesting idea. Gets functionality for block. Do first-line deal with blocks?
<dael> fantasai: Only with firstline of not anon block
<dael> astearns: Then first-line gives us what ttml looking for
<dael> fantasai: I think so. Don't know nuances of what they're looking for
<dael> astearns: Leave it as a question in the issue? Ask if we can let them do this using first-line
<dael> fantasai: Alright
<dael> florian: Need to make it explicit that this applies in first-line pseudo.
<dael> fantasai: Have to check pseudo spec. And we can add example in ruby module to show this behavior
<dael> fantasai: I think we need to call it out, not really clear. Have to add it explicitly
<dael> astearns: Poss ttml people considered this and rejected so good to get their feedback on idea
<dael> fantasai: prop: add ruby position to properties applying to first-line, respond to ttml suggesting we use first-lien for this behavior and check if it's a problem
<dael> astearns: It jsut came up, could get shot down as soon as it's o n issue. not looking for resolution at this point.
<dael> fantasai: We have a proposed resolution and asking for feedback
<dael> astearns: We can come back next week.
Equivalent to before for (1) the only line area of or (2) the first line area of the last block area generated by a p element which contains annotated text; otherwise, equivalent to after.
The case for a single line is fine. The case for two lines (the most likely scenario) is fine too. I was under the (quite possibly mistaken) impression that in the case of 3+ horizontal lines, ruby would appear above the text except for the last line only, where the ruby would be shown below.
@r12a for the 3+ case, we changed the spec to use after (below) for non-first lines; this was done to ensure we could map this to CSS using ::first-line;
also, regarding the NFLX requirements regarding no more than two lines, that is the NFLX style convention, but does not necessarily apply outside NFLX; one should read that document as one input providing guidance rather than universal requirements; in any case, we need the spec to handle the case where more than two lines are created during layout, which is something the author cannot predict due to variations in actual fonts on the client;
As @skynavga pointed out, the TTML2 spec was changed after this issue was raised in a way that enabled exactly this hypothetical solution. I've confirmed this offline with @palemieux.
The change needed is to allow ruby-position to apply to ::first-line.
By the way, this is analogous to text-emphasis-position which does apply to ::first-line. It seems obvious to me that the same mechanism should be used for positioning ruby as for positioning text emphasis.
Activity
upsuper commentedon Aug 8, 2018
Neither
outsidenorautofeels like a good name for this in general... Maybe we can add aruby-position-lastfor this usage just liketext-align-last?fantasai commentedon Aug 8, 2018
@upsuper Seems like overkill. Not really something that needs to cascade independently afaik, doesn't have complex interactions with anything... Adding a value makes much more sense than adding a property.
fantasai commentedon Aug 8, 2018
I think
outsideorouteris sufficiently clear, personally. The main concern I have is “What is the last line?”.For justification we use the last line before any forced break. For text-indent we use the first line of a non-anonymous block. I have no idea what TTML’s markup model would require here...
upsuper commentedon Aug 8, 2018
I don't think they are clear, tbh.
overandunderare relative to the base text, butouteroroutsidein this context is relative to the whole paragraph. It would be great if there is some specific name for this behavior...I also thought about the last line, and that feels non-trivial to implement and may add some complexity, because
ruby-positionis a inline-level property, and is handled in the progress of laying out a line. You cannot know whether a line is the last line until it is fully laid out, which means we may need to reprocess the line if we have such ruby position. This may not be that hard but does seem to be more complicated than its usefulness...If we change it to only do different thing on first line, that would probably make it easier to implement.
nigelmegitt commentedon Aug 8, 2018
@skynavga @cconcolato @palemieux ping!
The TTML2 spec does answer the question:
<annotation-position>says:So I think the answer is it is based on the line areas generated by layout of the base text, with ruby and text emphasis then inserted in the appropriate position as a later step.
css-meeting-bot commentedon Aug 15, 2018
The Working Group just discussed
Add over-most-under-last value to ruby-position & text-emphasis-position for captioning.The full IRC log of that discussion
<dael> Topic: Add over-most-under-last value to ruby-position & text-emphasis-position for captioning<dael> github: https://github.com//issues/2998
<dael> astearns: fantasai added to agenda, updates by Nigel
<dael> fantasai: The overall question was to add new value to ruby position prop to handle ttml behavior. First line has ruby on top, second on bottom. 3+ lines they're all on bottom. Question from WG is do we add it. There's details on how to segment text, block, linebreaks, etc?
<dael> astearns: Is there a use case for changing behavior based on forced line break?
<dael> fantasai: Use case is for captions, don't know what markup looks like. Guessing not on forced line breaks.
<dael> dbaron: I can see why it's useful f or captions, but feels hard to impl for general case. What's previously local now needs bigger area
<dael> florian: Solve by special case first line and having first line be over and rest under?
<dael> florian: Since use case if for 2 line what we do for not 2 lines is error driven by use case so might as well do simple thing
<dael> s/use case if/use case is
<dael> florian: Then again why can't use first-line pseudo
<dael> astearns: First-line psuedo is interesting idea. Gets functionality for block. Do first-line deal with blocks?
<dael> fantasai: Only with firstline of not anon block
<dael> astearns: Then first-line gives us what ttml looking for
<dael> fantasai: I think so. Don't know nuances of what they're looking for
<dael> astearns: Leave it as a question in the issue? Ask if we can let them do this using first-line
<dael> fantasai: Alright
<dael> florian: Need to make it explicit that this applies in first-line pseudo.
<dael> fantasai: Have to check pseudo spec. And we can add example in ruby module to show this behavior
<dael> fantasai: I think we need to call it out, not really clear. Have to add it explicitly
<dael> astearns: Poss ttml people considered this and rejected so good to get their feedback on idea
<dael> fantasai: prop: add ruby position to properties applying to first-line, respond to ttml suggesting we use first-lien for this behavior and check if it's a problem
<dael> astearns: It jsut came up, could get shot down as soon as it's o n issue. not looking for resolution at this point.
<dael> fantasai: We have a proposed resolution and asking for feedback
<dael> astearns: We can come back next week.
astearns commentedon Aug 15, 2018
@nigelmegitt @palemieux would using ::first-line to set
beforework for this case?fantasai commentedon Aug 15, 2018
Hi @nigelmegitt and @palemieux, CSSWG wanted to know if it would be acceptable to just use
and if not, why not. :)
r12a commentedon Aug 16, 2018
@nigelmegitt @palemieux @skynavga @cconcolato Can i just check that the wording in the TTML spec is correctly?
The case for a single line is fine. The case for two lines (the most likely scenario) is fine too. I was under the (quite possibly mistaken) impression that in the case of 3+ horizontal lines, ruby would appear above the text except for the last line only, where the ruby would be shown below.
Btw, the Netflix requirements at https://medium.com/netflix-techblog/implementing-japanese-subtitles-on-netflix-c165fbe61989 say that there should never be more than two lines (because ruby should never appear between lines). So it doesn't help clarify.
skynavga commentedon Aug 16, 2018
@r12a for the 3+ case, we changed the spec to use after (below) for non-first lines; this was done to ensure we could map this to CSS using ::first-line;
also, regarding the NFLX requirements regarding no more than two lines, that is the NFLX style convention, but does not necessarily apply outside NFLX; one should read that document as one input providing guidance rather than universal requirements; in any case, we need the spec to handle the case where more than two lines are created during layout, which is something the author cannot predict due to variations in actual fonts on the client;
nigelmegitt commentedon Sep 7, 2018
@fantasai @astearns yes, it looks like using
::first-linein the way suggested at #2998 (comment) and #2998 (comment) would work.As @skynavga pointed out, the TTML2 spec was changed after this issue was raised in a way that enabled exactly this hypothetical solution. I've confirmed this offline with @palemieux.
The change needed is to allow
ruby-positionto apply to::first-line.Ruby Layout Module Level 1 explicitly excludes this currently, and the Pseudo-Elements Module Level 4
::first-linespecification is consistent with that because it does not list any ruby properties.By the way, this is analogous to text-emphasis-position which does apply to
::first-line. It seems obvious to me that the same mechanism should be used for positioning ruby as for positioning text emphasis.[css-ruby-1][css-pseudo-4] Apply ruby-position to ::first-line per #2998
[css-text-decor-4] Clarify application to ::first-line and ::first-le…
fantasai commentedon Jan 1, 2020
OK, I've made the edits for this. There's a tangential follow-up for the CSSWG in #4642 but I think this issue itself is closed.