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

Psychpsyo has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-ruby] The bounds of ruby boxes seem necessary, but the spec suggests that they are not ==
[css-ruby-1](https://drafts.csswg.org/css-ruby-1/#box-style) 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](https://drafts.csswg.org/css-ruby-1/#ruby-base-container-box) or [ruby annotation container boxes](https://drafts.csswg.org/css-ruby-1/#ruby-annotation-container-box). 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:

<img width="831" height="145" alt="Image" src="https://github.com/user-attachments/assets/ef2e64ff-5e70-4893-a28a-7aa41948e01d" />

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:
```html
<!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 https://github.com/w3c/csswg-drafts/issues/7404 is potentially related.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13875 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 1 May 2026 15:16:12 UTC