Skip to content

Add page visibility state functionality #79

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

Merged
merged 5 commits into from
Sep 19, 2022
Merged

Conversation

garyb
Copy link
Member

@garyb garyb commented Sep 19, 2022

Description of the change

Adds type and property for page visibility state, as per https://html.spec.whatwg.org/multipage/interaction.html#page-visibility

Also did a little housekeeping while I was in there.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

Comment on lines 18 to 21
print :: VisibilityState -> String
print = case _ of
Visible -> "loading"
Hidden -> "interactive"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify where this is stated in the doc you referenced?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, shouldn’t this be “hidden” and “visible”? Reading through the spec I didn’t see mention of these wrt visibility state.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahem uhm err, I definitely didn't copy and paste this from ReadyState and forget to update these 🤦‍♂️

@JordanMartinez
Copy link
Contributor

The other commits otherwise look fine.

@garyb
Copy link
Member Author

garyb commented Sep 19, 2022

Thanks for taking a look and spotting that! ❤️

@garyb garyb merged commit c7c2169 into master Sep 19, 2022
@garyb garyb deleted the document-visibility-state branch September 19, 2022 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants