WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 116871
Made AudioNode an EventTarget
https://bugs.webkit.org/show_bug.cgi?id=116871
Summary
Made AudioNode an EventTarget
Jer Noble
Reported
2013-05-28 09:15:56 PDT
Made AudioNode an EventTarget
Attachments
Patch
(11.86 KB, patch)
2013-05-28 09:22 PDT
,
Jer Noble
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2013-05-28 09:22:36 PDT
Created
attachment 203061
[details]
Patch
WebKit Commit Bot
Comment 2
2013-05-28 09:24:31 PDT
Attachment 203061
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/webaudio/audionode-expected.txt', u'LayoutTests/webaudio/audionode.html', u'Source/WebCore/ChangeLog', u'Source/WebCore/Modules/webaudio/AudioNode.cpp', u'Source/WebCore/Modules/webaudio/AudioNode.h', u'Source/WebCore/Modules/webaudio/AudioNode.idl', u'Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp', u'Source/WebCore/Modules/webaudio/ScriptProcessorNode.h', u'Source/WebCore/Modules/webaudio/ScriptProcessorNode.idl', u'Source/WebCore/dom/EventTarget.h', u'Source/WebCore/dom/EventTargetFactory.in']" exit_code: 1 Source/WebCore/dom/EventTarget.h:43: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3
2013-05-28 09:29:37 PDT
Comment on
attachment 203061
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=203061&action=review
> Source/WebCore/Modules/webaudio/AudioNode.h:186 > + // EventTarget > + virtual const AtomicString& interfaceName() const OVERRIDE; > + virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; > + virtual EventTargetData* eventTargetData() OVERRIDE { return &m_eventTargetData; } > + virtual EventTargetData* ensureEventTargetData() OVERRIDE { return &m_eventTargetData; }
Could these overrides be private? I can’t think of any reason someone would call these on an AudioNode directly rather than through an EventTarget&, so making them private would be nice.
> Source/WebCore/Modules/webaudio/AudioNode.idl:62 > + void addEventListener(DOMString type, > + EventListener listener, > + optional boolean useCapture); > + > + void removeEventListener(DOMString type, > + EventListener listener, > + optional boolean useCapture); > + > + boolean dispatchEvent(Event evt) > + raises(EventException);
These read better on single lines, to my taste. And I see no reason to name it “evt” instead of event”.
Jer Noble
Comment 4
2013-05-28 09:46:30 PDT
(In reply to
comment #3
)
> (From update of
attachment 203061
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=203061&action=review
> > > Source/WebCore/Modules/webaudio/AudioNode.h:186 > > + // EventTarget > > + virtual const AtomicString& interfaceName() const OVERRIDE; > > + virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; > > + virtual EventTargetData* eventTargetData() OVERRIDE { return &m_eventTargetData; } > > + virtual EventTargetData* ensureEventTargetData() OVERRIDE { return &m_eventTargetData; } > > Could these overrides be private? I can’t think of any reason someone would call these on an AudioNode directly rather than through an EventTarget&, so making them private would be nice.
Yes, these can be moved into private:.
> > Source/WebCore/Modules/webaudio/AudioNode.idl:62 > > + void addEventListener(DOMString type, > > + EventListener listener, > > + optional boolean useCapture); > > + > > + void removeEventListener(DOMString type, > > + EventListener listener, > > + optional boolean useCapture); > > + > > + boolean dispatchEvent(Event evt) > > + raises(EventException); > > These read better on single lines, to my taste. And I see no reason to name it “evt” instead of event”.
Sure thing. Thanks!
Jer Noble
Comment 5
2013-05-28 09:47:37 PDT
(In reply to
comment #4
)
> (In reply to
comment #3
) > > (From update of
attachment 203061
[details]
[details]) > > View in context:
https://bugs.webkit.org/attachment.cgi?id=203061&action=review
> > > > > Source/WebCore/Modules/webaudio/AudioNode.h:186 > > > + // EventTarget > > > + virtual const AtomicString& interfaceName() const OVERRIDE; > > > + virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; > > > + virtual EventTargetData* eventTargetData() OVERRIDE { return &m_eventTargetData; } > > > + virtual EventTargetData* ensureEventTargetData() OVERRIDE { return &m_eventTargetData; } > > > > Could these overrides be private? I can’t think of any reason someone would call these on an AudioNode directly rather than through an EventTarget&, so making them private would be nice. > > Yes, these can be moved into private:.
I take that back. They're called by the wrapper (JSAudioNode) directly, so they need to be public.
> > > Source/WebCore/Modules/webaudio/AudioNode.idl:62 > > > + void addEventListener(DOMString type, > > > + EventListener listener, > > > + optional boolean useCapture); > > > + > > > + void removeEventListener(DOMString type, > > > + EventListener listener, > > > + optional boolean useCapture); > > > + > > > + boolean dispatchEvent(Event evt) > > > + raises(EventException); > > > > These read better on single lines, to my taste. And I see no reason to name it “evt” instead of event”. > > Sure thing. Thanks!
Jer Noble
Comment 6
2013-05-28 10:54:17 PDT
Committed
r150810
: <
http://trac.webkit.org/changeset/150810
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug