Skip to content

Commit 227f07d

Browse files
authored
Merge pull request w3c#4532 from dlibby-/resize-observer-remove-ctor
[resize-observer-1] Remove JavaScript constructor for ResizeObserverEntry w3c#3946
2 parents 2779a72 + 6d73cee commit 227f07d

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

resize-observer-1/Overview.bs

+32-32
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ This callback delivers {{ResizeObserver}}'s notifications. It is invoked by a
243243
<h3 id="resize-observer-entry-interface">ResizeObserverEntry</h3>
244244

245245
<pre class="idl">
246-
[Exposed=Window, Constructor(Element target)]
246+
[Exposed=Window]
247247
interface ResizeObserverEntry {
248248
readonly attribute Element target;
249249
readonly attribute DOMRectReadOnly contentRect;
@@ -284,36 +284,6 @@ which will correspond to the dimensions of the first column.
284284
A future version of this spec will extend the returned sequences to contain the per-fragment size information.
285285
</p>
286286

287-
<div dfn-type="method" dfn-for="ResizeObserverEntry">
288-
: <dfn constructor lt="ResizeObserverEntry(target)">new ResizeObserverEntry(target)</dfn>
289-
::
290-
1. Let |this| be a new {{ResizeObserverEntry}}.
291-
292-
2. Set |this|.{{ResizeObserverEntry/target}} slot to |target|.
293-
294-
3. Set |this|.{{ResizeObserverEntry/borderBoxSize}} slot to result of <a href="#calculate-box-size">
295-
computing size given |target| and observedBox of "border-box"</a>.
296-
297-
4. Set |this|.{{ResizeObserverEntry/contentBoxSize}} slot to result of <a href="#calculate-box-size">
298-
computing size given |target| and observedBox of "content-box"</a>.
299-
300-
5. Set |this|.{{ResizeObserverEntry/devicePixelContentBoxSize}} slot to result of <a href="#calculate-box-size">
301-
computing size given |target| and observedBox of "device-pixel-content-box"</a>.
302-
303-
6. Set |this|.{{ResizeObserverEntry/contentRect}} to logical |this|.{{ResizeObserverEntry/contentBoxSize}} given |target| and observedBox of "content-box".
304-
305-
7. If |target| is not an SVG element do these steps:
306-
307-
1. Set |this|.|contentRect|.top to |target|.<a>padding top</a>.
308-
309-
2. Set |this|.|contentRect|.left to |target|.<a>padding left</a>.
310-
311-
8. If |target| is an SVG element do these steps:
312-
313-
1. Set |this|.|contentRect|.top and |this|.contentRect.left to 0.
314-
315-
</div>
316-
317287
<pre class="idl">
318288
interface ResizeObserverSize {
319289
readonly attribute unrestricted double inlineSize;
@@ -456,6 +426,36 @@ To determine if {{Document}} <dfn>has skipped observations</dfn> run these steps
456426

457427
2. return false.
458428

429+
<h4 id="create-and-populate-resizeobserverentry-h">
430+
Create and populate a ResizeObserverEntry
431+
</h4>
432+
To <dfn>create and populate a ResizeObserverEntry</dfn> for a given |target|,
433+
run these steps:
434+
1. Let |this| be a new {{ResizeObserverEntry}}.
435+
436+
2. Set |this|.{{ResizeObserverEntry/target}} slot to |target|.
437+
438+
3. Set |this|.{{ResizeObserverEntry/borderBoxSize}} slot to result of <a href="#calculate-box-size">
439+
computing size given |target| and observedBox of "border-box"</a>.
440+
441+
4. Set |this|.{{ResizeObserverEntry/contentBoxSize}} slot to result of <a href="#calculate-box-size">
442+
computing size given |target| and observedBox of "content-box"</a>.
443+
444+
5. Set |this|.{{ResizeObserverEntry/devicePixelContentBoxSize}} slot to result of <a href="#calculate-box-size">
445+
computing size given |target| and observedBox of "device-pixel-content-box"</a>.
446+
447+
6. Set |this|.{{ResizeObserverEntry/contentRect}} to logical |this|.{{ResizeObserverEntry/contentBoxSize}} given |target| and observedBox of "content-box".
448+
449+
7. If |target| is not an SVG element do these steps:
450+
451+
1. Set |this|.|contentRect|.top to |target|.<a>padding top</a>.
452+
453+
2. Set |this|.|contentRect|.left to |target|.<a>padding left</a>.
454+
455+
8. If |target| is an SVG element do these steps:
456+
457+
1. Set |this|.|contentRect|.top and |this|.contentRect.left to 0.
458+
459459
<h4 id="broadcast-resize-notifications-h">Broadcast active observations</h4>
460460

461461
<dfn>broadcast active observations</dfn> delivers all active observations
@@ -474,7 +474,7 @@ run these steps:
474474

475475
3. For each |observation| in {{ResizeObserver/activeTargets}} perform these steps:
476476

477-
1. Let |entry| be new {{ResizeObserverEntry}}(|observation|.target)
477+
1. Let |entry| be the result of running <a>create and populate a {{ResizeObserverEntry}}</a> given |observation|.{{ResizeObservation/target}}.
478478

479479
2. Add |entry| to |entries|.
480480

0 commit comments

Comments
 (0)