[whatwg/fullscreen] Remove top layer definitions, now that CSS Position 4 contains them. (PR #223)

Also reword algos as appropriate.

As far as Fullscreen is concerned, this is *almost* a no-op change, as things are merely moving. The only normative change that's relevant here is in the "fullscreen an element" algo, as it's no longer valid to add something to the top layer when it's already there (see next para for details). At the moment I've changed it to simply check if it's already in the top layer and only add if it's not, but this can be changed as necessary. (There are some other changes to the top-layer handling as it exists in Position 4, but they're in response to CSSWG decisions and are being discussed over there.)

The issue with adding something to the top layer that's already there is that, now that we have multiple things interacting with the top layer, they can have complex interactions of their own, and arbitrarily rearranging an element put in the top layer by some other process isn't necessarily safe. For example, a popover can be part of a popover stack, with each attached to the element below. Fullscreening the bottom popover *must not* just move that bottom popover to the end of the top layer and leave the rest of the popovers behind; it has to do *something* else, probably closing the popover (and thus closing its associated stack).

I'm not 100% sure how we want to handle the interaction of these separate features. I *suspect* it'll have to be something like each defining its own "hey you're being removed from the top layer" algo, which the others can invoke before they add the element to the top layer for their own purposes. But this'll need more thought; I went with what I felt was the simplest model for right now, where if you fullscreen something already in the top layer for other reasons, it just gets its flag and that's that.

(This is technically a behavior change per spec, but doesn't appear to be a behavior change in practice, at least in Chrome - if you fullscreen an element, show a modal, then ask to fullscreen the first element again, it *does not* move on top of the dialog, it stays where it is. But opening a dialog *then* fullscreening an element does successfully put the fullscreen over the dialog. I'm having trouble getting Firefox to successfully fullscreen something so I can test this.)

/cc @mfreed7 @josepharhar @nt1m @annevk 

-------

Currently this PR won't build because I'm using a new Bikeshed metadata to ignore the MDN issue; I should have a release out supporting this new metadata either today or tomorrow. (It won't build *without* the metadata either, since it's a fatal error to be missing an MDN anchor, too.).

Potentially we could kill both by keeping the ID in the spec, but just having it explicitly say that the definition has been moved to CSS Position. Would that be better?

More generally, for all the IDs that are being moved to Position, do you want to keep them in the spec with a redirect section?

-------

- [ ] At least two implementers are interested (and none opposed):
   * Chrome
   * ?
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * Not yet, but I'll check if any need to be changed once we accept the normative tweak (or decide on something else).
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: Already Chrome's behavior.
   * Gecko: …
   * WebKit: …
- [x] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: <https://github.com/mdn/content/issues/26191> for redirecting ::backdrop to Position; don't *think* anything else needs tweaking.


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***

### :boom: Error: Server Error :boom: ###

[PR Preview](https://github.com/tobie/pr-preview#pr-preview) failed to build. _(Last tried on Apr 13, 2023, 7:20 PM UTC)_.

<details>
<summary>More</summary>







_If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please [file an issue](https://github.com/tobie/pr-preview/issues/new?title=Error%20not%20surfaced%20properly&body=See%20whatwg/fullscreen%23223.)._
</details>

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/fullscreen/pull/223

-- Commit Summary --

  * Remove top layer definitions, now that CSS Position 4 contains them. Reword algos as appropriate.

-- File Changes --

    M fullscreen.bs (118)

-- Patch Links --

https://github.com/whatwg/fullscreen/pull/223.patch
https://github.com/whatwg/fullscreen/pull/223.diff

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

Message ID: <whatwg/fullscreen/pull/223@github.com>

Received on Thursday, 13 April 2023 19:22:02 UTC