Re: [csswg-drafts] [css-ruby] Be more specific about the box model of base/annotation container boxes (#4937)

> > But I think this should be kept as implementation details
> 
> If it results in a different layout, it's not implementation details.

OK, wrong word. I mean leaving whether implementation needs to support border / padding of ruby base / text container unspecified.

> > > but curiously, it does not ignore the inline margin on base container boxes. I suspect that's an accident,
> 
> > That doesn't match my read of the code, the discussion on the implementing ticket, as well as my testing. Could you provide your test code for this?
> 
> See the 6th and 7th base/annotation pairs in the [web-platform-tests/wpt#22843](https://github.com/web-platform-tests/wpt/pull/22843)

Oops, I misread your comment, sorry. You actually mentioned inline margin here.

So, yes, inline margin of ruby base containers is respected, because they are considered normal inline elements in the line flow, thus their inline margin is respected alike. But ruby text containers are not inline elements, they are out of the flow, and just attached to the base containers.

I don't think it's impossible to take the inline margin of ruby text container into account, but doing so would likely make the implementation more complicated (although not unmanageable), and I don't see it useful.

Regarding the block margin of ruby base container, though...

> > But I think that also raise a question on what does margin box really means for ruby base box and ruby text box. They otherwise behave like inline element, so should their block margin counts in their margin box?
> 
> I think it should:
> * The definition is clear: The spec says the base/annotation container box should wrap around the base/annotation's margin box, and the margin box is defined to include the margin in all directions
> * The definition is useful: This gives us the ability to control the distance between the bases and the annotations, which is an important feature.
> 
> It's true that it makes them not entirely the same as inline boxes, but even if they have a number of similarities, they're not entirely the same anyway.

if we agree on that ruby base / text container should have their content area wrapping the block margin of ruby base / text box, then I think it's more consistent to actually take block margin of the containers into account. This is not hard to implement. It was just that we didn't consider this as the right behavior.

But we may need to take some extra caution, as expanding the block size of ruby level containers would affect line height. It might not really be a problem, though.

-- 
GitHub Notification of comment by upsuper
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4937#issuecomment-612008227 using your GitHub account

Received on Friday, 10 April 2020 12:28:55 UTC