@@ -172,21 +172,33 @@ Value Definitions</h3>
172172<h2 id="directional-keywords">
173173Flow-Relative Values: <css>block-start</css>, <css>block-end</css>, <css>inline-start</css>, <css>inline-end</css></h2>
174174
175- Properties that accept [=physical=] <dfn>directional keyword</dfn> values
176- (<css> top</css> , <css> bottom</css> , <css> left</css> , <css> right</css> )
177- are redefined to also accept the appropriate <a>flow-relative</a> [=directional keywords=]
178- (<css> block-start</css> , <css> block-end</css> , <css> inline-start</css> , <css> inline-end</css> ).
179- In such cases,
180- the flow-relative values can be used in place of the corresponding physical values.
181- For properties that take multiple keywords,
182- combinations of flow-relative and physical values are not allowed
183- (unless otherwise specified in a future specification).
175+ Many CSS properties have historically accepted <dfn>directional keyword</dfn> values
176+ that are [=physical=]
177+ (<css> top</css> , <css> bottom</css> , <css> left</css> , <css> right</css> ).
178+ This specification introduces [=directional keyword=] values that are [=flow-relative=] :
179+ <css> block-start</css> , <css> block-end</css> , <css> inline-start</css> , <css> inline-end</css> .
184180
185- Properties can be either 1-dimensional or 2-dimensional.
181+ A property's effect can be either 1-dimensional or 2-dimensional.
186182 When contextually constrained to one dimension,
187183 the flow-relative keywords are abbreviated
188184 (to <css> start</css> and <css> end</css> ).
189185
186+ CSS Level 2 properties are here redefined to also accept
187+ <a>flow-relative</a> directional keywords.
188+ Such values can be used in place of the corresponding physical values.
189+ For properties that take multiple keywords,
190+ combinations of flow-relative and physical values are not allowed
191+ (unless otherwise specified in a future specification).
192+
193+ Note: Newer CSS specifications are expected in most cases to define
194+ [=flow-relative=] or [=line-relative=] values
195+ instead of or in addition to any [=physical=] ones.
196+ In general, the mapping of such relative values are expected to use
197+ the [=writing mode=] of the [=containing block=] when affecting the box itself,
198+ and that of the box itself when affecting its contents.
199+ Regardless, which [=writing modes=] is used for the mapping
200+ needs to be explicitly defined.
201+
190202<h3 id="caption-side">
191203Logical Values for the 'caption-side' Property</h3>
192204
@@ -294,54 +306,57 @@ Flow-Relative Page Classifications</h2>
294306<h2 id="box">
295307Flow-Relative Box Model Properties</h2>
296308
297- This specification introduces new CSS properties
309+ For many formatting effects,
310+ the axis or direction affected is encoded in the property name
311+ rather than in its value.
312+ The type of directional or axis mapping
313+ (<a>flow-relative</a> or <a>physical</a> )
314+ of each such property
315+ is called its <dfn export>mapping logic</dfn> .
316+ Historically, all properties have been encoded in [=physical=] terms;
317+ this specification introduces new CSS properties
298318 that are <a>flow-relative</a> equivalents
299- of <a>physical</a> box model properties.
300- Each set of related flow-relative longhand properties
301- and their parallel physical properties,
302- which set equivalent styles on different sides or dimensions of a box,
303- form a <dfn export>logical property group</dfn> .
319+ of CSS2’s <a>physical</a> box model properties.
320+
321+ Note: Newer CSS specifications are expected in most cases to define
322+ [=flow-relative=] or [=line-relative=] properties
323+ instead of or in addition to any [=physical=] ones.
324+
325+ Each set of parallel
326+ [=flow-relative=] properties and [=physical=] properties
327+ (ignoring [=shorthand=] properties)
328+ related by setting equivalent styles on the various sides or dimensions of a box,
329+ forms a <dfn export>logical property group</dfn> .
304330 For example, the 'padding-*' properties
305331 form a single <a>logical property group</a> ,
306332 the 'margin-*' properties
307333 form a separate <a>logical property group</a> ,
308334 the 'border-*-style' properties
309335 form another <a>logical property group</a> ,
310336 etc.
311- The type of directional or axis mapping
312- (<a>flow-relative</a> or <a>physical</a> )
313- is called the property’s <dfn export>mapping logic</dfn> .
314-
315- Note: Each longhand property is in at most one <a>logical property group</a> .
316-
317- The <a>specified values</a> of the <a>flow-relative</a> properties
318- are distinct from
319- the specified values of the parallel physical properties,
320- but the flow-relative and physical properties share computed values.
321- Which pairs of properties share computed values
322- depends on the element’s computed values of
323- 'writing-mode' , 'direction' , and 'text-orientation' .
324-
325- Note: Depending on the element’s own <a>writing mode</a>
326- for mapping every <a>flow-relative</a> property
327- to its <a>physical</a> equivalent
328- simplifies the cascading calculations
329- and gives a straightforward model for authors to reason about.
330- However, it is problematic in many cases,
331- see for example <a href="https://www.w3.org/mid/20161108202634.GA7235@mail.internode.on.net">this discussion</a> .
332- Authors may need to use nested elements
333- to get the correct mapping behavior
334- when changing an element’s <a>writing mode</a> from its parent.
335-
336- A computed value that has flow-relative and physical properties as input
337- is determined by applying the CSS cascade to declarations of both.
338- Overriding is not determined by whether a declaration is flow-relative or physical,
339- but only by the rules of the CSS cascade [[!css-cascade-3]] .
337+ (Each [=longhand property=] can belong to at most one <a>logical property group</a> .)
338+
339+ Within each [=logical property group=] ,
340+ corresponding [=flow-relative=] and [=physical=] properties
341+ are paired using the element’s own
342+ [=computed value|computed=] [=writing mode=] .
343+ Although the [=specified value=] of each property remains distinct,
344+ paired properties share a [=computed value=] ,
345+ which is determined by [=cascading=]
346+ the declarations of both properties together as one;
347+ in other words, the [=computed value=] of both properties in the pair
348+ is derived from the [=specified=] value of the property declared with
349+ higher priority in the CSS [=cascade=] . [[!CSS-CASCADE-3]]
340350
341351 <p class="note">
342352 Note that this requires implementations to maintain
343353 relative order of declarations within a CSS declaration block,
344354 which was not previously required for CSS cascading.
355+ It also requires that 'writing-mode' , 'direction' , and 'text-orientation'
356+ be computed as a prerequisite for cascading together
357+ the [=flow-relative=] and [=physical=] declarations
358+ of a [=logical property group=]
359+ to find their [=computed values=] .
345360 </p>
346361
347362 <div class="example">
@@ -371,7 +386,19 @@ Flow-Relative Box Model Properties</h2>
371386
372387 [[!CSSOM]] APIs that return computed values
373388 (such as <code> getComputedStyle()</code> )
374- must return the same value for equivalent pairs of such properties.
389+ must return the same value for each individual property
390+ in such a pair.
391+
392+ Note: Depending on the element’s own <a>writing mode</a>
393+ for mapping every <a>flow-relative</a> property
394+ to its <a>physical</a> equivalent
395+ simplifies the cascading calculations
396+ and gives a straightforward model for authors to reason about.
397+ However, it is problematic in many cases,
398+ see for example <a href="https://www.w3.org/mid/20161108202634.GA7235@mail.internode.on.net">this discussion</a> .
399+ Authors may need to use nested elements
400+ to get the correct mapping behavior
401+ when changing an element’s <a>writing mode</a> from its parent.
375402
376403 ISSUE: There are some open questions on
377404 the <a href="https://github.com/w3c/csswg-drafts/issues/3029">order of inheritance vs mapping in flow-relative properties</a>
0 commit comments