From 4512ac02e885c62e6b1ea94cd0159e5ee5d62540 Mon Sep 17 00:00:00 2001
From: Rachel Andrew
-Display Order
-
- The 'layout-order' and 'reading-order' properties and their 'order' [=shorthand=]
- allow creating deliberate divergence
- between spatial arrangement on the 2D visual canvas,
- the reading and document navigation order,
- and the underlying order of elements in the source document
- in order to improve the accessibility of the document
- while creating interesting visual layouts.
- They are not intended (and should not be used)
- to apply semantic reordering operations.
-
- Advisement: Author-facing documentation such as tutorials and references
- should adequately address the accessibility impacts
- of 'order', 'layout-order', and 'reading-order'
- and discourage their misuse by authors and authoring tools.
+
+Display Order: the 'order' property
- Design Considerations and Background
-
- Some of the considerations that went into the design
- of 'order', 'reading-order', and 'layout-order' are:
-
- * There are clear use cases for disconnecting
- the [=reading and navigation order=] from the box layout order,
- the most fundamental of which is to make sure
- the [=reading and navigation order=] matches the visual perception order
- when it is not the same as the box layout order.
- (Visual perception is non-linear, and is influenced by things like
- the size, color contrast, and spacing of a visual element,
- not just its spatial coordinates on the page.)
- * It is a core principle of Web platform architecture,
- in order to allow content to be accessible to the widest possible audience
- across devices that exist now and in the future,
- for the underlying document to be sensical independent of CSS.
- Therefore the underlying document order
- should represent a logical ordering of its elements
- regardless of its visual presentation.
- * For components of a page that do not have a strong inherent order,
- a document can have multiple visual presentations with different layouts,
- all conveying the same semantic information.
- It should be possible for all of these presentations to have good accessibility.
- * Linear navigation, focus sequencing order, and screen-reader order
- should always match, because there are users who use them together.
- * Each component or hierarchical level of a page
- can have different requirements for reordering,
- so CSS reordering controls should not lend themselves
- too easily to blanket use
- (like 'box-sizing')
- rather than tailored use
- (like flow-relative vs. physical properties and values).
-
-Display Order Shorthand: the 'order' property
-
-
+
Name: order
- Value: [ <<'layout-order'>> <<'reading-order'>>? ] |
- [ [ reading || layout ] && <
+
-
-
- Note: The single-integer syntax sets only 'layout-order',
- in order to enable rearranging layout for better visual display
- without changing the underlying reading order.
+ of the logical order of elements
+ and their spatial arrangement on the 2D visual canvas.
+ (See [[#order-accessibility]].)
+
+ Specifically,
+ the 'order' property controls the order in which
+ [=flex items=] or [=grid items=] appear within their container,
+ by assigning them to ordinal groups.
+ It takes a single <
-Reading Order: the 'reading-order' property
-
-
- Name: reading-order
- Value: <
-
- The 'reading-order' property controls the order in which
- elements are rendered to speech
- or are navigated to when using (linear) sequential navigation methods.
- It takes a single <tabindex [[HTML]]),
- these take precedence over 'reading-order':
- the modified document order created by 'reading-order'
- essentially replaces the underlying source order
- for the purpose of such features.
-
- ISSUE: Is this the most appropriate interaction with with tabindex?
-
-
-Box Order: the 'layout-order' property
-
-
- Name: layout-order
- Value: <
-
-
Reordering and Accessibility
- The 'layout-order' property does not affect ordering in non-visual media
+ The 'order' property does not affect ordering in non-visual media
(such as speech).
- Likewise, 'layout-order' does not affect
+ Likewise, 'order' does not affect
the default traversal order of sequential navigation modes
(such as cycling through links, see e.g. tabindex [[HTML]]).
Advisement:
- Authors must use 'layout-order' only for spatial, not logical, reordering of content.
- Style sheets that use 'layout-order' to perform logical reordering are non-conforming.
+ Authors must use 'order' only for spatial, not logical, reordering of content.
+ Style sheets that use 'order' to perform logical reordering are non-conforming.
Note: This is so that non-visual media and non-CSS UAs,
which typically present content linearly,
can rely on a logical source order,
- while 'layout-order' is used to tailor the layout order.
+ while 'order' is used to tailor the layout order.
(Since visual perception is two-dimensional and non-linear,
the desired layout order is not always logical.)
@@ -1280,7 +1114,7 @@ Reordering and Accessibility
authoring tools--
including WYSIWYG editors as well as Web-based authoring aids--
must reorder the underlying document source
- and not use 'layout-order' to perform reordering
+ and not use 'order' to perform reordering
unless the author has explicitly indicated that
the spatial order should be out-of-sync with
the underlying document order (which determines speech and navigation order).
@@ -1306,14 +1140,218 @@ Reordering and Accessibility
Note: User agents, including browsers, accessible technology, and extensions,
may offer spatial navigation features.
- This section does not preclude respecting the 'layout-order' property
+ This section does not preclude respecting the 'order' property
when determining element ordering in such spatial navigation modes;
indeed it would need to be considered for such a feature to work.
- But 'layout-order' is not the only (or even the primary) CSS property
+ But 'order' is not the only (or even the primary) CSS property
that would need to be considered for such a spatial navigation feature.
A well-implemented spatial navigation feature would need to consider
all the layout features of CSS that modify spatial relationships.
+
+Reading Order: the 'reading-order-items' property
+
+
+ Name: reading-order-items
+ Value: normal from-order? | flex [ visual | flow ] | grid [ rows | columns ]
+ Initial: normal
+ Applies to: flex and grid containers
+ Inherited: no
+ Computed value: as specified
+ Animation type: not animatable
+
+
+ The 'reading-order-items' property controls the order in which
+ elements in a flex or grid layout are rendered to speech
+ or are navigated to when using (linear) sequential navigation methods.
+
+ It takes one or more keyword values. Values are defined as follows:
+
+
+
+
+ ISSUE: As raised in a comment by fantasai,
+ do we need the multiple keywords, or should we hyphenate?
+
+
+ <div class="wrapper">
+ <a href="#">Item 1</a>
+ <a href="#">Item 2</a>
+ <a href="#">Item 3</a>
+ </div>
+
+
+
+ .wrapper {
+ display: flex;
+ flex-direction: row-reverse;
+ reading-order-items: flex visual;
+ }
+
+
+ <div class="wrapper">
+ <a class="a" href="#">Item 1</a>
+ <a class="b" href="#">Item 2</a>
+ <a class="c" href="#">Item 3</a>
+ <a class="d" href="#">Item 4</a>
+ </div>
+
+
+
+ .wrapper {
+ display: grid;
+ grid-template-columns: repeat(3, 150px);
+ grid-template-areas: "d b b"
+ "c c a";
+ reading-order-items: grid rows;
+ }
+
+ .a { grid-area: a; }
+ .b { grid-area: b; }
+ .c { grid-area: c; }
+ .d { grid-area: d; }
+
+
+ <div class="wrapper">
+ <a href="#">Item 1</a>
+ <a href="#">Item 2</a>
+ <a href="#">Item 3</a>
+ </div>
+
+
+
+ .wrapper a:nth-child(3) {
+ order: -1;
+ }
+
+ .wrapper {
+ display: flex;
+ reading-order-items: flex flow;
+ }
+
+ tabindex [[HTML]]),
+ these take precedence over 'reading-order-items':
+ the modified document order created by 'reading-order-items'
+ essentially replaces the underlying source order
+ for the purpose of such features.
+
+ ISSUE: Is this the most appropriate interaction with with tabindex?
+
+ Design Considerations and Background
+
+ Some of the considerations that went into the design
+ of 'reading-order-items' are:
+
+ * There are clear use cases for disconnecting
+ the [=reading and navigation order=] from the box layout order,
+ the most fundamental of which is to make sure
+ the [=reading and navigation order=] matches the visual perception order
+ when it is not the same as the box layout order.
+ (Visual perception is non-linear, and is influenced by things like
+ the size, color contrast, and spacing of a visual element,
+ not just its spatial coordinates on the page.)
+ * It is a core principle of Web platform architecture,
+ in order to allow content to be accessible to the widest possible audience
+ across devices that exist now and in the future,
+ for the underlying document to be sensical independent of CSS.
+ Therefore the underlying document order
+ should represent a logical ordering of its elements
+ regardless of its visual presentation.
+ * For components of a page that do not have a strong inherent order,
+ a document can have multiple visual presentations with different layouts,
+ all conveying the same semantic information.
+ It should be possible for all of these presentations to have good accessibility.
+ * Linear navigation, focus sequencing order, and screen-reader order
+ should always match, because there are users who use them together.
+ * Each component or hierarchical level of a page
+ can have different requirements for reordering,
+ so CSS reordering controls should not lend themselves
+ too easily to blanket use
+ (like 'box-sizing')
+ rather than tailored use
+ (like flow-relative vs. physical properties and values).
+