Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions css-scroll-anchoring-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Abstract: This spec also proposes an API for web developers to opt-out of this b
</pre>

<pre class=link-defaults>
spec:css22;
spec:css-box-3; type:dfn; text:content area
spec:cssom-view-1; type:dfn; text:scrolling area
spec:css2;
type:property;
text:max-height
text:min-height
Expand Down Expand Up @@ -78,7 +80,9 @@ In some cases, a scrolling box may not select any anchor node.
1. If |S| is associated with an element
whose computed value of the 'overflow-anchor' property is ''overflow-anchor/none'',
then do not select an anchor node for |S|.
2. Otherwise, for each DOM child |N| of the element or document associated with |S|,
2. If |S| is not scrolled away from the origin of its <a>scrolling area</a> in its
<a>block flow direction</a>, then do not select an anchor node for |S|.
3. Otherwise, for each DOM child |N| of the element or document associated with |S|,
perform the <a>candidate examination algorithm</a> for |N| in |S|,
and terminate if it selects an anchor node.
</div>
Expand Down Expand Up @@ -110,17 +114,13 @@ In some cases, a scrolling box may not select any anchor node.
content to shift without triggering any scroll anchoring adjustment.
</div>

Conceptually, a new anchor node is computed for every scrolling box
whenever the scroll position of any scrolling box changes.
(As a performance optimization,
the implementation may wait until the anchor node is needed before computing it.)

<div algorithm>
A DOM node |N| is an <dfn>excluded subtree</dfn>
if it is an element and any of the following conditions holds:

* |N|’s computed value of the 'display' property is ''display/none''.
* |N|’s computed value of the 'position' property is ''position/fixed''.
* |N|’s computed value of the 'position' property is ''position/sticky''.
* |N|’s computed value of the 'position' property is ''position/absolute''
and |N|’s <a>containing block</a> is an ancestor of the scrolling box.
* |N|’s computed value of the 'overflow-anchor' property is ''overflow-anchor/none''.
Expand All @@ -147,6 +147,18 @@ the implementation may wait until the anchor node is needed before computing it.
or the bounding rect of its <a>line boxes</a> if |N| is a text node.
</div>

<h4 id='anchor-node-invalidation'>
Invalidation</h3>

An anchor node is considered valid for a <a>scrolling box</a> until any of the following occur:
* The scroll position of the <a>scrolling box</a> changes (excluding adjustments originating from scroll anchoring).
* A <a>suppression trigger</a> suppresses a scroll adjustment.
* The <a>anchor node</a> is removed from the DOM.

Once an anchor node has become invalid, the <a>anchor node selection algorithm</a> must be run again to compute the anchor node

As a performance optimization, implementations may wait until the <a>anchor node</a> is needed before computing it.

<h3 id="scroll-adjustment">
Scroll Adjustment</h3>

Expand Down