When a link element starts a replacement fetch, the old response body can already have queued its consume-body task. stop_fetch() clears the fetch algorithms for future work, so that late task re-read an empty callback and tripped AK::Function's wrapper assertion. Keep fetch_response_handover() tied to the algorithms object it selected when creating the consume-body steps. Then make HTMLLinkElement apply the HTML stale-resource check explicitly with a fetch generation, so results from superseded link fetches return before processing the resource. Add a text test that replaces a stylesheet data URL and waits for the replacement stylesheet's load event. This covers stale body callbacks and verifies that superseded stylesheet results do not apply. |
||
|---|---|---|
| .. | ||
| Checks.cpp | ||
| Checks.h | ||
| FetchedDataReceiver.cpp | ||
| FetchedDataReceiver.h | ||
| Fetching.cpp | ||
| Fetching.h | ||
| PendingResponse.cpp | ||
| PendingResponse.h | ||
| RefCountedFlag.cpp | ||
| RefCountedFlag.h | ||