Allow disabling startup_css for speedtest comparison
What does this MR do and why?
Perf test first tried in gitlab-org/frontend/rfcs#92 (comment 1170201514). Now you can add ?no_startup_css
to a URL to disable startup CSS.
To minimize changes, it disables the stylesheet_link_tag_defer
method, and the startup_css_activation
script block (which adds data-startupcss
attribute to the stylesheets).
waitForCSSLoaded
in startup_css_helper.js still gets loaded, but it will just run & resolve straight away, so I figured it wasn't worth making any changes there.
Screenshots or screen recordings
How to set up and validate locally
- Load pages and confirm I didn't break anything
- Load pages with
?no_startup_css
query param (it doesn't need a value, just to be present)
When startup CSS is disabled, there should be one less style
block in the HTML response for a page. You can confirm that by running this in devtools console document.querySelectorAll('style').forEach(style => console.log(style.innerHTML.length))
(startup CSS is the big one)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.