Skip to content

[css-ruby] The bounds of ruby boxes seem necessary, but the spec suggests that they are not #13875

@Psychpsyo

Description

@Psychpsyo

css-ruby-1 says:

The UA is not required to support any of the background properties or outline properties, or any other property that illustrates the bounds of the box on ruby base container boxes or ruby annotation container boxes. The UA may implement these boxes simply as abstractions for inheritance and control over the layout of their contents.

That sounds very nice, except that the "bounds of the box" become relevant for "the layout of their contents" when the box has position: relative and a child has position: absolute.
Turns out that browsers are wildly non-interoperable on this and produce results of... varying sensibility:

Image

From left to right, these are WebKit, Chromium and Gecko. (the regular inline box is just provided as a reference)

The HTML for this is:

<!DOCTYPE html>
<style>
rt, #test {
	position: relative;
	border: 2px solid #f008;
	&::before {
		content: "";
		display: block;
		width: 100%;
		height: 1em;
		background-color: green;
		position: absolute;
		left: 0;
		z-index: -1;
	}
}

</style>
<ruby>混沌<rt>こんとん</rt>より<rt></rt>監視<rt>かんし</rt>する<rt></rt><rt>もの</rt></ruby>
<br><br>
<span id="test">Regular inline element</span>

I also think #7404 is potentially related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions