-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Don't rely on the pagereveal event in lcp/image-upscaling.html #56629
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
Conversation
|
cc @gsnedders, @smfr, @shaseley could you review this one? Thanks! |
gsnedders
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like the re-run of the Safari job to complete to make sure this is fine, but my only real comment here is the indentation is off.
After the changes in web-platform-tests#56018 this test started to rely on `pagereveal` since the way we load the popup has changed. `pagereveal` is a new event type that's not implemented by every browsers yet and this test is for lcp rather than the CSS view transitions, so we shouldn't rely on that. On the other hand, if a browser doesn't expose the `pageshow` event it means that this is a sync `about:blank`, so the document should be immediately ready. That's why checking `popup.document.readyState` is simple and effective enough. Tested it with all major browsers and it seems like it's passing in all of them. Once Firefox lands the synchronous `about:blank` changes it would be good to remove this code all together.
c6594c3 to
7aba0d9
Compare
canova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Safari failure seems unrelated since it failed in the before case too. I rebased the PR on top of the recent master branch now. Let's see if it's going to be different.
But I tested this manually on Safari and it was passing there.
Yeah, the original run ran into an infrastructure issue, hence both before/after failing. The re-run looked fine, as does the run after rebasing. Anyhow, r+'d now. |
After the changes in #56018 this test started to rely on
pagerevealsince the way we load the popup has changed.pagerevealis a new event type that's not implemented by every browsers yet and this test is for lcp rather than the CSS view transitions, so we shouldn't rely on that.On the other hand, if a browser doesn't expose the
pageshowevent it means that this is a syncabout:blank, so the document should be immediately ready. That's why checkingpopup.document.readyStateis simple and effective enough.Tested it with all major browsers and it seems like it's passing in all of them.
Once Firefox lands the synchronous
about:blankchanges it would be good to remove this code all together.Fixes #56620.