script: Implement full logic for script-blocking stylesheets (#41988)

We only implemented the first part (parser_inserted), but
weren't checking any of the other cases.

Testing: WPT
Part of #22715

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2026-01-20 20:15:00 +01:00
committed by GitHub
parent 983482b5f3
commit 6f9a0831bd
6 changed files with 80 additions and 25 deletions

View File

@@ -415,6 +415,12 @@ impl StylesheetOwner for HTMLStyleElement {
self.parser_inserted.get()
}
/// <https://html.spec.whatwg.org/multipage/#the-style-element:implicitly-potentially-render-blocking>
fn potentially_render_blocking(&self) -> bool {
// > A style element is implicitly potentially render-blocking if the element was created by its node document's parser.
self.parser_inserted()
}
fn referrer_policy(&self) -> ReferrerPolicy {
ReferrerPolicy::EmptyString
}