Bug 85698

Summary: [Worker] The onerror in WorkerContext should have the same parameter with Worker
Product: WebKit Reporter: Li Yin <li.yin>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: abarth, ap, haraken, levin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   

Description Li Yin 2012-05-05 00:08:57 PDT
The Worker can register the onerror event handler like this:
worker.onerror = function (evt) {  //suppose worker is a Worker object
   //evt is a ErrorEvent object.
   ...
}

But in WorkerContext, we must use the onerror like that:
onerror = function (message, filename, lineno) {
   ...
}

It looks very strange.
From Worker spec http://www.w3.org/TR/2012/CR-workers-20120501/#the-global-scope, 
both of them inherit EventTarget, maybe they use the same parameter should be more reasonable.
In addition the test case from Microsoft fails because of this.
http://samples.msdn.microsoft.com/ietestcenter/WebWorkers/WorkerGlobalScope_ErrorEvent_message.htm
Comment 1 David Levin 2012-05-06 02:47:39 PDT
I carefully explained to Microsoft that this test was in error over half a year ago and Travis Leithead <Travis.Leithead@microsoft.com> said "We'll see about getting these updated..."
http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/1502.html

I guess they are still working on that -- too bad that it still flags a correct behavior as being incorrect.

I just replied to that old thread so hopefully they will fix their test which is doing the wrong thing.
Comment 2 Li Yin 2012-05-06 05:59:00 PDT
(In reply to comment #1)
> I carefully explained to Microsoft that this test was in error over half a year ago and Travis Leithead <Travis.Leithead@microsoft.com> said "We'll see about getting these updated..."
> http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/1502.html
> 
> I guess they are still working on that -- too bad that it still flags a correct behavior as being incorrect.
> 
> I just replied to that old thread so hopefully they will fix their test which is doing the wrong thing.

But according to the Worker Spec, there isn't specific definition about the three parameters in onerror event handler.
I don't know why does onerror function in WorkerContext use three parameters?
Maybe use the same form with Worker not Document should be more acceptable.
Does the w3c have this discussion about the parameter in onerror?
Comment 3 David Levin 2012-05-06 11:04:10 PDT
Perhaps you want this: https://bugs.webkit.org/show_bug.cgi?id=36375#c6 
See also where FF fixed their implementation: https://bugzilla.mozilla.org/show_bug.cgi?id=664650

I hope this clarifies. I doubt I'll reply anymore in this bug because
* WebKit follows the spec
* This isn't the forum to change the spec
* I don't think it should be changed at this point, but I'm not the person to convince anyway.
Comment 4 Li Yin 2012-05-06 19:38:37 PDT
(In reply to comment #3)
> Perhaps you want this: https://bugs.webkit.org/show_bug.cgi?id=36375#c6 
> See also where FF fixed their implementation: https://bugzilla.mozilla.org/show_bug.cgi?id=664650
> 
> I hope this clarifies. I doubt I'll reply anymore in this bug because
> * WebKit follows the spec
> * This isn't the forum to change the spec
> * I don't think it should be changed at this point, but I'm not the person to convince anyway.

Okay, thanks for your detailed interpretation and shared information.