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

[css-ruby] ruby base container as containing block #6324

Open
fantasai opened this issue May 29, 2021 · 6 comments
Open

[css-ruby] ruby base container as containing block #6324

fantasai opened this issue May 29, 2021 · 6 comments
Labels
css-ruby-1 Current Work

Comments

@fantasai
Copy link
Collaborator

@TalbotG recently asked about this test from @upsuper http://wpt.live/css/css-ruby/abs-in-ruby-base-container.html which... I'm not really sure what it's trying to assert.

I don't think our spec is clear what happens when various ruby boxes are relpos'ed, do they form containing blocks for abspos descendants or no, and we should figure out what we should be doing and clarify it.

@fantasai fantasai added the css-ruby-1 Current Work label May 29, 2021
@fantasai
Copy link
Collaborator Author

And probably the tests should be made a little less confusing... relying on cancelling 50px half-leading inside the abspos by using a -1em offset is pretty convoluted. @_@

@upsuper
Copy link
Member

upsuper commented May 30, 2021

I don't fully recall all the details of how I came up with this testcase, but I believe it's basically treating the ruby box as normal inline box in the term of abspos children, which I think makes sense.

Also the change originally came from a compat issue that someone trying to use abspos in ruby, and Firefox didn't show anything at that time (because I didn't think about it so missed something). This test is basically just checking that abspos in ruby does show up.

@TalbotG
Copy link
Collaborator

TalbotG commented May 30, 2021

"
If the box has position: absolute:
The containing block is established by the nearest ancestor box that establishes an absolute positioning containing block, in the following way:
(...)
If the ancestor is an inline box,
the containing block is formed by the block-start and inline-start content edges of the first box fragment of the ancestor, and the block-end and inline-end content edges of the last box fragment of the ancestor.
Note: If the ancestor breaks across a line, the 'start' position might more end-ward than the 'end' position.
"
coming from
CSS Positioned Layout 3,
§2.1. Containing Blocks of Positioned Boxes

and so, that includes cases where the inline element is split across multiple lines.

I have old CSS2.x tests on this:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/containing-block-017-GT.html
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/containing-block-017-GT2.html
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/containing-block-031.html
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/containing-block-032.html

I remember reporting that some of tests in the CSS2.1 test suite regarding an abs. pos. inline inside a rel. pos. inline had various problems:
https://lists.w3.org/Archives/Public/public-css-testsuite/2012Mar/0008.html
Other tests may be weak:
http://test.csswg.org/suites/css21_dev/20110323/html4/containing-block-013.htm

@TalbotG
Copy link
Collaborator

TalbotG commented May 30, 2021

What I am trying to say is this: an absolutely positioned inline inside a relatively positioned inline is a complex code scenario and current browsers (Firefox, Chromium, Safari) do not implement, do not comply with past and current spec.

Bug 489100: absolutely positioned child of relative inline containing block is positioned relative to only first line of inline

Chromium 90.0.4430.212 fails the containing-block-032 test but passes the other 3 tests.

In CSS2.1 test suite, we have a few tests, most of them are weak, I'd say.

The only browser which was very good at positioning an abs. pos.inline inside
a rel. pos. inline was Opera 12.16 (Presto engine).

@TalbotG
Copy link
Collaborator

TalbotG commented Jun 25, 2021

Firefox didn't show anything at that time (because I didn't think about it so missed something). This test is basically just checking that abspos in ruby does show up.

Indeed, Firefox 78.11.0 ESR does not show the X in abs-in-ruby-base-container.html and in abs-in-ruby-container.html but Firefox 91.0a1 buildID=20210625093436 does.

Okay. Xidorn, I can not approve or disapprove your
abs-in-ruby-base-container.html
abs-in-ruby-base.html
abs-in-ruby-container.html
tests. I just do not know. As @fantasai wrote, what happens when ruby internal boxes and ruby container box are relpos'ed, do they form containing blocks for abspos descendants is unknown or not defined in the ruby specification.

@fantasai
Copy link
Collaborator Author

fantasai commented Sep 8, 2021

See also web-platform-tests/wpt#29482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-ruby-1 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants