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-sizing] Is last remembered size logical or physical? #7564

Open
Loirooriol opened this issue Aug 3, 2022 · 3 comments
Open

[css-sizing] Is last remembered size logical or physical? #7564

Loirooriol opened this issue Aug 3, 2022 · 3 comments

Comments

@Loirooriol
Copy link
Contributor

Suppose an element stores a last remembered size with width/inline-size of 100px and height/block-size of 200px.
Then we add content-visibility: hidden so that the element uses that last remembered size.
Then we set writing-mode: vertical-lr.

What's the size of the element?

  • width/block-size of 100px and height/inline-size of 200px (i.e. we stored width and height).
  • height/inline-size of 100px and width/block-size of 200px. (i.e. we stored inline-size and block-size).
@Loirooriol
Copy link
Contributor Author

Chromium remembers a logical size https://software.hixie.ch/utilities/js/live-dom-viewer/saved/10521

@Loirooriol
Copy link
Contributor Author

ResizeObserver tracks changes in the logical sizes, so that seems the right approach.
Otherwise it would be hard to update a physical remembered size when a change in writing-mode preserves the logical size (so the ResizeObserver is not invoked) but swaps the physical size.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-sizing] Is last remembered size logical or physical?, and agreed to the following:

  • RESOLVED: Last remembered size is the logical size, not the physical size
The full IRC log of that discussion <emeyer> Topic: [css-sizing] Is last remembered size logical or physical?
<emeyer> github: https://github.com//issues/7564
<emeyer> oriol: Spec says when c-i-s is auto, then we record current size, but doesn’t say how this is done and we stored height and width or block and inline size?
<emeyer> …I propose to store a logical size; Blink is already doing this, and I’m doing the same in Firefox
<TabAtkins> q+
<emeyer> …Approach seems better because observers are triggered on logical size change, not physical size
<emilio> ack TabAtkins
<Rossen_> ack TabAtkins
<emeyer> TabAtkins: This seems wild to me, I definitely imagine physical size when I wrote this, but given resizeobserver depends on logical size, let’s do it
<emeyer> RESOLVED: Last remembered size is the logical size, not the physical size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants