RESOLVED FIXED 62475
Web Worker fails to fire error event when a resource fetch fail.
https://bugs.webkit.org/show_bug.cgi?id=62475
Summary Web Worker fails to fire error event when a resource fetch fail.
David Levin
Reported 2011-06-10 14:05:54 PDT
What steps will reproduce the problem? 1. Load the following HTML page <HTML> <BODY> <script type="text/javascript" language="javascript"> var worker = new Worker("no_exist.js"); worker.addEventListener('error', function(error) { alert("Failed to load resource 1"); }, false); worker.onerror = function(error) { alert("Failed to load resource 2"); }; </script> </BODY> </HTML> What is the expected result? Two alerts should appear (one for each handler)with the messages "Failed to load resource 1" and "Failed to load resource 2" as per the spec per the spec http://www.whatwg.org/specs/web-workers/current-work/#processing-model This works in Firefox. In Chromium db as http://code.google.com/p/chromium/issues/detail?id=85220
Attachments
Patch (3.94 KB, patch)
2011-06-10 14:28 PDT, David Levin
dimich: review+
David Levin
Comment 1 2011-06-10 14:28:50 PDT
Ian 'Hixie' Hickson
Comment 2 2011-06-10 15:00:14 PDT
Actually per spec the order should be 2 then 1, because the spec says: "All event handlers on an object, whether an element or some other object, and whether set to null or to a Function object, must be registered as event listeners on the object when it is created, as if the addEventListener() method on the object's EventTarget interface had been invoked, with the event type (type argument) equal to the type corresponding to the event handler (the event handler event type), the listener set to be a target and bubbling phase listener (useCapture argument set to false), and the event listener itself (listener argument) set to do nothing while the event handler's value is not a Function object, and set to invoke the call() callback of the Function object associated with the event handler otherwise. Note: Event handlers therefore always run before event listeners attached using addEventListener()."
David Levin
Comment 3 2011-06-10 15:02:28 PDT
Comment on attachment 96790 [details] Patch I'll change this test to verify the ordering.
David Levin
Comment 4 2011-06-10 15:18:19 PDT
Comment on attachment 96790 [details] Patch It was a little while since I wrote the test. It does verify the ordering. Of course, it is backwards. I filed bug https://bugs.webkit.org/show_bug.cgi?id=62485 to address this.
Dmitry Titov
Comment 5 2011-06-10 17:07:36 PDT
Comment on attachment 96790 [details] Patch Could you add a comment into the test title with ref to the bug that will fix the order?
David Levin
Comment 6 2011-06-10 17:21:59 PDT
(In reply to comment #5) > (From update of attachment 96790 [details]) > Could you add a comment into the test title with ref to the bug that will fix the order? Done and committed as http://trac.webkit.org/changeset/88579.
Note You need to log in before you can comment on or make changes to this bug.