Bug 27516 - Add onerror to WorkerContext.
Summary: Add onerror to WorkerContext.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jian Li
URL:
Keywords:
Depends on:
Blocks: 27518
  Show dependency treegraph
 
Reported: 2009-07-21 13:54 PDT by Jian Li
Modified: 2009-07-21 16:01 PDT (History)
1 user (show)

See Also:


Attachments
Proposed Patch (2.88 KB, patch)
2009-07-21 14:11 PDT, Jian Li
levin: review-
Details | Formatted Diff | Diff
Proposed Patch (2.64 KB, patch)
2009-07-21 15:27 PDT, Jian Li
levin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jian Li 2009-07-21 13:54:01 PDT
Add onerror to WorkerContext.
Comment 1 Jian Li 2009-07-21 14:11:40 PDT
Created attachment 33214 [details]
Proposed Patch
Comment 2 Jian Li 2009-07-21 14:45:32 PDT
This is to adhere to the latest Web Worker spec (http://www.whatwg.org/specs/web-workers/current-work/#workerglobalscope):
  interface WorkerGlobalScope {
      ...
      attribute Function onerror;
  };

I will have other patches that will trigger onerror.
Comment 3 David Levin 2009-07-21 15:12:11 PDT
Comment on attachment 33214 [details]
Proposed Patch

Just a few things to clean up.


> diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h

> +        RefPtr<EventListener> m_onErrorListener;

Should be "m_onerrorListener" because onerror seems to consistently treated as one word.



> diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
>  #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
> -                 attribute [Replaceable] WorkerContext self;
> +        attribute [Replaceable] WorkerContext self;

Don't unindent these.  The idl formatting leaves room for "readonly " when it isn't present which is why these are indented to this level.

>  #endif
> -                 attribute [Replaceable] WorkerLocation location;
> +        attribute [Replaceable] WorkerLocation location;

Same unindenting comment.

>          void close();
> -        //         attribute EventListener onerror;
> +        attribute EventListener onerror;

Just uncomment but indent correctly.
Comment 4 Jian Li 2009-07-21 15:27:22 PDT
Created attachment 33218 [details]
Proposed Patch