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

Remove useless getComputedStyle call. #27969

Merged
merged 4 commits into from
Sep 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/next/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,6 @@ function doRender(input: RenderRouteInfo): Promise<any> {
).forEach((el) => {
el.parentNode!.removeChild(el)
})

// Force browser to recompute layout, which should prevent a flash of
// unstyled content:
getComputedStyle(document.body, 'height')
Copy link
Member

Choose a reason for hiding this comment

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

I still believe we need to force recompute here, or we should at least be very sure we want to get rid of this. It might be introducing some other form of main thread blocking that has an effect.

Can we ship this as getComputedStyle(document.body).height for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why changing behavior? I'm pretty sure in all browsers this is a no-op right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Source: I'm a Mozilla employee, and also a WebKit and Chromium committer)

}

if (input.scroll) {
Expand Down