Skip to content

Commit

Permalink
[css-anchor-position] First draft of position-visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Apr 4, 2024
1 parent 9f4280b commit ff62553
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions css-anchor-position-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,82 @@ the ''anchor()'' function resolves to its specified fallback value.
If no fallback value is specified,
it resolves to ''0px''.

Conditional Hiding: the 'position-visibility' property {#position-visibility}
------------------------------------------------------

<pre class=propdef>
Name: position-visibility
Value: always | anchors-valid || anchors-visible || no-overflow
Initial: anchors-visible
Applies to: [=absolutely-positioned=] elements
Percentages: n/a
Inherited: no
Animation type: discrete
</pre>

<dl dfn-type=value dfn-for=position-visibility>
: <dfn>always</dfn>
::
This property has no effect.
(The element is displayed without regard for its anchors
or its overflowing status.)

: <dfn>anchors-valid</dfn>
::
If any of the element's [=required anchor references=]
do not resolve to a [=target anchor element=],
the element is [=strongly hidden=].

Issue: Does misused anchor() count, like ''border-width: anchor(--foo)''?
I assume no, so we'll need to split out the concept of invalid usage
from a valid usage that fails to find an anchor.

Issue: What is a <dfn dfn for>required anchor reference</dfn>?
''anchor()'' functions that don't have a fallback value;
the default anchor *sometimes*?
Need more detail here.

Issue: <em>Any</em> anchors are missing,
or <em>all</em> anchors are missing?
I can see use-cases for either, potentially.
Do we want to make a decision here, or make it controllable somehow?

: <dfn>anchors-visible</dfn>
::
If the element does not have a [=default anchor element=],
or it has a [=default anchor element=]
but the anchor element is [=clipped by scrolling=],
this element is [=strongly hidden=].

Issue: Since only the [=default anchor element=]
triggers scroll-compensation,
it's really the only one that makes sense to condition this on.
Right?

: <dfn>no-overflow</dfn>
::
If the element overflows its [=inset-modified containing block=],
even after applying 'position-try',
then the element is [=strongly hidden=].
</dl>

For the purposes of this property,
an anchor element is <dfn noexport>clipped by scrolling</dfn>
if its [=ink overflow rectangle=]
is fully outside the [=scrollport=]
of one of its scrollable ancestors.

Issue: Make sure this definition of clipped
is consistent with View Transitions,
which wants a similar concept.

Making an element <dfn noexport>strongly hidden</dfn>
makes it act as if it
and all of its descendants
were ''visibility: hidden'',
regardless of what their actual 'visibility' value is.



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

Expand Down

0 comments on commit ff62553

Please sign in to comment.