ladybird/Libraries/LibWeb/HTML/Parser
Aliaksandr Kalenik b88cbb1b74 LibWeb: Have speculative HTML parser populate the preload map
When the regular HTML parser is blocked on an external script, the
speculative parser scans ahead and pre-fetches discoverable
sub-resources. Previously those fetches were tracked only in the
parser's own URL list and never registered in the document's preload
map, so when the regular parser later reached each element fetch()'s
consume_a_preloaded_resource() lookup found nothing and issued a
duplicate request — every parser-blocked sub-resource was fetched
twice.

issue_speculative_fetch now creates a PreloadEntry, registers it
under create_a_preload_key(request) in the document's preload map,
and supplies a processResponseConsumeBody callback that populates
the entry. The map insertion happens after fetch() starts because
fetch() runs consume_a_preloaded_resource() synchronously, so
registering the entry beforehand would short-circuit the
speculative fetch itself.

The body-handling steps (1, 2, 5 of the preload algorithm's
processResponseConsumeBody) are factored into a shared
deliver_preload_response helper used by both the speculative parser
and HTMLLinkElement::preload.
2026-04-29 15:59:22 +02:00
..
Entities.cpp LibWeb/HTML: Improve data structure of named character reference data 2025-07-14 09:43:08 +02:00
Entities.h LibWeb/HTML: Improve data structure of named character reference data 2025-07-14 09:43:08 +02:00
Entities.json LibWeb: Make named character references more spec-compliant & efficient 2025-03-22 16:03:44 +01:00
HTMLEncodingDetection.cpp LibWeb: Extract some CORS and MIME Fetch helpers to their own files 2025-11-27 14:57:29 +01:00
HTMLEncodingDetection.h LibWeb: Extract some CORS and MIME Fetch helpers to their own files 2025-11-27 14:57:29 +01:00
HTMLParser.cpp LibWeb: Extract HTMLParser::run_until_completion() 2026-04-29 04:12:44 +02:00
HTMLParser.h LibWeb: Add incremental HTML parsing 2026-04-29 04:12:44 +02:00
HTMLToken.cpp LibWeb: Track if element was created from token with dupe attributes 2025-07-09 15:52:54 -06:00
HTMLToken.h LibWeb: Reduce size of Optional<HTMLToken> 2026-03-20 12:03:36 +01:00
HTMLTokenizer.cpp LibWeb: Allow tokenizer to run out of characters mid-tokenization 2026-04-29 04:12:44 +02:00
HTMLTokenizer.h LibWeb: Allow tokenizer to run out of characters mid-tokenization 2026-04-29 04:12:44 +02:00
IncrementalDocumentParser.cpp LibWeb: Add incremental HTML parsing 2026-04-29 04:12:44 +02:00
IncrementalDocumentParser.h LibWeb: Add incremental HTML parsing 2026-04-29 04:12:44 +02:00
ListOfActiveFormattingElements.cpp LibWeb: Keep the tokens in ListOfActiveFormattingElements 2025-10-21 23:36:07 +02:00
ListOfActiveFormattingElements.h LibWeb: Keep the tokens in ListOfActiveFormattingElements 2025-10-21 23:36:07 +02:00
ParserScriptingMode.h LibWeb: Set fragment scripting mode from the context document 2026-04-14 23:01:36 +02:00
SpeculativeHTMLParser.cpp LibWeb: Have speculative HTML parser populate the preload map 2026-04-29 15:59:22 +02:00
SpeculativeHTMLParser.h LibWeb: Implement the speculative HTML parser 2026-04-26 18:48:29 +02:00
SpeculativeMockElement.cpp LibWeb: Implement the speculative HTML parser 2026-04-26 18:48:29 +02:00
SpeculativeMockElement.h LibWeb: Implement the speculative HTML parser 2026-04-26 18:48:29 +02:00
StackOfOpenElements.cpp LibWeb: Add HTMLSelectedContentElement for customizable select 2025-12-12 12:06:24 +00:00
StackOfOpenElements.h LibWeb: Add HTMLSelectedContentElement for customizable select 2025-12-12 12:06:24 +00:00