LibWeb: Exit process_stylesheet_resource if document isn't fully active

This change is required to fix crashing in `link-re-enable-crash.html`
that is going to be introduced by switching to unbuffered fetching.
This commit is contained in:
Aliaksandr Kalenik 2025-11-17 01:26:27 +01:00 committed by Tim Flynn
parent a79c995d8a
commit fa46efae48
Notes: github-actions[bot] 2025-11-20 11:31:30 +00:00

View file

@ -772,6 +772,9 @@ void HTMLLinkElement::process_icon_resource(bool success, Fetch::Infrastructure:
// https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet:process-the-linked-resource
void HTMLLinkElement::process_stylesheet_resource(bool success, Fetch::Infrastructure::Response const& response, ByteBuffer body_bytes)
{
if (!document().is_fully_active())
return;
// 1. If the resource's Content-Type metadata is not text/css, then set success to false.
auto mime_type_string = m_mime_type;
Optional<String> mime_type_charset;