promise-resolution-order.html relies on src=" " firing error; per the spec it fetches the base URL
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- testing
Research direction
Read html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/promise-resolution-order.html and compare its whitespace-only src values with the comment about empty sources. The issue identifies the empty string as the intended value; check the related html/semantics/scripting-1/the-script-element/fetch-src/whitespace-with-base.html test for the spec behavior. Done when the test uses an empty source and reaches t.done().
Written by the indexing model from the issue text.
Description
html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/promise-resolution-order.html inserts two script elements with script.setAttribute('src', ' '). It uses their error events as markers on the DOM manipulation task source, per its comment: "Inserting <script> with an empty source schedules dispatching an 'error' event". The test ends in the second script's error handler.
Three spaces are not an empty src. "Prepare the script element" fires error only when src "is the empty string" (step 3 of its src branch). Any other value is encoding-parsed as a URL. The URL parser strips leading and trailing C0 control or space, so ' ' resolves to the document's base URL. That is the test page itself, which is fetched and run as a classic script. The script fails to parse, so the element gets load, not error, and the test never reaches t.done().
html/semantics/scripting-1/the-script-element/fetch-src/whitespace-with-base.html (d0627f4a50, 2026-11-01) tests exactly this. WebKit changed to that behaviour in 323236@main (https://bugs.webkit.org/show_bug.cgi?id=326654).
wpt.fyi runs aligned at 71b58bb191:
| Run | promise-resolution-order.html | fetch-src/whitespace-with-base.html |
|---|---|---|
| Chrome 158.0.8127.36 stable (5091530419994624) | PASS | FAIL (error fired) |
| Chrome 160.0.8168.0 experimental (5165587534446592) | PASS | FAIL (error fired) |
| Firefox 160.0.1 stable (5102456061820928) | TIMEOUT | PASS |
| Firefox 162.0a1 experimental (5188734707040256) | TIMEOUT | PASS |
| Safari 27.2 stable (5121161130934272) | FAIL (both error events fire; unhandledrejection is missing) |
FAIL (error fired) |
| Safari Technology Preview 256 (5096019650674688) | TIMEOUT | PASS |
So the test can pass only in an engine that treats a whitespace-only src as empty, which contradicts the spec and whitespace-with-base.html.
Suggested fix
Use the empty string, which fires error from the DOM manipulation task source, as the test's comment describes:
script.setAttribute('src', '');
- Dominant language
- HTML
- Stars
- 6.3k
- Forks
- 4.1k
- Avg merge
- 17h 20m
- Merged PRs (30d)
- 841
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from web-platform-tests/wpt
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
web-platform-tests/wpt#65844 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
web-platform-tests/wpt#65836 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
web-platform-tests/wpt#65831 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
web-platform-tests/wpt#65826 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
web-platform-tests/wpt#65823 ·
Maintainers usually reply within 1 day
All issues in web-platform-tests/wpt
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
agent/scanner bug stage/010-actionable
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
torch-spyre/spyre-inference#1849 ·
Maintainers usually reply within 2 days
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day