Skip to content

Commit a236cff

Browse files
committed
[css-position-4] Make 'rendered in the top layer' depend on 'overlay' as well, to allow for entry animations as well. w3c#8730
1 parent 5bc5cc1 commit a236cff

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

css-position-4/Overview.bs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ Top Layer Manipulation {#top-manip}
488488
<div algorithm>
489489
An element |el| is <dfn export lt="render in the top layer">rendered in the top layer</dfn>
490490
of an optional {{Document}} |doc|
491-
if |el| is [=list/contained=] in |doc|'s [=Document/top layer=].
491+
if |el| is [=list/contained=] in |doc|'s [=Document/top layer=],
492+
and |el| has ''overlay: auto''.
492493

493494
If |doc| is not passed,
494495
it's [=rendered in the top layer=]
@@ -596,43 +597,36 @@ Inherited: no
596597
Animation Type: (see prose)
597598
</pre>
598599

599-
The 'overlay' property is used to help determine
600-
whether an element should be in the [=Document/top layer=] or not.
600+
The 'overlay' property determines
601+
whether an element is [=rendered in the top layer=] or not.
601602

602603
<dl dfn-type=value dfn-for=overlay>
603604
: <dfn>none</dfn>
604-
:: The element shouldn't be in the [=Document/top layer=].
605+
:: The element isn't [=rendered in the top layer=].
605606

606607
: <dfn>auto</dfn>
607-
:: The element should be in the [=Document/top layer=].
608+
:: The element is [=rendered in the top layer=].
608609
Rather than generating boxes as part of its normal position in the document,
609-
it generates boxes as a sibling of the root element.
610+
it generates boxes as a sibling of the root element,
611+
rendered "above" it.
610612
</dl>
611613

612614
<div class=note id=overlay-guidance>
613-
Note: 'overlay' is a somewhat unusual property:
614-
it is <em>only</em> set by the user agent,
615+
Note: 'overlay' is a somewhat unusual property,
616+
as it is <em>only</em> set by the user agent,
615617
and can't be set by authors <em>at all</em>.
616-
As well, it has almost no effect:
617-
an element is [=rendered in the top layer=]
618-
as soon as it's [=in the top layer=]
619-
and stops as soon as it's not;
620-
the 'overlay' property doesn't affect this.
621-
622-
However, when the user agent wants to remove an element from the [=Document/top layer=],
623-
it checks 'overlay' first;
624-
if it's still ''overlay/auto'',
625-
it delays the removal until it's ''overlay/none''.
626-
The user agent is in control of when it goes from ''overlay/auto'' to ''overlay/none'',
627-
but authors <em>can</em> set a 'transition' on 'overlay',
628-
delaying its change.
629-
630-
This delay period can then be paired with other animations or transitions
631-
to create an "exit animation"--
632-
animating the element leaving the top layer,
633-
for example by fading its 'opacity'--
634-
without it <em>also</em> immediately rendering back in the normal document
635-
and possibly becoming obscured.
618+
619+
However, authors <em>do</em> have the ability to affect
620+
<em>when</em> 'overlay' changes its value,
621+
by setting a 'transition' on the property.
622+
This allows an author to align an animation
623+
with the transition,
624+
with the element moving in or out of the top layer
625+
only at the desired point in the animation.
626+
This allows, for example,
627+
an animation that causes an element to fade out of its normal position on the page,
628+
then fade in at its new top-layer position,
629+
or vice versa.
636630
</div>
637631

638632
For animation,
@@ -643,6 +637,12 @@ and other values of p map to the closer endpoint;
643637
if neither value is ''overlay/auto'' then discrete animation is used.
644638

645639
Note: This is similar to how 'visibility' animates.
640+
With most [=easing functions=],
641+
this will keep the element [=rendered in the top layer=]
642+
for the entire duration of the transition,
643+
whether it's entering or leaving the top layer.
644+
''step-start''/''step-end''/''linear()''
645+
can be used to control when the value flips more precisely.
646646

647647
User agents must have the following rule in their UA stylesheet:
648648

0 commit comments

Comments
 (0)