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

[cssom-view] [css-viewport] Deprecate/Find a better name for the term “Layout Viewport” #8237

Open
bramus opened this issue Dec 16, 2022 · 1 comment

Comments

@bramus
Copy link
Contributor

bramus commented Dec 16, 2022

As a follow-up to Interop2022’s Viewport Investigation Effort, I’m filing this issue that came up.

The gist of issue web-platform-tests/interop-2022-viewport#25 is that:

  • The term “the viewport” is a term that is specced in the CSS2 spec
  • The term “the viewport” can be confusing as there are several viewports (e.g. the visual viewport)
  • The term “layout viewport” is often as an alternative, but the term is not really defined
  • Defining the term “layout viewport” could be an option, but its name not indicative of what it does. It’s more of a “position fixed viewport“, while the ICB actually affects layout.

During the discussions we wondered if the term “layout viewport” could be deprecated and/or if we could come up with a better name than just “the viewport”.

Some alternative terms that were suggested in the original issue:

  • document viewport
  • scroll viewport
  • frame viewport
  • canvas viewport
  • main viewport
  • root viewport
@pp-koch
Copy link

pp-koch commented Sep 14, 2023

Since I'm mostly to blame for the popularity of the term 'layout viewport', I thought I'd reply to this issue and offer some background.

In 2010 or so, when I first described their behaviour, I badly needed names for the two distinct mobile viewports I had discovered and that nobody else was talking about. The names visual and layout viewport were, I think, suggested by Anne van Kesteren and were used internally by Opera at that time. I ran with them, and since for years I was just about the only one to write about the viewports, they became de-facto standard terms.

At the time I was unsure about the exact relation of the layout viewport to the ICB, and I ignored that aspect.

Up until about 2013(?) there was considerable confusion about which viewport fixed elements should be fixed to. Some mobile browsers used the layout viewport, others the visual viewport, and if memory serves me there were even some browsers that fixed them relative to the ICB, which made fixed positioning the same as absolute positioning. Later on mobile browsers standardized on the 'layout viewport' as distinct from the ICB, and the modern system was born.

So at the time I coined these terms it was not at all clear that the layout viewport behaved as it currently does and that it was in fact distinct from the ICB.

What functions, other than fixing fixed elements, does the 'layout viewport' currently serve? I can think of none.

In the recent spec and spec-adjacent writing I read, 'viewport' always means 'layout viewport'. In my opinion a distinction between visual viewport and 'layout viewport' should continue to exist, though I'm not opposed to a name change.

I would suggest adding a note to the viewport definition that explains the existence of the visual and 'layout' viewports, and clarifies that 'the viewport' without further qualifiers always means the 'layout viewport'.

I created a viewport visualisation page that may be of help to people struggling with these concepts: http://quirksmode.org/mobile/viewports/. Ironically, it's only usable on a desktop device.

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