Skip to content

Commit f39d774

Browse files
author
Greg Whitworth
committed
[resize-observer] Removed references & algo to device-pixel-border-box until progress is made on the Github issue
1 parent 0f2180f commit f39d774

File tree

1 file changed

+7
-33
lines changed

1 file changed

+7
-33
lines changed

resize-observer-1/Overview.bs

+7-33
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,14 @@ It is modeled after {{MutationObserver}} and {{IntersectionObserver}}.
135135

136136
<pre class="idl">
137137
enum ResizeObserverBoxOptions {
138-
"border-box", "content-box", "device-pixel-border-box"
138+
"border-box", "content-box"
139139
};
140140
</pre>
141141

142142
ResizeObserver can observe different kinds of CSS sizes:
143143

144144
* {{border-box}} : size of <a>box border area</a> as defined in CSS2.
145145
* {{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.
152146

153147
<pre class="idl">
154148
dictionary ResizeObserverOptions {
@@ -197,21 +191,11 @@ interface ResizeObserver {
197191
::
198192
Adds target to the list of observed elements.
199193

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 &lt;canvas&gt; 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>).
209195

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>).
211197

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.
215199

216200
: <dfn method for="ResizeObserver">unobserve(target)</dfn>
217201
::
@@ -251,7 +235,6 @@ interface ResizeObserverEntry {
251235
readonly attribute DOMRectReadOnly contentRect;
252236
readonly attribute ResizeObserverSize borderBoxSize;
253237
readonly attribute ResizeObserverSize contentSize;
254-
readonly attribute ResizeObserverSize devicePixelBorderBoxSize;
255238
};
256239
</pre>
257240

@@ -271,9 +254,6 @@ interface ResizeObserverEntry {
271254
: <dfn>contentSize</dfn>
272255
::
273256
{{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.
277257
</div>
278258

279259
<div dfn-type="method" dfn-for="ResizeObserverEntry">
@@ -289,18 +269,15 @@ interface ResizeObserverEntry {
289269
4. Set |this|.{{ResizeObserverEntry/contentSize}} slot to result of <a href="#calculate-box-size">
290270
computing size given |target| and specificSize of "content-box"</a>.
291271

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}}.
294273

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:
298275

299276
1. Set |this|.|contentRect|.top to |target|.<a>padding top</a>.
300277

301278
2. Set |this|.|contentRect|.left to |target|.<a>padding left</a>.
302279

303-
8. If |target| is an SVG element do these steps:
280+
7. If |target| is an SVG element do these steps:
304281

305282
1. Set |this|.|contentRect|.top and |this|.contentRect.left to 0.
306283

@@ -478,9 +455,6 @@ run these steps:
478455

479456
2. Matching size is |entry|.{{ResizeObserverEntry/contentSize}} if |observation|.{{ResizeObservation/observedBox}} is "content-box"
480457

481-
3. Matching size is |entry|.{{ResizeObserverEntry/devicePixelBorderBoxSize}}
482-
if |observation|.{{ResizeObservation/observedBox}} is "device-pixel-border-box"
483-
484458
4. Set |targetDepth| to the result of <a>calculate depth for node</a> for |observation|.{{ResizeObservation/target}}.
485459

486460
5. Set |shallowestTargetDepth| to |targetDepth| if |targetDepth| < |shallowestTargetDepth|

0 commit comments

Comments
 (0)