Skip to content

Commit dcc8029

Browse files
committed
[css-anchor-position] Fix the definitions for position-visibility: anchors-visible
1 parent ff62553 commit dcc8029

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

css-anchor-position-1/Overview.bs

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,14 +1008,20 @@ Conditional Hiding: the 'position-visibility' property {#position-visibility}
10081008

10091009
<pre class=propdef>
10101010
Name: position-visibility
1011-
Value: always | anchors-valid || anchors-visible || no-overflow
1011+
Value: always | [ anchors-valid || anchors-visible || no-overflow ]
10121012
Initial: anchors-visible
10131013
Applies to: [=absolutely-positioned=] elements
10141014
Percentages: n/a
10151015
Inherited: no
10161016
Animation type: discrete
10171017
</pre>
10181018

1019+
There are times when an element's anchors
1020+
are not appropriate for positioning the element with,
1021+
and it would be better to simply not display the element at all.
1022+
'position-visibility' provides several conditions
1023+
where this could be the case.
1024+
10191025
<dl dfn-type=value dfn-for=position-visibility>
10201026
: <dfn>always</dfn>
10211027
::
@@ -1045,10 +1051,9 @@ Animation type: discrete
10451051

10461052
: <dfn>anchors-visible</dfn>
10471053
::
1048-
If the element does not have a [=default anchor element=],
1049-
or it has a [=default anchor element=]
1050-
but the anchor element is [=clipped by scrolling=],
1051-
this element is [=strongly hidden=].
1054+
If the element has a [=default anchor element=]
1055+
but the anchor element is [=clipped by intervening elements=],
1056+
this element is also [=strongly hidden=].
10521057

10531058
Issue: Since only the [=default anchor element=]
10541059
triggers scroll-compensation,
@@ -1062,15 +1067,31 @@ Animation type: discrete
10621067
then the element is [=strongly hidden=].
10631068
</dl>
10641069

1065-
For the purposes of this property,
1066-
an anchor element is <dfn noexport>clipped by scrolling</dfn>
1067-
if its [=ink overflow rectangle=]
1068-
is fully outside the [=scrollport=]
1069-
of one of its scrollable ancestors.
1070+
<div algorithm>
1071+
An anchor element |anchor|
1072+
is <dfn noexport>clipped by intervening elements</dfn>
1073+
relative to a positioned element |abspos| relying on it
1074+
if |anchor|'s [=ink overflow rectangle=]
1075+
is fully clipped by an element
1076+
which is an ancestor of |anchor|
1077+
but a descendant of |abspos|'s containing block.
1078+
This "clipping" can be due to the ancestor being a [=scroll container=],
1079+
or being clipped to its [=overflow clip edge=]
1080+
(such as by ''overflow: clip'' or [=paint containment=]).
1081+
1082+
Issue: Should any other clipping matter?
1083+
The 'clip'/'clip-path'/'mask' properties?
1084+
''opacity: 0''?
1085+
1086+
Note: This means that if an abspos is next to its anchor in the DOM,
1087+
for example,
1088+
it'll remain visible even if its default anchor is scrolled off,
1089+
since it's clipped by the same scroller anyway.
10701090

1071-
Issue: Make sure this definition of clipped
1072-
is consistent with View Transitions,
1073-
which wants a similar concept.
1091+
Issue: Make sure this definition of clipped
1092+
is consistent with View Transitions,
1093+
which wants a similar concept.
1094+
</div>
10741095

10751096
Making an element <dfn noexport>strongly hidden</dfn>
10761097
makes it act as if it

0 commit comments

Comments
 (0)