Skip to content

Commit 82a67e2

Browse files
authored
[css-page] Add page-orientation descriptor. Fixes w3c#4491. (w3c#4902)
* [css-page] Add page-orientation descriptor. Fixes w3c#4491. * [css-page-3] Change ID to avoid clash.
1 parent df8882d commit 82a67e2

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

css-page-3/Overview.bs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,86 @@ Media Queries</h4>
18621862
In the example above, "A4" sheets are given a "3cm" page margin, and "letter"
18631863
sheets are given a "1in" page margin.
18641864

1865+
<h4 id="page-orientation-prop">
1866+
Rotating The Printed Page: the 'page-orientation' property</h4>
1867+
1868+
<pre class=descdef>
1869+
Name: page-orientation
1870+
For: @page
1871+
Value: upright | rotate-left | rotate-right
1872+
Initial: upright
1873+
Computed Value: as specified
1874+
</pre>
1875+
1876+
High-quality printing implementations
1877+
can handle pages of varying sizes and orientations,
1878+
so an author can choose the size of a page
1879+
according to what's best for that page's content.
1880+
For example,
1881+
they might use ''size: letter portrait;'' for most pages in a document,
1882+
but switch to ''size: letter landscape;''
1883+
to lay out a wide information table.
1884+
1885+
However, handling content flowing across pages of differing widths
1886+
is a relatively complex task,
1887+
and is not yet solved in many popular printing implementations
1888+
(notably, web browsers).
1889+
The ''page-orientation'' descriptor is intended to help such implementations,
1890+
allowing them to lay out pages in a single consistent size,
1891+
but change the orientation post-layout
1892+
in the output medium
1893+
(such as PDF),
1894+
so that pages which want to be displayed in a different orientation
1895+
can do so.
1896+
1897+
Its values are defined as:
1898+
1899+
<dl dfn-type=value dfn-for=page-orientation>
1900+
: <dfn>upright</dfn>
1901+
:: No special orientation is applied;
1902+
the page is laid out and formatted as normal.
1903+
1904+
: <dfn>rotate-left</dfn>
1905+
:: After the page has been laid out,
1906+
if the output medium supports rotation,
1907+
this value indicates that the page must be displayed
1908+
rotated a quarter turn to the left
1909+
(counter-clockwise)
1910+
of how it was laid out.
1911+
1912+
: <dfn>rotate-right</dfn>
1913+
:: Same as ''rotate-left'',
1914+
except the page must be displayed
1915+
rotated a quarter turn to the right
1916+
(clockwise)
1917+
of how it was laid out.
1918+
</dl>
1919+
1920+
Note: Margin boxes and other positional things
1921+
have no special interaction with this property;
1922+
they'll be laid out as normal in the unrotated page,
1923+
then rotated along with everything else.
1924+
1925+
<div class=note>
1926+
This property is intended as a stop-gap
1927+
for less-capable implementations,
1928+
allowing them to still print documents
1929+
with a mix of portrait and landscape orientations
1930+
before they have the ability
1931+
to flow content across differently-size pages.
1932+
It requires some awkward contortions to use,
1933+
such as specifying that a wide table containing only English
1934+
actually has a vertical 'writing-mode'
1935+
so it'll lay out "sideways",
1936+
but be rotated back to upright for readability
1937+
in the printed output.
1938+
1939+
There should be no need to use this property
1940+
in high-quality printing implementations;
1941+
instead, use '@page/size' to control ''portrait'' vs ''landscape'' orientation of a page.
1942+
</div>
1943+
1944+
18651945
<h3 id="marks">
18661946
Crop and Registration Marks: the 'marks' property</h3>
18671947

0 commit comments

Comments
 (0)