Skip to content

[css-ruby] define the height of the content area of ruby bases, ruby annotations #4935

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

Closed
frivoal opened this issue Apr 10, 2020 · 1 comment
Labels
Closed Accepted by CSSWG Resolution Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-ruby-1 Current Work Needs Testcase (WPT)

Comments

@frivoal
Copy link
Collaborator

frivoal commented Apr 10, 2020

The box model of ruby bases boxes and ruby annotations boxes is insufficiently defined. As far as I can tell, we have the following information:

  • Base level contents of a ruby container box (presumably ruby base containers and ruby bases) are said to participate in the same inline formatting context that contains the ruby container itself. (in 2.2.1)
  • The base level of a ruby structure is laid out on the line, aligned according to its vertical-align property exactly as if its ruby bases were a regular sequence of inline boxes (in 3)
  • Ruby annotations within a level (within a single ruby container) are aligned to each other as if they were inline boxes participating in the same inline formatting context. (in 3)
  • "In most respects, ruby boxes can be styled similar to inline boxes." (in 3)

This makes it reasonably clear that internal ruby boxes are similar in many ways to inline boxes, and specifically that the way the align vertically is identical to inline boxes (in the regular line for base level boxes, in a virtual line for annotations).

The spec does not actually define what the content area of ruby bases or ruby annotations are.

In the inline axis, this is already tracked at the in-spec issue 7.

In the block axis, due to the strong similarity with inline boxes, I suspect the intent is that it would be the same as if the ruby base / annotation had been an actual inline box, but the spec doesn't actually state so explicitly. Note that the content area of an inline box is itself currently undefined (see the second note in css-inline section 3.3.1), but making sure that these two are identical seems worth stating. Alternatively, if it is meant to be something else (possibly tailored to the predominantly CJK usage of ruby), then that should be stated instead.

This is actually more important here than with regular inlines, because unlike for regular inlines, this affects layout, not just painting: around this content area, comes the padding/border/margin, and around that comes the base containers and annotation containers, and annotation containers are then positioned adjacent to base containers. If we don't know the content area, we don't know where the ruby containers will be placed.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed height of content area of bases and annotations, and agreed to the following:

  • RESOLVED: The height of the content are of ruby boxes and annos is calculated the same as for inline boxes
The full IRC log of that discussion <TabAtkins> Topic: height of content area of bases and annotations
<astearns> github: https://github.com//issues/4935
<TabAtkins> florian: A number of palces in the ruby spec that vaguely, implicitly, alludes to bases and annos being *quite similar* to inline boxes
<TabAtkins> florian: But they're not inline, they're ruby, they're just very similar.
<TabAtkins> florian: But the precise wyay they're similar isn't specified
<TabAtkins> florian: One way not specified is how to calculate height of the ocntent area
<TabAtkins> florian: For inlines we're working ons pecifying that
<TabAtkins> florian: Like elika said, presuambly once they work for inline, they should work for rubys
<TabAtkins> florian: But they should. We've been implying that, but havne't said so.
<TabAtkins> dbaron: I feel more strongly that ruby bases shoudl behave like inlines, than that annos should
<TabAtkins> dbaron: bases are basically just partof the line, and annos are outside of them
<xidorn> q+
<AmeliaBR> q+
<TabAtkins> dbaron: So making bases different from inlines is bad, because it means when you have ruby you rinline formatting becomes different in unexpected ways
<TabAtkins> dbaron: While annos might need some more differences
<Rossen_> +1 to dbaron
<TabAtkins> florian: We do have some reasons to have bases differ from inlines; we don't have reasons for annos to differ from bases.
<TabAtkins> florian: If we find reasons later, we can differentiate them, while keeping the same for now
<TabAtkins> Rossen_: When ruby-overhang comes into play we might have some diffs, but otherwise agree
<TabAtkins> xidorn: I think annos should behave like inlines a swell; anno has a container and it basically just lines up inside the container like an inline
<Rossen_> ack xidorn
<Rossen_> ack AmeliaBR
<TabAtkins> AmeliaBR: I agree we should reuse as much inline model as possible, but let's not oversimplify
<TabAtkins> AmeliaBR: Like, how line-height is integrated intot he inline box will be more complex than just looking at the base...
<TabAtkins> florian: Actually, that's a spearate issue we'll get to
<TabAtkins> florian: So proposed resolution is to define that th eheight of the content area of ruby bases and annos is calculated the same as inline boxes
<TabAtkins> AmeliaBR: Within what block context?
<TabAtkins> AmeliaBR: An isolated block context created by the ruby container? Or same as if inlines were in the parent block context?
<TabAtkins> fantasai: Why does that matter
<TabAtkins> ?
<TabAtkins> AmeliaBR: Not sure
<TabAtkins> fantasai: We're just talking about heights. Bases are considered to be part of the line: particpiate in line-height, justification, etc just as if they were inlines. They just get some extra space for annos, otherwise they're just normal text.
<TabAtkins> AmeliaBR: If it all adds up to the same, that's fine
<TabAtkins> RESOLVED: The height of the content are of ruby boxes and annos is calculated the same as for inline boxes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted by CSSWG Resolution Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-ruby-1 Current Work Needs Testcase (WPT)
Projects
None yet
Development

No branches or pull requests

3 participants