Re: [csswg-drafts] [css-page-3] Add orientation descriptor (#4491)

Okay, so the case is that the thing assembling the pages knows how to produce a page of content that's "sideways" (landscape-oriented content, but using `size: portrait`); the margins are then all portrait-oriented (`@top` along the short edge), regardless of the page content's orientation.

Then, for the purpose of viewing in a browser, you can set `orientation` on the "sideways" pages to flip them into landscape, so they're easier to view as a PDF; the margins are then "sideways" (still along the shorter edge) but that's less important than making the page viewable without rotating your head or your device 90deg.

Okay, so I accept this as being a reasonable solution for your case 3 (legacy system outputting portrait-oriented bitmaps for pages), but it's completely backwards for cases 1 (wide table) and 2 (wide image), which both want to use `size: landscape` on those pages during layout; they just want the margins to be portrait-oriented instead, so that during printing (when all the pages are arranged portrait-oriented) all the margin boxes are consistent.  As currently described, they instead have to use an ordinary `size: portrait` page, but set `writing-mode` to a vertical value, which is a hacky thing to do in horizontal text.  

It also means that we're privileging the "view as printed/bound" case over the "view on the web" cases, requiring the author to know they have to intervene with the `orientation` property to get the page content to display correctly on the web (or PDF). I think we should be doing the opposite, and making web-viewing correct by default (that is, using `size: landscape` on landscape pages), and then have this feature be able to set the margins to the intended orientation.  Tooling (like Docs) trying to use this feature can output either way, so optimizing for them doesn't matter here.

So I think it should instead be pointed as a margin-orienting feature, like `margin-orientation: default | rotate-left | rotate-right`, with `rotate-left` meaning that the margin boxes are all rotated to the left and laid out that way (so @top is along the left side of the page, and laid out like vertical-lr), etc. This would also inform printing software to use the same rotation for the entire page by default, so that the margin boxes are consistent across pages.

Then the "legacy tools output portrait-oriented bitmaps" would use this by putting the intended-landscape image on a `size: landscape` page, hopefully with the image produced landscape to start with (or at worst, using `image-orientation` to rotate the portrait image into landscape), and then `margin-orientation: rotate-*` to indicate which shorter side should be the "top" when printing.

Thoughts?

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4491#issuecomment-590627008 using your GitHub account

Received on Tuesday, 25 February 2020 01:01:05 UTC