From efe89d87b1ab7b3c4d2bafd9444c78f58a7362fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 18 Oct 2023 12:14:40 +0200 Subject: [PATCH] Fix overflow clipping. Fixes #504. The overflow property clips to padding edges, so IntersectionObserver should match that clip. --- index.bs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 5285634..8ab73a9 100644 --- a/index.bs +++ b/index.bs @@ -58,7 +58,8 @@ urlPrefix: https://heycam.github.io/webidl/ url: #hierarchyrequesterror; type: exception; text: HierarchyRequestError urlPrefix: https://drafts.csswg.org/css-box/ url: #containing-block; type: dfn; text: containing block - url: #content-area; type: dfn; text: content area + url: #padding-area; type: dfn; text: padding area + url: #padding-edge; type: dfn; text: padding edge urlPrefix: https://drafts.csswg.org/css-display/ url: #containing-block-chain; type: dfn; text: containing block chain urlPrefix: http://www.w3.org/TR/css-masking-1/ @@ -307,7 +308,7 @@ interface IntersectionObserver { of this attribute will be [0]. -An {{Element}} is defined as having a content clip if its computed style has overflow properties that cause its content to be clipped to the element's padding edge. +An {{Element}} is defined as having a content clip if its computed style has overflow properties that cause its content to be clipped to the element's padding edge. The root intersection rectangle for an {{IntersectionObserver}} @@ -321,7 +322,7 @@ is the rectangle we'll use to check against the targets.
it's the size of the {{document}}'s viewport (note that this processing step can only be reached if the {{document}} is fully active).
Otherwise, if the intersection root has a content clip, -
it's the element's content area. +
it's the element's padding area.
Otherwise,
it's the result of getting the bounding box for the intersection root.