Skip to content
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

feat: add resize-observer typs #847

Merged
merged 2 commits into from
Dec 12, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions inputfiles/idl/Resize Observer.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
enum ResizeObserverBoxOptions {
"border-box", "content-box", "device-pixel-content-box"
};

dictionary ResizeObserverOptions {
ResizeObserverBoxOptions box = "content-box";
};

[Exposed=(Window),
Constructor(ResizeObserverCallback callback)]
interface ResizeObserver {
void observe(Element target, optional ResizeObserverOptions options);
void unobserve(Element target);
void disconnect();
};

callback ResizeObserverCallback = void (FrozenArray<ResizeObserverEntry> entries, ResizeObserver observer);

[Exposed=Window]
interface ResizeObserverEntry {
readonly attribute Element target;
readonly attribute DOMRectReadOnly contentRect;
readonly attribute sequence<ResizeObserverSize> borderBoxSize;
readonly attribute sequence<ResizeObserverSize> contentBoxSize;
readonly attribute sequence<ResizeObserverSize> devicePixelContentBoxSize;
};

interface ResizeObserverSize {
readonly attribute unrestricted double inlineSize;
readonly attribute unrestricted double blockSize;
};

[Constructor(Element target)
]
interface ResizeObservation {
readonly attribute Element target;
readonly attribute ResizeObserverBoxOptions observedBox;
readonly attribute sequence<ResizeObserverSize> lastReportedSizes;
};
4 changes: 4 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@
"url": "https://www.w3.org/TR/referrer-policy/",
"title": "Referrer Policy"
},
{
"url": "https://www.w3.org/TR/resize-observer/",
"title": "Resize Observer"
},
{
"url": "https://w3c.github.io/resource-timing/",
"title": "Resource Timing"
Expand Down