Re: [whatwg/fullscreen] Remove nodes from top layer as part of the removing steps (#102)

foolip commented on this pull request.



>  
  <li><p>Let <var>exitDocs</var> be the result of
  <a lt="collect documents to unfullscreen">collecting documents to unfullscreen</a> given
- <var>doc</var>.
+ <var>pendingDoc</var>.

> However, if we don't fullscreen `#outer` at the beginning, removing `document.body` from B would trigger a full unfullscreen, and the event would be solely dispatched to A rather than B.

I guess this is the second case, I didn't notice it was a separate issue before. I think what would happen per the changes now in this PR is that *resize* would be true, but after we've resized B no longer has a fullscreen element and *pendingDoc* is A and *pending* is the iframe in A, so no event fired in B, that's right.

To fully exit fullscreen couldn't fix this case I'm afraid, some bookkeeping would still be needed to remember that B had a fullscreen element and should get a `fullscreenchange` event after the resize.

It is quite tempting to suggest keeping track of the fullscreen element separately from the top layer, or even to revive the old fullscreen element stack. But I don't think that's a good idea, it will open up a new set of corner cases where the two things are out of sync.

There is one approach I haven't really explored yet, something analogous to https://github.com/whatwg/fullscreen/pull/64 but for exiting fullscreen. If we were to decide up front how to manipulate the top layer of each document, and in the async part are able to somehow handle the differences from what we expected the top layers to look like, then at least we ought not fire too *few* fullscreenchange events, although we might still be able to find cases where we'd fire redundant ones.

WDYT, worth trying?

Or should we look for something non-clever that often does the right thing and is known to be broken if you do something too strange?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fullscreen/pull/102#discussion_r165301768

Received on Thursday, 1 February 2018 09:45:25 UTC