At a glance
- Stylesheets and synchronous scripts in the head block rendering until they load and run.
- Element render delay, the last part of LCP, grows when rendering is blocked after the LCP image has arrived.
- Rendering cost grows with DOM size, which slows both the first paint and later interactions.
- content-visibility: auto lets the browser skip rendering offscreen sections; pair it with contain-intrinsic-size.
The path from bytes to pixels
- The browser receives HTML and starts building the DOM.
- It finds stylesheets and scripts. Stylesheets must load before the page can render; synchronous scripts stop parsing until they load and run.
- It combines DOM and styles, works out the layout and paints.
- Later, scripts, fonts and images change the page and some of these steps run again.
Each resource that the first render waits for is on the critical path. On a casino page that often includes a large site-wide stylesheet, a framework bundle, an A/B testing script and a font.
What usually blocks casino pages
| Resource | Why it blocks | Fix |
|---|---|---|
| One large CSS file for the whole site | All of it must load before first render | Split by template; keep the first view's CSS small |
| Synchronous scripts in the head | Parsing stops until they run | defer, or move after the content |
| Experiment scripts that hide the page | The page stays blank until the test decides | Server-side experiments, or limit hiding to one element |
| Web fonts for headings | Text waits or reflows when the font arrives | Preload one critical font; choose font-display deliberately |
When the LCP image has downloaded but the browser is still waiting on these resources, the time shows up as element render delay in the LCP breakdown, which web.dev suggests should stay under about 10% of LCP.
Fonts on the critical path
web.dev's font guide notes that the default font-display is block, under which Chromium and Firefox hide text for up to three seconds while the font loads. swap shows fallback text at once but can shift layout when the font arrives; optional uses the web font only if it loads within 100 milliseconds. Preload a critical font sparingly, with the crossorigin attribute, and prefer WOFF2 with subsetting.
DOM size and later work
Rendering does not stop after load. Every filter change, odds update and opened panel triggers style and layout work. web.dev's INP guidance notes that "when a page's DOM is small, rendering work usually finishes quickly", and that cost grows as the DOM gets larger. Casino lobbies that render hundreds of tiles, hidden menus and every category up front carry that cost on every interaction.
Ways to keep the DOM lean:
- Render tiles as they approach the viewport instead of the whole catalog.
- Build menus and modals when they open, not at load.
- Use
content-visibility: autoon long offscreen sections. web.dev explains that such elements gain layout, style and paint containment and that "if the element is off-screen its descendants are not rendered". Give them acontain-intrinsic-sizeso they keep their space. web.dev lists support in Chrome 85, Firefox 125 and Safari 18.
How to analyze the path
- Record a Performance trace in Chrome DevTools on a throttled mobile profile.
- Note every request that starts before first paint and ask whether the first view needs it.
- Check the LCP breakdown for render delay.
- Count DOM nodes on the lobby and compare logged-in and logged-out states.
Questions
Should all CSS be inlined?
Not all of it. Inlining a small amount of first-view CSS can help, but large inline styles cannot be cached between pages. A strict content security policy may also rule inline styles out, as it does on this site.
Is content-visibility safe for accessibility?
web.dev notes offscreen content stays in the accessibility tree. Test with a screen reader, especially for sections with landmarks.
Does server-side rendering fix rendering paths?
It can get content on screen sooner, but hydrating a large page can create long tasks afterward. Measure both LCP and INP.
Sources
- web.dev, Optimize Largest Contentful Paint, last updated March 31, 2025.
- web.dev, Optimize web fonts, last updated November 1, 2023.
- web.dev, Optimize Interaction to Next Paint, last updated September 2, 2025.
- web.dev, content-visibility: the new CSS property that boosts your rendering performance, last updated September 23, 2025.