When a link element's href changes, the spec expects the callback to check if "el contributes a script-blocking style sheet" (step 6). This check examines current fetch state, which fails when old fetch callbacks run after a new fetch has started. Use FetchController::stop_fetch() instead of abort() to prevent old fetch callbacks from executing entirely. This ensures only the current fetch's callback runs, allowing it to correctly check current state per spec without race conditions.
19 lines
458 B
HTML
19 lines
458 B
HTML
<!doctype html>
|
|
<link id="l" rel="stylesheet" href="initial.css">
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(done => {
|
|
const l = document.getElementById('l');
|
|
|
|
println('Starting parser-created element test...');
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
l.setAttribute('href', `change-${i}.css`);
|
|
}
|
|
|
|
setTimeout(() => {
|
|
println('Survived parser-created element stress test');
|
|
done();
|
|
}, 200);
|
|
});
|
|
</script>
|