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

dholbert has just created a new issue for https://github.com/w3c/csswg-drafts:

== ResizeObserverEntry either needs to have its JS constructor removed, or define how its members are initialized when constructed ==
Quoting https://drafts.csswg.org/resize-observer-1/#resize-observer-entry-interface :
```webidl
[Exposed=Window, Constructor(Element target
)]
interface ResizeObserverEntry {
    readonly attribute Element target;
    readonly attribute DOMRectReadOnly contentRect;
    readonly attribute ResizeObserverSize borderBoxSize;
    readonly attribute ResizeObserverSize contentBoxSize;
};
```

Is it really intentional that this interface has a web-exposed constructor? i.e. is it really intended that web content can do `var foo = new ResizeObserverEntry(someElem)`?

If it's not supposed to be web-exposed (and I suspect it's not?), let's remove the `Constructor(...)` from its WebIDL.

Otherwise -- i.e. if the constructor is supposed to be web-exposed -- then the spec needs to explain what the member-variables (contentRect, {border,content}BoxSize) should be initialized to in that scenario.  Right now those members are all defined in terms of the size/rect "...when `ResizeObserverCallback` is invoked" -- but in this case of a JS-constructed ResizeObserverEntry, there is no `ResizeObserverCallback` involved / invoked. There is only a passed-in element.

CC @atotic @gregwhitworth 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3946 using your GitHub account

Received on Monday, 20 May 2019 18:53:17 UTC