Skip to content

Commit 469ba81

Browse files
authored
fix(40454): allow IntersectionObserverInit.root to accept type Docume… (#909)
* fix(40454): update IDL url for Intersection Observer and add type map from undefined to void * Remove change in helpers.ts
1 parent 54b5eb9 commit 469ba81

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

baselines/dom.generated.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ interface IntersectionObserverEntryInit {
611611
}
612612

613613
interface IntersectionObserverInit {
614-
root?: Element | null;
614+
root?: Element | Document | null;
615615
rootMargin?: string;
616616
threshold?: number | number[];
617617
}
@@ -9623,7 +9623,7 @@ declare var InputEvent: {
96239623

96249624
/** provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. */
96259625
interface IntersectionObserver {
9626-
readonly root: Element | null;
9626+
readonly root: Element | Document | null;
96279627
readonly rootMargin: string;
96289628
readonly thresholds: ReadonlyArray<number>;
96299629
disconnect(): void;

inputfiles/idl/Intersection Observer.widl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
1+
callback IntersectionObserverCallback = undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
22

3-
[Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
4-
Exposed=Window]
3+
[Exposed=Window]
54
interface IntersectionObserver {
6-
readonly attribute Element? root;
5+
constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {});
6+
readonly attribute (Element or Document)? root;
77
readonly attribute DOMString rootMargin;
88
readonly attribute FrozenArray<double> thresholds;
9-
void observe(Element target);
10-
void unobserve(Element target);
11-
void disconnect();
9+
undefined observe(Element target);
10+
undefined unobserve(Element target);
11+
undefined disconnect();
1212
sequence<IntersectionObserverEntry> takeRecords();
1313
};
1414

15-
[Constructor(IntersectionObserverEntryInit intersectionObserverEntryInit)]
15+
[Exposed=Window]
1616
interface IntersectionObserverEntry {
17+
constructor(IntersectionObserverEntryInit intersectionObserverEntryInit);
1718
readonly attribute DOMHighResTimeStamp time;
1819
readonly attribute DOMRectReadOnly? rootBounds;
1920
readonly attribute DOMRectReadOnly boundingClientRect;
@@ -34,7 +35,7 @@ dictionary IntersectionObserverEntryInit {
3435
};
3536

3637
dictionary IntersectionObserverInit {
37-
Element? root = null;
38+
(Element or Document)? root = null;
3839
DOMString rootMargin = "0px";
3940
(double or sequence<double>) threshold = 0;
4041
};

inputfiles/idlSources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@
387387
"title": "Indexed Database"
388388
},
389389
{
390-
"url": "https://www.w3.org/TR/intersection-observer/",
390+
"url": "https://w3c.github.io/IntersectionObserver/",
391391
"title": "Intersection Observer"
392392
},
393393
{

0 commit comments

Comments
 (0)