@@ -4,8 +4,9 @@ Shortname: resize-observer
4
4
Level : 1
5
5
Status : ED
6
6
Work Status : Exploring
7
- ED : https://drafts.csswg.org/resize-observer-1/
7
+ ED : https://drafts.csswg.org/resize-observer/index.html
8
8
Group : CSSWG
9
+ URL : https://drafts.csswg.org/resize-observer/index.html
9
10
Editor : Greg Whitworth, Microsoft, gwhit@microsoft.com
10
11
Former Editor : Aleks Totic, Google, atotic@google.com
11
12
Abstract : This specification describes an API for observing changes to Element's size.
@@ -126,9 +127,10 @@ The ResizeObserver interface is used to observe changes to {{Element}}'s
126
127
It is modeled after {{MutationObserver}} and <a>IntersectionObserver</a> .
127
128
128
129
<pre class="idl">
129
- [Constructor(ResizeObserverCallback callback ),
130
- Exposed=Window ]
130
+ [Exposed=(Window ),
131
+ Constructor(ResizeObserverCallback callback, DOMString layoutBox) ]
131
132
interface ResizeObserver {
133
+ DOMString layoutBox;
132
134
void observe(Element target);
133
135
void unobserve(Element target);
134
136
void disconnect();
@@ -144,6 +146,8 @@ interface ResizeObserver {
144
146
145
147
3. Add |this| to {{Document}} 's {{Document/resizeObservers}} slot.
146
148
149
+ 4. Set layoutBox to value provided if it is "padding-box", "border-box", "content-box". If the value is not one of these, use the default value of "content-box".
150
+
147
151
: <dfn method>observe(target)</dfn>
148
152
::
149
153
Adds target to the list of observed elements.
@@ -208,23 +212,25 @@ interface ResizeObserverEntry {
208
212
209
213
2. Set |this| {{ResizeObserverEntry/target}} slot to |target|.
210
214
215
+ 3. Set the |layoutBox| to the value provided by the author utilizing the rect of same name for steps 3 and 4.
216
+
211
217
3. If |target| is not an SVG element do these steps:
212
218
213
- 1. Set |this|.contentRect .width to |target|.<a>content width</a> .
219
+ 1. Set |this|.|layoutBox| .width to |target|.<a>content width</a> .
214
220
215
- 2. Set |this|.contentRect .height to |target|.<a>content height</a> .
221
+ 2. Set |this|.|layoutBox| .height to |target|.<a>content height</a> .
216
222
217
- 3. Set |this|.contentRect .top to |target|.<a>padding top</a> .
223
+ 3. Set |this|.|layoutBox| .top to |target|.<a>padding top</a> .
218
224
219
- 4. Set |this|.contentRect .left to |target|.<a>padding left</a> .
225
+ 4. Set |this|.|layoutBox| .left to |target|.<a>padding left</a> .
220
226
221
227
4. If |target| is an SVG element do these steps:
222
228
223
- 1. Set |this|.contentRect .top and |this|.contentRect.left to 0.
229
+ 1. Set |this|.|layoutBox| .top and |this|.contentRect.left to 0.
224
230
225
- 2. Set |this|.contentRect .width to |target|.<a>bounding box</a> .width.
231
+ 2. Set |this|.|layoutBox| .width to |target|.<a>bounding box</a> .width.
226
232
227
- 3. Set |this|.contentRect .height to |target|.<a>bounding box</a> .height.
233
+ 3. Set |this|.|layoutBox| .height to |target|.<a>bounding box</a> .height.
228
234
229
235
</div>
230
236
0 commit comments