Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edge case for reporting transitions #316

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
10 changes: 7 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -620,16 +620,20 @@ To <dfn>run the update intersection observations steps</dfn> for a
zero area); otherwise, let |isIntersecting| be false.
8. If |targetArea| is non-zero, let |intersectionRatio| be |intersectionArea| divided by |targetArea|.<br>
Otherwise, let |intersectionRatio| be <code>1</code> if |isIntersecting| is true, or <code>0</code> if |isIntersecting| is false.
9. Let |thresholdIndex| be the index of the first entry in |observer|.{{thresholds}} whose value is greater than |intersectionRatio|, or the length of |observer|.{{thresholds}} if |intersectionRatio| is greater than or equal to the last entry in |observer|.{{thresholds}}.
9. Let |thresholdIndex| be:
* 0 if |intersectionRatio| is less than or equal to the first value in |observer|.{{thresholds}}, or
* the length of |observer|.{{thresholds}} if |intersectionRatio| is greater than or equal to the last value in |observer|.{{thresholds}}, otherwise
* the index of the first value in |observer|.{{thresholds}} whose value is greater than |intersectionRatio|.
10. Let |intersectionObserverRegistration| be the {{IntersectionObserverRegistration}} record
in |target|'s internal {{[[RegisteredIntersectionObservers]]}} slot
whose {{IntersectionObserverRegistration/observer}} property is equal to |observer|.
11. Let |previousThresholdIndex| be the |intersectionObserverRegistration|'s
{{IntersectionObserverRegistration/previousThresholdIndex}} property.
12. Let |previousIsIntersecting| be the |intersectionObserverRegistration|'s
{{IntersectionObserverRegistration/previousIsIntersecting}} property.
13. If |thresholdIndex| does not equal |previousThresholdIndex| or if
|isIntersecting| does not equal |previousIsIntersecting|,
13. If:
* |thresholdIndex| does not equal |previousThresholdIndex| or
* |isIntersecting| does not equal |previousIsIntersecting| and the first value in |observer|.{{thresholds}} is 0
<a>queue an IntersectionObserverEntry</a>,
passing in |observer|, |time|, |rootBounds|,
|boundingClientRect|, |intersectionRect|, |isIntersecting|, and |target|.
Expand Down