Skip to content

fix(40454): allow IntersectionObserverInit.root to accept type Docume… #909

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

Merged
merged 2 commits into from
Oct 5, 2020
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
4 changes: 2 additions & 2 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ interface IntersectionObserverEntryInit {
}

interface IntersectionObserverInit {
root?: Element | null;
root?: Element | Document | null;
rootMargin?: string;
threshold?: number | number[];
}
Expand Down Expand Up @@ -9611,7 +9611,7 @@ declare var InputEvent: {

/** 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. */
interface IntersectionObserver {
readonly root: Element | null;
readonly root: Element | Document | null;
readonly rootMargin: string;
readonly thresholds: ReadonlyArray<number>;
disconnect(): void;
Expand Down
19 changes: 10 additions & 9 deletions inputfiles/idl/Intersection Observer.widl
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
callback IntersectionObserverCallback = undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);

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

[Constructor(IntersectionObserverEntryInit intersectionObserverEntryInit)]
[Exposed=Window]
interface IntersectionObserverEntry {
constructor(IntersectionObserverEntryInit intersectionObserverEntryInit);
readonly attribute DOMHighResTimeStamp time;
readonly attribute DOMRectReadOnly? rootBounds;
readonly attribute DOMRectReadOnly boundingClientRect;
Expand All @@ -34,7 +35,7 @@ dictionary IntersectionObserverEntryInit {
};

dictionary IntersectionObserverInit {
Element? root = null;
(Element or Document)? root = null;
DOMString rootMargin = "0px";
(double or sequence<double>) threshold = 0;
};
2 changes: 1 addition & 1 deletion inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
"title": "Indexed Database"
},
{
"url": "https://www.w3.org/TR/intersection-observer/",
"url": "https://w3c.github.io/IntersectionObserver/",
"title": "Intersection Observer"
},
{
Expand Down