You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which is initialized by {{IntersectionObserver(callback, options)}}</a>.
510
535
They also have an internal <dfn attribute for=IntersectionObserver>\[[rootMargin]]</dfn> slot
511
-
which is a list of four pixel lengths or percentages.
536
+
which is a list of four pixel lengths or percentages, and
537
+
an internal <dfn attribute for=IntersectionObserver>\[[thresholds]]</dfn> slot
538
+
which is a sorted list of thresholds.
512
539
513
540
<h3 id='algorithms'>
514
541
Algorithms</h2>
@@ -525,15 +552,12 @@ and an {{IntersectionObserverInit}} dictionary |options|, run these steps:
525
552
If a list is returned,
526
553
set |this|'s internal {{[[rootMargin]]}} slot to that.
527
554
Otherwise, <a>throw</a> a {{SyntaxError}} exception.
528
-
4. Let |thresholds| be a list equal to
555
+
4. Let |sortedThresholds| be the result of
556
+
<a>validate and sort a thresholds list</a> for
529
557
|options|.{{IntersectionObserverInit/threshold}}.
530
-
5. If any value in |thresholds| is less than 0.0 or greater than
531
-
1.0, <a>throw</a> a {{RangeError}} exception.
532
-
6. Sort |thresholds| in ascending order.
533
-
7. If |thresholds| is empty, append <code>0</code> to |thresholds|.
534
-
8. The {{IntersectionObserver/thresholds}} attribute getter will return
535
-
this sorted |thresholds| list.
536
-
9. Return |this|.
558
+
5. If |sortedThresholds| is failure, then <a>throw</a> a {{RangeError}} exception.
559
+
6. Set |this|'s internal {{[[thresholds]]}} slot to |sortedThresholds|.
560
+
7. Return |this|.
537
561
538
562
<h4 id='observe-target-element'>Observe a target Element</h4>
539
563
@@ -672,7 +696,7 @@ To <dfn>run the update intersection observations steps</dfn> for a
672
696
zero area).
673
697
9. If |targetArea| is non-zero, let |intersectionRatio| be |intersectionArea| divided by |targetArea|.<br>
674
698
Otherwise, let |intersectionRatio| be <code>1</code> if |isIntersecting| is true, or <code>0</code> if |isIntersecting| is false.
675
-
10. Set |thresholdIndex| to 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}}.
699
+
10. Set |thresholdIndex| to the index of the first entry in |observer|'s internal {{[[thresholds]]}} slot whose value is greater than |intersectionRatio|, or the length of |observer|'s internal {{[[thresholds]]}}slot if |intersectionRatio| is greater than or equal to the last entry in |observer|'s internal {{[[thresholds]]}} slot.
676
700
11. Let |intersectionObserverRegistration| be the {{IntersectionObserverRegistration}} record
677
701
in |target|'s internal {{[[RegisteredIntersectionObservers]]}} slot
678
702
whose {{IntersectionObserverRegistration/observer}} property is equal to |observer|.
0 commit comments