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

Viewport Units vs. Scrollbars #15

Closed
bramus opened this issue Aug 22, 2022 · 5 comments
Closed

Viewport Units vs. Scrollbars #15

bramus opened this issue Aug 22, 2022 · 5 comments

Comments

@bramus
Copy link
Collaborator

bramus commented Aug 22, 2022

Viewport Units are based on the size of the ICB

The viewport-percentage lengths are relative to the size of the initial containing block

We can summarise those specific types of viewports as follows:

  • Small Viewport = Size of the ICB
  • Large Viewport = Size of the ICB + Size difference of Dynamic Toolbars before/after retracting

Illustration

In its turn the ICB size is based on that of the Viewport (for continuous media)

For continuous media, it [the ICB] has the dimensions of the viewport and is anchored at the canvas origin

Illustration

When Classic Scrollbars are present, the Layout Viewport gets resized.

Illustration

As a result, the ICB will resize as well

Illustration

And as a result of that, the Viewport Units should also resize, as the spec reads

When the height or width of the initial containing block is changed, they are scaled accordingly.

The latter is not the case however. The Viewport Units do not resize. Instead, they retain their size from before the ICB was resized.

This behavior is covered by the spec through this footnote:

In all cases, scrollbars are assumed not to exist.

The spec seems to be contradicting itself here. Additionally, this “scrollbars are assumed not to exist”-behavior also frustrates a lot of authors.

It would be nice if we could discuss the behavior here, and eventually make a proposal at the CSSWG.

Relevant Issues in other repositories:

@bramus bramus added ICB Viewport Units svh/dvh/lvh/vh labels Aug 22, 2022
@jensimmons
Copy link

It would be nice if we could discuss the behavior here, and eventually make a proposal at the CSSWG.

It would be better to open issues at the CSSWG now — with the questions.
https://github.com/w3c/csswg-drafts/issues

Not having discussions here and proposing solutions at CSSWG.

Everyone involved with Interop works for companies that are members of the W3C. Everyone involved can join the CSSWG through your AB rep. And have the discussion there. It's very important to follow the proper process.

@fantasai
Copy link

@bramus If you can convince implementers to implement it, flag w3c/csswg-drafts#6026 as Agenda+. Fundamentally the reason the spec ignores scrollbars for viewport units is that it's difficult to implement. Even compromising and treating overflow: auto as a stable state in one direction or the other, and having at least 'overflow: scroll` account for the scrollbar width wasn't acceptable.

Also +1 to @jensimmons ; if there's something that needs changing in the CSS specs, flag it there. You can track things here, to make sure the spec and implementations and tests all match, but this effort isn't an actual standardization forum.

@karlcow
Copy link

karlcow commented Aug 26, 2022

There's already a lot of work for the interop effort to be done in just selecting the existing tests/specs to make sure we can improve interop.

The current fact findings effort really starts to look like a regular fact finding standard work, which indeed should happen on the CSS WG directly for many reasons: exposure, working group policies, etc.

  • Finding if current WPT tests are failing is definitely ok,
  • Finding if they are missing tests for a specific technology area is probably ok, though starting to be borderline in between interop and specific group.
  • Investigating how the technology is working, should work or not is probably out of scope

All of that not to say, that this is wonderful work which I wanted to see happening for a long time, but it should happen at the right place.

@bramus
Copy link
Collaborator Author

bramus commented Oct 5, 2022

@bramus
Copy link
Collaborator Author

bramus commented Nov 14, 2022

CSSWG issue for MQ as proposed in notes: w3c/csswg-drafts#7697 (comment)

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

4 participants