Skip to content

Commit ff62553

Browse files
committed
[css-anchor-position] First draft of position-visibility
1 parent 9f4280b commit ff62553

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

css-anchor-position-1/Overview.bs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,82 @@ the ''anchor()'' function resolves to its specified fallback value.
10031003
If no fallback value is specified,
10041004
it resolves to ''0px''.
10051005

1006+
Conditional Hiding: the 'position-visibility' property {#position-visibility}
1007+
------------------------------------------------------
1008+
1009+
<pre class=propdef>
1010+
Name: position-visibility
1011+
Value: always | anchors-valid || anchors-visible || no-overflow
1012+
Initial: anchors-visible
1013+
Applies to: [=absolutely-positioned=] elements
1014+
Percentages: n/a
1015+
Inherited: no
1016+
Animation type: discrete
1017+
</pre>
1018+
1019+
<dl dfn-type=value dfn-for=position-visibility>
1020+
: <dfn>always</dfn>
1021+
::
1022+
This property has no effect.
1023+
(The element is displayed without regard for its anchors
1024+
or its overflowing status.)
1025+
1026+
: <dfn>anchors-valid</dfn>
1027+
::
1028+
If any of the element's [=required anchor references=]
1029+
do not resolve to a [=target anchor element=],
1030+
the element is [=strongly hidden=].
1031+
1032+
Issue: Does misused anchor() count, like ''border-width: anchor(--foo)''?
1033+
I assume no, so we'll need to split out the concept of invalid usage
1034+
from a valid usage that fails to find an anchor.
1035+
1036+
Issue: What is a <dfn dfn for>required anchor reference</dfn>?
1037+
''anchor()'' functions that don't have a fallback value;
1038+
the default anchor *sometimes*?
1039+
Need more detail here.
1040+
1041+
Issue: <em>Any</em> anchors are missing,
1042+
or <em>all</em> anchors are missing?
1043+
I can see use-cases for either, potentially.
1044+
Do we want to make a decision here, or make it controllable somehow?
1045+
1046+
: <dfn>anchors-visible</dfn>
1047+
::
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=].
1052+
1053+
Issue: Since only the [=default anchor element=]
1054+
triggers scroll-compensation,
1055+
it's really the only one that makes sense to condition this on.
1056+
Right?
1057+
1058+
: <dfn>no-overflow</dfn>
1059+
::
1060+
If the element overflows its [=inset-modified containing block=],
1061+
even after applying 'position-try',
1062+
then the element is [=strongly hidden=].
1063+
</dl>
1064+
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+
1071+
Issue: Make sure this definition of clipped
1072+
is consistent with View Transitions,
1073+
which wants a similar concept.
1074+
1075+
Making an element <dfn noexport>strongly hidden</dfn>
1076+
makes it act as if it
1077+
and all of its descendants
1078+
were ''visibility: hidden'',
1079+
regardless of what their actual 'visibility' value is.
1080+
1081+
10061082

10071083
<!-- Big Text: a-size()
10081084

0 commit comments

Comments
 (0)