Closed Bug 2080462 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63456 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=326652

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63456 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63456
Details from upstream follow.

Ahmad Saleem <ahmad.saleem792+github@gmail.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=326652

WebKit export from bug: Setting src to the empty string on a connected script element does not fire an error event

<pre>
Setting src to the empty string on a connected script element does not fire an error event

This patch aligns WebKit with Gecko / Firefox.

The script element's attribute change steps [1] say:

 &quot;If localName is src, value is not null, and element is connected, then
 run the script HTML element post-connection steps, given element.&quot;

ScriptElement::handleSourceAttribute() returned early when the value was
empty rather than null, so setting src to "" on a connected script element
that had not yet started never prepared it, and the error event required by
"If src is the empty string, then queue an element task on the DOM
manipulation task source given el to fire an event named error at el, and
return." was never fired.

Check isNull() instead. SVGScriptElement passes href(), which can be the
empty string when the attribute is removed, so keep its existing behavior by
skipping the call for an empty href.

[1] <a href="https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model">https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model</a>

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=326652">https://bugs.webkit.org/show_bug.cgi?id=326652</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/323200@main">https://commits.webkit.org/323200@main</a>
</pre>

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 5 tests and 1 subtests

Status Summary

Firefox

OK : 1[GitHub] 5[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 2[GitHub] 6[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

TIMEOUT: 2
NOTRUN : 1

Safari

TIMEOUT: 2
NOTRUN : 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.