Skip to content

Commit

Permalink
Remove useless getComputedStyle call. (vercel#27969)
Browse files Browse the repository at this point in the history
See w3c/csswg-drafts#6501 to see how I found this.

This line doesn't recompute layout in browsers, because `"height"` is given as a pseudo-element name rather than a property.

The right way to do what it wants is `getComputedStyle(document.body).height`, but given nobody noticed this (and this is generally never needed, manually triggering layout should never be needed to avoid FOUC) it seems better to keep current behavior and just remove the call.
  • Loading branch information
emilio authored Sep 20, 2021
1 parent 6124e7d commit 05a732e
Showing 1 changed file with 0 additions and 4 deletions.
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')
}

if (input.scroll) {
Expand Down

0 comments on commit 05a732e

Please sign in to comment.