Skip to content

Commit a6ad6a2

Browse files
committed
[css-align] Make smart-unsafe the default behavior for overflow alignment, per WG resolution (SF May 2016)
1 parent 3fe4e9d commit a6ad6a2

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

css-align/Overview.bs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Previous Version: https://www.w3.org/TR/2012/WD-css3-align-20120612/
1717
Abstract: This module contains the features of <a href="https://www.w3.org/TR/CSS/">CSS</a> relating to the alignment of boxes within their containers in the various CSS box layout models: block layout, table layout, flex layout, and grid layout. (The alignment of text and inline-level content is defined in [[CSS-TEXT-3]] and [[CSS-INLINE-3]].)
1818
Link Defaults: selectors-3 (dfn) first formatted line, css-flexbox-1 (dfn) flex line, css-multicol-1 (dfn) multi-column element, css-fonts-3 (dfn) first available font, css21 (property) max-width/max-height/min-width/min-height, css-writing-modes-3 (dfn) dominant baseline, css-position-3 (property) left, css-cascade-3 (value) initial, css-flexbox-1 (dfn) static-position rectangle
1919
Ignored Terms: table cell, stretch, scrollable overflow region
20-
At Risk: ''last-baseline''
20+
At Risk: ''last-baseline'', the <<overflow-position>> keywords, the scrollable-area safety trigger into ''safe'' mode when no <<overflow-position>> is specified
2121
</pre>
2222

2323
<style type="text/css">
@@ -400,19 +400,8 @@ Overflow Alignment: the ''safe'' and ''unsafe'' keywords</h3>
400400

401401
To help combat this problem,
402402
an <dfn export>overflow alignment</dfn> mode can be explicitly specified.
403-
"Unsafe" alignment honors the specified alignment mode in overflow situations, even if it causes data loss,
404-
while "safe" alignment changes the alignment mode in overflow situations in an attempt to avoid data loss.
405-
406-
If the <a>overflow alignment</a> isn't explicitly specified,
407-
the default <a>overflow alignment</a> is ''unsafe''.
408-
409-
Issue: This creates problems for people with small windows
410-
since overflow to the start direction is unreachable.
411-
We are considering having an omitted overflow alignment indicate a “smart” safe behavior,
412-
which would true-align the alignment subject
413-
unless it would overflow the nearest <em>scroll container</em>,
414-
at which point it would cease to shift startward
415-
so that it continued to remain within the scrollable area.
403+
“Unsafe” alignment honors the specified alignment mode in overflow situations, even if it causes data loss,
404+
while “safe” alignment changes the alignment mode in overflow situations in an attempt to avoid data loss.
416405

417406
<pre class='prod'><dfn>&lt;overflow-position></dfn> = unsafe | safe</pre>
418407

@@ -428,11 +417,17 @@ Overflow Alignment: the ''safe'' and ''unsafe'' keywords</h3>
428417
the given alignment value is honored.
429418
</dl>
430419

431-
Issue: Should we add a third (default) value that overflows up until the point that it would overflow into an unscrollable region?
432-
This is probably what's actually needed;
433-
we can't default to "safe" because of Flexbox,
434-
but this slight tweak to "unsafe" is probably safe compat-wise,
435-
and would help users on small screens.
420+
If the <a>overflow alignment</a> isn't explicitly specified,
421+
the default <a>overflow alignment</a> is similar to ''unsafe''
422+
in that an overflowing <a>alignment subject</a> is allowed to overflow its <a>alignment container</a>;
423+
however if the this would cause it to also overflow
424+
the <a>scrollable overflow region</a> of its nearest ancestor <a>scroll container</a>,
425+
then its overflow in that direction is limited
426+
by biasing any remaining overflow to the end side.
427+
In other words, it is similar to ''safe'' alignment
428+
except that the limit for switching to ''start''
429+
is triggered by overflowing the scrollable area,
430+
rather than merely overflowing the <a>alignment container</a>.
436431

437432
<div class='example'>
438433
The figure below illustrates the difference in "safe" versus "unsafe" centering,
@@ -488,6 +483,10 @@ Overflow Alignment: the ''safe'' and ''unsafe'' keywords</h3>
488483
</figure>
489484
</div>
490485

486+
Issue: It may not be Web-compatible to implement the “smart” default behavior
487+
(though we hope so, and believe it to be likely),
488+
so UAs should pass any feedback on this point to the WG.
489+
491490
<!--
492491
██████ ███████ ██ ██ ████████ ████████ ██ ██ ████████
493492
██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ███ ██ ██

0 commit comments

Comments
 (0)