Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,10 @@ interface IIRFilterOptions extends AudioNodeOptions {

interface IntersectionObserverEntryInit {
boundingClientRect: DOMRectInit;
intersectionRatio: number;
intersectionRect: DOMRectInit;
isIntersecting: boolean;
rootBounds: DOMRectInit;
rootBounds: DOMRectInit | null;
target: Element;
time: number;
}
Expand Down Expand Up @@ -9396,7 +9397,7 @@ declare var ImageData: {
interface IntersectionObserver {
readonly root: Element | null;
readonly rootMargin: string;
readonly thresholds: number[];
readonly thresholds: ReadonlyArray<number>;
disconnect(): void;
observe(target: Element): void;
takeRecords(): IntersectionObserverEntry[];
Expand All @@ -9414,7 +9415,7 @@ interface IntersectionObserverEntry {
readonly intersectionRatio: number;
readonly intersectionRect: ClientRect | DOMRect;
readonly isIntersecting: boolean;
readonly rootBounds: ClientRect | DOMRect;
readonly rootBounds: ClientRect | DOMRect | null;
readonly target: Element;
readonly time: number;
}
Expand Down
40 changes: 40 additions & 0 deletions inputfiles/idl/Intersection Observer.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);

[Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
Exposed=Window]
interface IntersectionObserver {
readonly attribute Element? root;
readonly attribute DOMString rootMargin;
readonly attribute FrozenArray<double> thresholds;
void observe(Element target);
void unobserve(Element target);
void disconnect();
sequence<IntersectionObserverEntry> takeRecords();
};

[Constructor(IntersectionObserverEntryInit intersectionObserverEntryInit)]
interface IntersectionObserverEntry {
readonly attribute DOMHighResTimeStamp time;
readonly attribute DOMRectReadOnly? rootBounds;
readonly attribute DOMRectReadOnly boundingClientRect;
readonly attribute DOMRectReadOnly intersectionRect;
readonly attribute boolean isIntersecting;
readonly attribute double intersectionRatio;
readonly attribute Element target;
};

dictionary IntersectionObserverEntryInit {
required DOMHighResTimeStamp time;
required DOMRectInit? rootBounds;
required DOMRectInit boundingClientRect;
required DOMRectInit intersectionRect;
required boolean isIntersecting;
required double intersectionRatio;
required Element target;
};

dictionary IntersectionObserverInit {
Element? root = null;
DOMString rootMargin = "0px";
(double or sequence<double>) threshold = 0;
};
4 changes: 4 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
"url": "https://www.w3.org/TR/IndexedDB-2/",
"title": "Indexed Database"
},
{
"url": "https://www.w3.org/TR/intersection-observer/",
"title": "Intersection Observer"
},
{
"url": "https://www.w3.org/TR/media-source/",
"title": "Media Source Extensions"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"build": "tsc --p ./tsconfig.json && node ./lib/index.js",
"fetch-idl": "npm run build && node ./lib/idlfetcher.js",
"fetch-idl": "tsc --p ./tsconfig.json && node ./lib/idlfetcher.js",
"fetch-mdn": "npm run build && node ./lib/mdnfetcher.js",
"fetch": "echo This could take a few minutes... && npm run fetch-idl && npm run fetch-mdn",
"baseline-accept": "cpx \"generated\\*\" baselines\\",
Expand Down