Inside a WebWorker context, calling performance.addEventListener throws a generic NS_ERROR_FAILURE
Categories
(Core :: Performance, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: todd, Assigned: smaug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0
Steps to reproduce:
Start a WebWorker with a script, and listen for errors
var worker = new Worker("worker.js");
worker.onerror = function(error) {
console.log(error);
}
Worker.js attempts to listen to an event on the performance:
performance.addEventListener("resourcetimingbufferfull", function(evt) {
console.log("called");
});
Actual results:
error {
bubbles: false
cancelBubble: false
cancelable: true
colno: 0
composed: false
currentTarget: null
defaultPrevented: false
error: null
eventPhase: 0
explicitOriginalTarget: ...
filename: "http://localhost:3000/worker.js"
isTrusted: true
lineno: 8
message: "NS_ERROR_FAILURE: "
originalTarget: Worker { onmessage: null, onmessageerror: null, onerror: null }
returnValue: true
srcElement: Worker { onmessage: null, onmessageerror: null, onerror: null }
target: Worker { onmessage: null, onmessageerror: null, onerror: null }
timeStamp: 149
type: "error"
}
Expected results:
No error should have been recorded, event listener should have been attached.
It does not matter if the event is defined like "resourcetimingbufferfull" or generic like "foobar", they both throw.
Hi Todd,
Thank you for your report.
Could you give us more specific steps so we can reproduce this issue on our end? Do we need to create a js file or can we post the script on the webconsole? If a js file is required, would you mind attaching it to this ticket and add further instructions?
Thanks in advance,
Virginia
Hi @Virgina, sure thing. Here is the recreation steps:
- Create an empty HTML document and host it with a dev webserver
- HTML document contains:
<script>
var worker = new Worker("worker.js");
</script>
- Create a "worker.js" file, hosted with the same webserver. Worker.js contains:
performance.addEventListener("resourcetimingbufferfull", function(evt) {});
- Load the page in Firefox 82.0.2 64bit on MacOS and see it throw unhandled NS_ERROR_FAILURE.
Comment 3•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Performance component deals with performance APIs too.
Assignee | ||
Comment 5•4 years ago
|
||
I think Performance object in worker doesn't ever bind to the global and then
https://searchfox.org/mozilla-central/rev/2efcda6dc74c63863fd8f04a6d9d7ac6b09c7eca/dom/events/DOMEventTargetHelper.cpp#303 fails.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Note, https://bugzilla.mozilla.org/show_bug.cgi?id=1432758 is a separate issue.
Assignee | ||
Comment 7•4 years ago
|
||
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4a4b3955d7aa Inside a WebWorker context, calling performance.addEventListener throws a generic NS_ERROR_FAILURE, r=barret
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/26605 for changes under testing/web-platform/tests
Comment 10•4 years ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•