8000 Define Page Visibility in terms of HTML by noamr · Pull Request #7238 · whatwg/html · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Page Visibility in terms of HTML #7238

Merged
merged 1 commit into from
Nov 3, 2021
Merged

Conversation

noamr
Copy link
Collaborator
@noamr noamr commented Oct 18, 2021
  • Expose the necessary attributes in the document WebIDL
  • Define "system visibility state" and document "visibility state"
    to represent the algorithms for updating the visibility
  • Update current reference of "page is in the background" to refer
    to the new definitions.

To fully integrate specs referring to the Page Visibility spec
with the changes in the HTML spec, i.e. defining the visibilitychange
event, the different specs need to be called explicitly when the
visibility of the page changes.

For that, the visibilityState of the document needs to be properly
defined within HTML.

See w3c/page-visibility#74
and w3c/page-visibility#73

(See WHATWG Working Mode: Changes for more details.)


/browsers.html ( diff )
/browsing-the-web.html ( diff )
/dnd.html ( diff )
/dom.html ( diff )
/index.html ( diff )
/interaction.html ( diff )
/references.html ( diff )
/webappapis.html ( diff )

Copy link
Contributor
@yoavweiss yoavweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-authoritative LGTM with a few nits

Copy link
Member
@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@annevk
Copy link
Member
annevk commented Oct 27, 2021

Thanks for working on this! Does 8000 this help with or impact #3957?

@noamr
Copy link
Collaborator Author
noamr commented Oct 27, 2021

Thanks for working on this! Does this help with or impact #3957?

It would probably make #3957 marginally easier to implement
But wouldn't affect it otherwise

Copy link
Member
@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, very nice. I guess we should not merge until w3c/page-visibility#74 is resolved affirmatively? Let us know the latest on that per the TPAC discussions.

It'd be a nice bonus if we followed this up by inverting the device posture/screen orientation/web NFC hooks, maybe with some extra infrastructure since device posture and screen orientation also use "the next animation frame task" which has its own rigor issues. But this is a strict improvement on the status quo and fixing those specs to be perfectly rigorous is probably lower priority than other work you have been doing :).

@noamr
Copy link
Collaborator Author
noamr commented Oct 29, 2021

LGTM, very nice. I guess we should not merge until w3c/page-visibility#74 is resolved affirmatively? Let us know the latest on that per the TPAC discussions.

It was resolved affirmatively at TPAC. @yoavweiss would you please comment on that one?

It'd be a nice bonus if we followed this up by inverting the device posture/screen orientation/web NFC hooks, maybe with some extra infrastructure since device posture and screen orientation also use "the next animation frame task" which has its own rigor issues. But this is a strict improvement on the status quo and fixing those specs to be perfectly rigorous is probably lower priority than other work you have been doing :).

I have opened issues for those specs to do it and I will provide some guidance 😀

Not sure what the thought is about referring to e.g. WebNfc from HTML, when it's a standard that doesn't have implementer consensus. But I will leave it to owners of those specs

@yoavweiss
Copy link
Contributor

It was resolved affirmatively at TPAC. @yoavweiss would you please comment on that one?

Commented. This is fine to merge even though there are still WG mechanics to figure out about the old spec.

Defines the document.hidden and document.visibilityState APIs in the HTML Standard, while improving their definitions to be more rigorous. This is similar to 3285b98 which did the same for the visibilitychange event.

Also updates the discussion of "page is in the background" to refer to the new definitions.

See w3c/page-visibility#74 and w3c/page-visibility#73 for more background.
@marcoscaceres
Copy link
Member

Ooops, we forgot to actually export "visibility state", [=Document/hidden=] and [=Document/visible=]. There are quite a few specs depends on those.

@marcoscaceres
Copy link
Member

Sent #7337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0