script: Make stylesheets loaded via <link> elements block the rendering (#39536)

Stylesheets loaded via the `<link>` element should block the rendering
of the page according to the HTML specification [1]. This change makes
it so that they do this and, in addition, we do not take reftest
screenshots until all no element is blocking the rendering.

This change does not add support for the `blocking` attribute of
`<link>`, but that can be added in a follow change. In addition to
fixing a few tests, this change likely makes other tests no longer
intermittent. We will need to watch CI runs after this lands in order to
verify that though.

Testing: This change fixes at least two WPT tests.
Fixes: #26424.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-09-27 15:32:26 +02:00 committed by GitHub
parent 6aa82309c3
commit 55d094a871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 46 additions and 7 deletions

View file

@ -1,3 +0,0 @@
[parser-inserted-stylesheet-link.html]
[Rendering is blocked before render-blocking resources are loaded]
expected: FAIL

View file

@ -1,3 +0,0 @@
[remove-attr-stylesheet-link-keeps-blocking.html]
[Rendering is blocked before render-blocking resources are loaded]
expected: FAIL