diff --git a/index.bs b/index.bs
index 9018d65..dc2a591 100644
--- a/index.bs
+++ b/index.bs
@@ -219,7 +219,7 @@ interface IntersectionObserver {
constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {});
readonly attribute (Element or Document)? root;
readonly attribute DOMString rootMargin;
- readonly attribute FrozenArray<double> thresholds;
+ attribute ObservableArray<double> thresholds;
undefined observe(Element target);
undefined unobserve(Element target);
undefined disconnect();
@@ -282,12 +282,21 @@ interface IntersectionObserver {
constructor, the value of this attribute is "0px 0px 0px 0px".
: thresholds
::
- A list of thresholds, sorted in increasing numeric order,
+ On getting, returns {{[[thresholds]]}}, which is a list of thresholds,
+ sorted in increasing numeric order,
where each threshold is a ratio of intersection area to bounding box area
of an observed target. Notifications for a target are generated when any
of the thresholds are crossed for that target.
If no |options|.{{IntersectionObserverInit/threshold}} was provided to the
- {{IntersectionObserver}} constructor, the value of this attribute will be [0].
+ {{IntersectionObserver}} constructor,
+ and the {{IntersectionObserver/thresholds}} setter has not been invoked,
+ the value of this attribute will be [0].
+
+ On setting, let |sortedThresholds| be the result of
+ validate and sort a thresholds list for
+ |options|.{{IntersectionObserverInit/threshold}}.
+ If |sortedThresholds| is failure, then throw a {{RangeError}} exception.
+ Otherwise, set |this|'s internal {{[[thresholds]]}} slot to |sortedThresholds|.
The root intersection rectangle
@@ -351,6 +360,15 @@ or failure:
append a duplicate of the second element to |tokens|.
7. Return |tokens|.
+To validate and sort a thresholds list from a list |thresholds|,
+returning either a list or failure:
+
+1. If any value in |thresholds| is less than 0.0 or greater than
+ 1.0, then return failure.
+2. Let |sortedThresholds| be the result of sorting |thresholds| in ascending order.
+3. If |sortedThresholds| is empty, then append 0
to |sortedThresholds|.
+4. Return |sortedThresholds|.
+
0
to |thresholds|.
-8. The {{IntersectionObserver/thresholds}} attribute getter will return
- this sorted |thresholds| list.
-9. Return |this|.
+5. If |sortedThresholds| is failure, then throw a {{RangeError}} exception.
+6. Set |this|'s internal {{[[thresholds]]}} slot to |sortedThresholds|.
+7. Return |this|.
1
if |isIntersecting| is true, or 0
if |isIntersecting| is false.
- 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}}.
+ 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.
11. Let |intersectionObserverRegistration| be the {{IntersectionObserverRegistration}} record
in |target|'s internal {{[[RegisteredIntersectionObservers]]}} slot
whose {{IntersectionObserverRegistration/observer}} property is equal to |observer|.