w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.47k stars 658 forks source link

It is unclear which Document object https://drafts.csswg.org/resize-observer/#ref-for-resizeobserver is talking about #10516

Open smaug---- opened 3 months ago

smaug---- commented 3 months ago

"Add this to Document.[[resizeObservers]] slot."

What is that Document? I assume the idea is to get that from a global, but which global?

emilio commented 3 months ago

Gecko at least uses the current global's document at the point of construction of the observer.

I think that's also what WebKit does given the CurrentDocument here.

Not quite sure what Blink does / what the ScriptState corresponds to there... @chrishtr do you know?

In any case, it seems current on construction is probably the most straight-forward answer here.

This is observable via callback order, cc @Loirooriol

chrishtr commented 3 months ago

Blink uses current global's document also.