From 654b47642fe354a27dbd5485867a85481e2005b1 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 9 Apr 2020 18:21:52 +0200 Subject: [PATCH 1/2] feat: add resize-observer typs --- inputfiles/idl/Resize Observer.widl | 39 +++++++++++++++++++++++++++++ inputfiles/idlSources.json | 4 +++ 2 files changed, 43 insertions(+) create mode 100644 inputfiles/idl/Resize Observer.widl diff --git a/inputfiles/idl/Resize Observer.widl b/inputfiles/idl/Resize Observer.widl new file mode 100644 index 000000000..d7a6d6f27 --- /dev/null +++ b/inputfiles/idl/Resize Observer.widl @@ -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 (sequence entries, ResizeObserver observer); + +[Exposed=Window] +interface ResizeObserverEntry { + readonly attribute Element target; + readonly attribute DOMRectReadOnly contentRect; + readonly attribute sequence borderBoxSize; + readonly attribute sequence contentBoxSize; + readonly attribute sequence 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 lastReportedSizes; +}; diff --git a/inputfiles/idlSources.json b/inputfiles/idlSources.json index da35b2b38..faed73457 100644 --- a/inputfiles/idlSources.json +++ b/inputfiles/idlSources.json @@ -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" From 3ed06f51876b4f843c716eaf21bbf87d600e54f8 Mon Sep 17 00:00:00 2001 From: Manu MA Date: Fri, 3 Jul 2020 20:23:33 +0200 Subject: [PATCH 2/2] Update Resize Observer.widl --- inputfiles/idl/Resize Observer.widl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputfiles/idl/Resize Observer.widl b/inputfiles/idl/Resize Observer.widl index d7a6d6f27..385cdfd31 100644 --- a/inputfiles/idl/Resize Observer.widl +++ b/inputfiles/idl/Resize Observer.widl @@ -14,7 +14,7 @@ interface ResizeObserver { void disconnect(); }; -callback ResizeObserverCallback = void (sequence entries, ResizeObserver observer); +callback ResizeObserverCallback = void (FrozenArray entries, ResizeObserver observer); [Exposed=Window] interface ResizeObserverEntry {