[csswg-drafts] [css-writing-modes] Orthogonal Flow Constraint: viewport vs scroller

fantasai has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-writing-modes] Orthogonal Flow Constraint: viewport vs scroller ==
Was going through old action items and found [this one](https://lists.w3.org/Archives/Public/www-style/2014Dec/0301.html):

> ACTION fantasai: Put IE's nearest-scrollable-box behavior into orthogonal flows spec

Specifically

>  Rossen: What we do, basically the obvious pitfall is we say it's shrink to fit, assuming you do layout for shrink to fit.  If you, let's assume you have one long line of text. You don't want shrink to fit that's one long line of text.
> Rossen: I believe there's text in writing modes that spec if you have no height in the orthogonal switch you cap that to the viewport. We do nearest scrollable box of viewport.
>  Rossen: We discovered with orthogonal flow, the cases are mostly having some kind of webpage where you scroll down and find an example of vertical text. The idea is you want to be able to see that in your screen. You don't want to have to scroll both ways. In our implementation we cap the size of the vertical orthogonal content to be the min of your nearest scrolling ancestor and your viewport.
>  Rossen: With that in mind you can go and compute your min and max size. You need to define that. Max size can be the layout that you would produce when you cap content at the min.
> Rossen: The min of the content would be the cap size, the viewport or nearest scrolling.
>  Rossen: That's a fairly good result in almost all practical cases. I'm pretty sure you're looking to avoid where you have the min and max to be one line height.

[Testcase](http://software.hixie.ch/utilities/js/live-dom-viewer/?<!DOCTYPE html>%0A<style>%0A div { border%3A solid%3B height%3A 100px%3B overflow%3A scroll%3B }%0A p { writing-mode%3A vertical-rl%3B }%0A<%2Fstyle>%0A%0A<div>%0A <p>A B C D E F G H I J K L M N O P%0A<%2Fdiv>)

The spec says to use the initial containing block size.
Firefox and Chrome apparently use the nearest scroller size.
It sounds like Edge does something a bit more complex, more like min(scroller, viewport).

In any case, I agree with Rossen that referencing the nearest scroller is better than just using the initial containing block size, and since we have two implementations of that, we should fix the spec.

We can also, in the future, look into intersecting that size with intervening scrollers as described in those minutes, but I'm a bit less convinced of that (since it's less predictable for the author what's happening).

Agenda+ for WG approval to update the spec to match implementations and use the nearest scroller instead of the ICB.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1391 using your GitHub account

Received on Thursday, 18 May 2017 00:17:45 UTC