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

The width of content elements' areas is unclear, especially looking at the examples #134

Closed
plehegar opened this issue Nov 4, 2015 · 6 comments

Comments

@plehegar
Copy link
Member

plehegar commented Nov 4, 2015

The size of content elements relative to their parent elements and generated content elements is unclear. It is neither specified in chapter 10.2.1 Style Attribute Vocabulary nor in chapter 8.1 Content Element Vocabulary. It perhaps is specified in chapter 11.3.1.4 Synchronic Flow Processing however there are no forward references directing the reader there. Even if it is in fact specified by a normative reference to XSL-FO and/or CSS, it would be helpful to add non-normative Notes where the information is most relevant, i.e. on style attributes whose effect is bounded by the applicable rectangular area.

The terms "block display", "inline display" and "inline block display" are usefully defined in TTML2 but those definitions are not referenced everywhere they apply.

Specifically, the implementation of the tts:backgroundColor, tts:backgroundImage and tts:border style attributes depends on the correct calculation of the rectangle to which they apply, and that rectangle is computed differently for spans than for the other content elements: only for spans is the size in the inline progression dimension related to the text content width; all the other elements' size in the inline progression dimension relates to the parent element's content rectangle minus any padding applied.

The example for tts:backgroundColor is ambiguous and possibly misleading in this respect, because the width of the text has been chosen to be exactly the same as the width of the content area of the p that is coloured purple, making it appear to the casual observer that the purple box is shrunk to the maximum width of the inline areas generated for the text.

Proposed resolutions:

  1. EITHER include normative text that specifies how the calculation of the rectangle to which the above listed attributes apply differs between spans and other content elements OR (if somehow the normative text is already strong enough) add non-normative notes to each attribute calling out the difference, or add the note to the introductory part of chapter 10.2 and then reference it from the attributes.
  2. Add a diagram showing the width and height calculation (possibly this relates also to the resolution for Issue-302) that applies to each content element, and reference it from tts:backgroundColor, tts:backgroundImage and tts:border. This could be in the introductory part of chapter 10.2 for example.
  3. Change the example for tts:backgroundColor to make it use a longest line length that is shorter than the width of the content area of the parent p element, or add a new example or a second p where that is the case.
  4. Ensure that the examples for tts:border do not reproduce the ambiguity.

(raised by Nigel Megitt on 2015-03-26)
From tracker issue http://www.w3.org/AudioVideo/TT/tracker/issues/380

@nigelmegitt
Copy link
Contributor

Reviewing this, the issue remains open, and one of the reasons is that the spec does not normatively make the link between the CSS box layout algorithm and the content elements body, div, p, span and br. Defining these normatively as part of #127 could be a way to address this for example.

@skynavga skynavga modified the milestone: TTML2WR Feb 23, 2017
@skynavga
Copy link
Collaborator

skynavga commented May 22, 2017

Regarding the previous comment, TTML does not make any use of the CSS box model per se. Rather, it makes normative reference to XSL-FO's area model, which in some cases, is based in part on CSS semantics.

I believe it is impractical (and undesirable) to either adopt proposed resolutions 1 or 2 listed above. I would not object to improving either the example code or rendition used with tts:backgroundColor or tts:border. However, at present, we have no proposed PR that provides improved examples, so I am closing and marking for ttml.next. If someone wants to propose a PR, feel free to re-open this issue.

@nigelmegitt
Copy link
Contributor

Closing in the absence of a PR and in the absence of discussion is inappropriate. Reopening. We have not yet assessed for each open issue if it should be moved to ttml.next, so removing that label.

@skynavga
Copy link
Collaborator

Moving off Editor's WR list due to lack of PR.

@skynavga skynavga removed this from the Editor's WR Work List milestone May 25, 2017
@nigelmegitt
Copy link
Contributor

I will raise a PR for this to change the examples on tts:backgroundColor and tts:border so that they are less ambiguous, as per proposals 3 and 4 above.

nigelmegitt added a commit that referenced this issue Jun 15, 2017
Fixes #134.

* Remove issue note
* Change examples for `tts:backgroundColor` and `tts:border` to use
padding of “3px 30px” rather than “3px 40px” and update image
accordingly.
@nigelmegitt nigelmegitt added this to the Editor's WR Work List milestone Jun 15, 2017
@nigelmegitt
Copy link
Contributor

I've raised a pull request for this as per options 3 and 4 and added back to the Editor's WR list.

skynavga added a commit that referenced this issue Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants