Skip to content

[resize-observer-1] Remove JavaScript constructor for ResizeObserverEntry #3946 #4532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions resize-observer-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ This callback delivers {{ResizeObserver}}'s notifications. It is invoked by a
<h3 id="resize-observer-entry-interface">ResizeObserverEntry</h3>

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

<div dfn-type="method" dfn-for="ResizeObserverEntry">
: <dfn constructor lt="ResizeObserverEntry(target)">new ResizeObserverEntry(target)</dfn>
::
1. Let |this| be a new {{ResizeObserverEntry}}.

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

3. Set |this|.{{ResizeObserverEntry/borderBoxSize}} slot to result of <a href="#calculate-box-size">
computing size given |target| and observedBox of "border-box"</a>.

4. Set |this|.{{ResizeObserverEntry/contentBoxSize}} slot to result of <a href="#calculate-box-size">
computing size given |target| and observedBox of "content-box"</a>.

5. Set |this|.{{ResizeObserverEntry/devicePixelContentBoxSize}} slot to result of <a href="#calculate-box-size">
computing size given |target| and observedBox of "device-pixel-content-box"</a>.

6. Set |this|.{{ResizeObserverEntry/contentRect}} to logical |this|.{{ResizeObserverEntry/contentBoxSize}} given |target| and observedBox of "content-box".

7. If |target| is not an SVG element do these steps:

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

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

8. If |target| is an SVG element do these steps:

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

</div>

<pre class="idl">
interface ResizeObserverSize {
readonly attribute unrestricted double inlineSize;
Expand Down Expand Up @@ -456,6 +426,36 @@ To determine if {{Document}} <dfn>has skipped observations</dfn> run these steps

2. return false.

<h4 id="create-and-populate-resizeobserverentry-h">
Create and populate a ResizeObserverEntry
</h4>
To <dfn>create and populate a ResizeObserverEntry</dfn> for a given |target|,
run these steps:
1. Let |this| be a new {{ResizeObserverEntry}}.

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

3. Set |this|.{{ResizeObserverEntry/borderBoxSize}} slot to result of <a href="#calculate-box-size">
computing size given |target| and observedBox of "border-box"</a>.

4. Set |this|.{{ResizeObserverEntry/contentBoxSize}} slot to result of <a href="#calculate-box-size">
computing size given |target| and observedBox of "content-box"</a>.

5. Set |this|.{{ResizeObserverEntry/devicePixelContentBoxSize}} slot to result of <a href="#calculate-box-size">
computing size given |target| and observedBox of "device-pixel-content-box"</a>.

6. Set |this|.{{ResizeObserverEntry/contentRect}} to logical |this|.{{ResizeObserverEntry/contentBoxSize}} given |target| and observedBox of "content-box".

7. If |target| is not an SVG element do these steps:

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

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

8. If |target| is an SVG element do these steps:

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

<h4 id="broadcast-resize-notifications-h">Broadcast active observations</h4>

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

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

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

2. Add |entry| to |entries|.

Expand Down