Skip to content

Commit 7d63748

Browse files
author
Greg Whitworth
committed
[resize-observer] Added layoutBox to resizeObserver method
1 parent 0a5491f commit 7d63748

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

resize-observer-1/Overview.bs

+16-10
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Shortname: resize-observer
44
Level: 1
55
Status: ED
66
Work Status: Exploring
7-
ED: https://drafts.csswg.org/resize-observer-1/
7+
ED: https://drafts.csswg.org/resize-observer/index.html
88
Group: CSSWG
9+
URL: https://drafts.csswg.org/resize-observer/index.html
910
Editor: Greg Whitworth, Microsoft, gwhit@microsoft.com
1011
Former Editor: Aleks Totic, Google, atotic@google.com
1112
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
126127
It is modeled after {{MutationObserver}} and <a>IntersectionObserver</a>.
127128

128129
<pre class="idl">
129-
[Constructor(ResizeObserverCallback callback),
130-
Exposed=Window]
130+
[Exposed=(Window),
131+
Constructor(ResizeObserverCallback callback, DOMString layoutBox)]
131132
interface ResizeObserver {
133+
DOMString layoutBox;
132134
void observe(Element target);
133135
void unobserve(Element target);
134136
void disconnect();
@@ -144,6 +146,8 @@ interface ResizeObserver {
144146

145147
3. Add |this| to {{Document}}'s {{Document/resizeObservers}} slot.
146148

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+
147151
: <dfn method>observe(target)</dfn>
148152
::
149153
Adds target to the list of observed elements.
@@ -208,23 +212,25 @@ interface ResizeObserverEntry {
208212

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

215+
3. Set the |layoutBox| to the value provided by the author utilizing the rect of same name for steps 3 and 4.
216+
211217
3. If |target| is not an SVG element do these steps:
212218

213-
1. Set |this|.contentRect.width to |target|.<a>content width</a>.
219+
1. Set |this|.|layoutBox|.width to |target|.<a>content width</a>.
214220

215-
2. Set |this|.contentRect.height to |target|.<a>content height</a>.
221+
2. Set |this|.|layoutBox|.height to |target|.<a>content height</a>.
216222

217-
3. Set |this|.contentRect.top to |target|.<a>padding top</a>.
223+
3. Set |this|.|layoutBox|.top to |target|.<a>padding top</a>.
218224

219-
4. Set |this|.contentRect.left to |target|.<a>padding left</a>.
225+
4. Set |this|.|layoutBox|.left to |target|.<a>padding left</a>.
220226

221227
4. If |target| is an SVG element do these steps:
222228

223-
1. Set |this|.contentRect.top and |this|.contentRect.left to 0.
229+
1. Set |this|.|layoutBox|.top and |this|.contentRect.left to 0.
224230

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

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

229235
</div>
230236

0 commit comments

Comments
 (0)