Skip to content

Commit 137cedd

Browse files
author
Greg Whitworth
committed
[resize-observer] Added updated IDL
1 parent 17ec94f commit 137cedd

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

resize-observer-1/Overview.bs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,27 @@ The ResizeObserver interface is used to observe changes to {{Element}}'s
126126

127127
It is modeled after {{MutationObserver}} and <a>IntersectionObserver</a>.
128128

129+
<pre class="idl">
130+
enum ResizeObserverSizeOptions {
131+
"border-box", "content-box", "scroll-box", "pixel-snapped-box"
132+
};
133+
</pre>
134+
135+
<p class="issue">Is 'pixel-snapped-box' the best name?</p>
136+
137+
<pre class="idl">
138+
dictionary ResizeObserverOptions {
139+
(ResizeObserverSizeOptions or sequence&lt;ResizeObserverSizeOptions>) size = "content-box";
140+
};
141+
</pre>
142+
143+
<p class='issue'>Is size the right name here? It's actually denoting which layout box we want to observe, possibly `box`?</p>
144+
129145
<pre class="idl">
130146
[Exposed=(Window),
131-
Constructor(ResizeObserverCallback callback, DOMString layoutBox)]
147+
Constructor(ResizeObserverCallback callback)]
132148
interface ResizeObserver {
133-
DOMString layoutBox;
134-
void observe(Element target);
149+
void observe(Element target, optional ResizeObserverOptions options);
135150
void unobserve(Element target);
136151
void disconnect();
137152
};
@@ -193,9 +208,12 @@ This callback delivers {{ResizeObserver}}'s notifications. It is invoked by a
193208
interface ResizeObserverEntry {
194209
readonly attribute Element target;
195210
readonly attribute DOMRectReadOnly contentRect;
211+
readonly attribute ResizeObserverSize boxSize;
196212
};
197213
</pre>
198214

215+
<p class="issue">Do we only want to return the box(es) that were requested to be observed, or all?</p>
216+
199217
<div dfn-type="attribute" dfn-for="ResizeObserverEntry">
200218
: <dfn>target</dfn>
201219
::
@@ -212,8 +230,6 @@ interface ResizeObserverEntry {
212230

213231
2. Set |this| {{ResizeObserverEntry/target}} slot to |target|.
214232

215-
3. Set the |layoutBox| to the value provided by the author utilizing the rect of same name for steps 3 and 4.
216-
217233
3. If |target| is not an SVG element do these steps:
218234

219235
1. Set |this|.|layoutBox|.width to |target|.<a>content width</a>.
@@ -234,6 +250,13 @@ interface ResizeObserverEntry {
234250

235251
</div>
236252

253+
<pre class="idl">
254+
interface ResizeObserverSize {
255+
readonly attribute unrestricted double inlineSize;
256+
readonly attribute unrestricted double blockSize;
257+
};
258+
</pre>
259+
237260
<h3 id="resize-observation-interface">ResizeObservation</h3>
238261
ResizeObservation holds observation information for a single {{Element}}. This
239262
interface is not visible to Javascript.

0 commit comments

Comments
 (0)