Re: [csswg-drafts] ResizeObserverEntry either needs to have its JS constructor removed, or define how its members are initialized when constructed (#3946)

Two followup notes:

(1) It looks like this `Constructor(Element target)` IDL dates back to this 2016 commit in the WICG repo:
https://github.com/WICG/ResizeObserver/commit/32515cb4b3732ae9b36439114faa41420c81e2ff#diff-ec9cfa5f3f35ec1f84feb2e59686c34dR145

I suspect Chrome never implemented this constructor, though, so maybe it's not really needed/useful?


(2) Replying to my initial comment here -- things are defined a bit better than I'd thought.   I realized that the spec **does** define what these variables should be initialized to, in the JS-exposed constructor.  e.g.:
```
new ResizeObserverEntry(target)
   [...]
   Set this.borderBoxSize slot to result of computing size
   given target and observedBox of "border-box".
```
https://drafts.csswg.org/resize-observer-1/#dom-resizeobserverentry-resizeobserverentry

So, this means that the JS `var foo = new ResizeObserverEntry(elem)` needs to synchronously flush layout and do a bunch of measurements, which I guess is fine, but do we really need it?

-- 
GitHub Notification of comment by dholbert
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3946#issuecomment-494176266 using your GitHub account

Received on Monday, 20 May 2019 22:44:50 UTC