Skip to content

Commit

Permalink
Move scrollMargin details and note to definition section
Browse files Browse the repository at this point in the history
  • Loading branch information
tcaptan-cr committed Sep 28, 2023
1 parent f22fbf4 commit 3d43a1e
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,20 @@ interface IntersectionObserver {
passed to the {{IntersectionObserver}} constructor. If no
{{IntersectionObserverInit/scrollMargin}} was passed to the {{IntersectionObserver}}
constructor, the value of this attribute is "0px 0px 0px 0px".

When calculating a <a>scrollport</a> intersection rectangle for
a <a>same-origin-domain target</a>, the rectangle is expanded
according to the offsets in the {{IntersectionObserver}}’s {{[[scrollMargin]]}} slot
in a manner similar to CSS's 'margin' property,
with the four values indicating the amount the top, right, bottom, and left edges, respectively, are offset by,
with positive lengths indicating an outward offset.
Percentages are resolved relative to the width of the undilated rectangle.

Note: {{IntersectionObserver/scrollMargin}} affects the clipping of <a for="IntersectionObserver">target</a>
by all scrollable ancestors up to and including the <a>intersection root</a>.
Both the {{IntersectionObserver/scrollMargin}} and the {{IntersectionObserver/rootMargin}}
are applied to a scrollable <a>intersection root's</a> rectangle.

: <dfn>thresholds</dfn>
::
A list of thresholds, sorted in increasing numeric order,
Expand Down Expand Up @@ -341,19 +355,6 @@ If a <a for="IntersectionObserver">target</a> {{Element}} is clipped by an ances
<a>intersection root</a>, that clipping is unaffected by
{{IntersectionObserver/rootMargin}}.

When calculating a <a>scrollport</a> intersection rectangle for
a <a>same-origin-domain target</a>, the rectangle is expanded
according to the offsets in the {{IntersectionObserver}}’s {{[[scrollMargin]]}} slot
in a manner similar to CSS's 'margin' property,
with the four values indicating the amount the top, right, bottom, and left edges, respectively, are offset by,
with positive lengths indicating an outward offset.
Percentages are resolved relative to the width of the undilated rectangle.

Note: {{IntersectionObserver/scrollMargin}} affects the clipping of <a for="IntersectionObserver">target</a>
by all scrollable ancestors up to and including the <a>intersection root</a>.
Both the {{IntersectionObserver/scrollMargin}} and the {{IntersectionObserver/rootMargin}}
are applied to a scrollable <a>intersection root's</a> rectangle.

Note: <a>Root intersection rectangle</a> and <a>scrollport</a> intersection rectangles are not affected by
<a>pinch zoom</a> and will report the unadjusted <a>viewport</a>, consistent with the
intent of pinch zooming (to act like a magnifying glass and NOT change layout.)
Expand Down

0 comments on commit 3d43a1e

Please sign in to comment.