@@ -135,20 +135,14 @@ It is modeled after {{MutationObserver}} and {{IntersectionObserver}}.
135
135
136
136
<pre class="idl">
137
137
enum ResizeObserverBoxOptions {
138
- "border-box", "content-box", "device-pixel-border-box"
138
+ "border-box", "content-box"
139
139
};
140
140
</pre>
141
141
142
142
ResizeObserver can observe different kinds of CSS sizes:
143
143
144
144
* {{border-box}} : size of <a>box border area</a> as defined in CSS2.
145
145
* {{content-box}} : size of <a>content area</a> as defined in CSS2.
146
- * {{device-pixel-border-box}} : border-box size in device pixels.
147
-
148
- {{device-pixel-border-box}} is slightly different from other sizes.
149
- It can only be observed for {{HTMLCanvasElement}} .
150
- It can change even when css has only changed location due to rounding,
151
- because device-pixel sizes are never fractional.
152
146
153
147
<pre class="idl">
154
148
dictionary ResizeObserverOptions {
@@ -197,21 +191,11 @@ interface ResizeObserver {
197
191
::
198
192
Adds target to the list of observed elements.
199
193
200
- 1. If |options|.box is "device-pixel-border-box" and |target|'s interface is not
201
- {{HTMLCanvasElement}} then raise an error.
202
-
203
- 1. Create new {{ErrorEvent}} |error|, with message
204
- "Only <canvas> elements can observe 'device-pixel-border-box' ."
205
-
206
- 2. Report an exception |error|.
207
-
208
- 3. Return.
194
+ 1. If |target| is in {{ResizeObserver/observationTargets}} slot, call unobserve(<var> target</var> ).
209
195
210
- 2. If |target| is in {{ResizeObserver/observationTargets}} slot, call unobserve (<var> target</var> ).
196
+ 2. Let |resizeObservation| be new {{ResizeObservation}} (<var> target</var> , <var> options </var> ).
211
197
212
- 3. Let |resizeObservation| be new {{ResizeObservation}} (<var> target</var> , <var> options</var> ).
213
-
214
- 4. Add the |resizeObservation| to the <var> observationTargets</var> slot.
198
+ 3. Add the |resizeObservation| to the <var> observationTargets</var> slot.
215
199
216
200
: <dfn method for="ResizeObserver">unobserve(target)</dfn>
217
201
::
@@ -251,7 +235,6 @@ interface ResizeObserverEntry {
251
235
readonly attribute DOMRectReadOnly contentRect;
252
236
readonly attribute ResizeObserverSize borderBoxSize;
253
237
readonly attribute ResizeObserverSize contentSize;
254
- readonly attribute ResizeObserverSize devicePixelBorderBoxSize;
255
238
};
256
239
</pre>
257
240
@@ -271,9 +254,6 @@ interface ResizeObserverEntry {
271
254
: <dfn>contentSize</dfn>
272
255
::
273
256
{{Element}} 's <a>content rect</a> size when {{ResizeObserverCallback}} is invoked.
274
- : <dfn>devicePixelBorderBoxSize</dfn>
275
- ::
276
- {{Element}} 's <a>border box</a> size in device pixels when {{ResizeObserverCallback}} is invoked.
277
257
</div>
278
258
279
259
<div dfn-type="method" dfn-for="ResizeObserverEntry">
@@ -289,18 +269,15 @@ interface ResizeObserverEntry {
289
269
4. Set |this|.{{ResizeObserverEntry/contentSize}} slot to result of <a href="#calculate-box-size">
290
270
computing size given |target| and specificSize of "content-box"</a> .
291
271
292
- 5. Set |this|.{{ResizeObserverEntry/devicePixelBorderBoxSize}} slot to result of <a href="#calculate-box-size">
293
- computing size given |target| and specificSize of "device-pixel-border-box"</a> .
272
+ 5. Set |this|.{{ResizeObserverEntry/contentRect}} to logical |this|.{{ResizeObserverEntry/contentSize}} .
294
273
295
- 6. Set |this|.{{ResizeObserverEntry/contentRect}} to logical |this|.{{ResizeObserverEntry/contentSize}} .
296
-
297
- 7. If |target| is not an SVG element do these steps:
274
+ 6. If |target| is not an SVG element do these steps:
298
275
299
276
1. Set |this|.|contentRect|.top to |target|.<a>padding top</a> .
300
277
301
278
2. Set |this|.|contentRect|.left to |target|.<a>padding left</a> .
302
279
303
- 8 . If |target| is an SVG element do these steps:
280
+ 7 . If |target| is an SVG element do these steps:
304
281
305
282
1. Set |this|.|contentRect|.top and |this|.contentRect.left to 0.
306
283
@@ -478,9 +455,6 @@ run these steps:
478
455
479
456
2. Matching size is |entry|.{{ResizeObserverEntry/contentSize}} if |observation|.{{ResizeObservation/observedBox}} is "content-box"
480
457
481
- 3. Matching size is |entry|.{{ResizeObserverEntry/devicePixelBorderBoxSize}}
482
- if |observation|.{{ResizeObservation/observedBox}} is "device-pixel-border-box"
483
-
484
458
4. Set |targetDepth| to the result of <a>calculate depth for node</a> for |observation|.{{ResizeObservation/target}} .
485
459
486
460
5. Set |shallowestTargetDepth| to |targetDepth| if |targetDepth| < |shallowestTargetDepth|
0 commit comments