W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2020

Re: [csswg-drafts] [css-viewport] Help me bikeshed "layout viewport" (#4819)

From: Simon Fraser via GitHub <sysbot+gh@w3.org>
Date: Wed, 04 Mar 2020 16:38:33 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-594649622-1583339911-sysbot+gh@w3.org>
> Good reply; however,
> 1. When you rewrite a meta viewport tag, the browser resizes the initial containing block as well, and the layout is adjusted.  That argues in favour of the layout viewport and the initial containing block being the same (minus scrolling).

This is true.

> 2. You can only _prove_ that the layout viewport scrolls by inspecting the behaviour of a fixed element. If fixed elements were placed relative to the document or the visual viewport (and both happened in the past), it is impossible to prove that the layout viewport scrolls, and therefore it doesn't scroll (sort-of, if you understand what I mean), and therefore it's exactly equal to the initial containing block.
> So while it is technically possible to distinguish between the initial containing block and the layout viewports, browsers don't actually do so in case #1, and case #2 shows that the only reason we say the layout viewport 'scrolls' is because of the current implementation of position: fixed, the definition of which is exactly why you want to change the name 'layout viewport.'
> And now I have managed to twirl myself into a logical loop that I can't figure my way out of. So let's leave it at stating that the two started out as one and the same.

I had problems following this argument :)

You can prove the layout viewport scrolls by comparing getBoundingClientRect() on a position:fixed vs a position:absolute element across a scroll position change.

> On a different level, I am unconvinced that it is a good idea to change well-known names of things. As far as I can see, either web developers will ignore the name change and continue to call it layout viewport, which will lead to confusion, or they will follow the name change but not understand that it was called layout viewport in the past, also leading to confusion.

Do web developers really think about "layout viewport" now? They are familiar with "client" coordinates presumably, and with "initial containing block" though not necessarily with that name. But I've never seen "layout viewport" used in a non browser-implementation context.

> W3C has had plenty of time to standardize the viewports, but didn't, even though back in 2010-3 the browsers (and I) needed some firm guidance. Thus it left the de-facto standardization of the viewports to browser vendors (and, in a small way, me; I spent about a year mailing browser vendors to get them all to align on the JavaScript properties). I feel that it's a bit late to change the entire nomenclature.
> But that's just my opinion, and because of my long history with the viewports I am probably a bit defensive, and certainly very happy with the status quo.

Maybe the real question here is whether we should just call it the "client rect" because that's what it is, much as I hate the name.

GitHub Notification of comment by smfr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4819#issuecomment-594649622 using your GitHub account
Received on Wednesday, 4 March 2020 16:38:35 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:02 UTC