<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17408</bug_id>
          
          <creation_ts>2012-06-05 12:37:46 +0000</creation_ts>
          <short_desc>(NodeCreation): Node creation syntax</short_desc>
          <delta_ts>2012-09-10 10:11:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>AudioWG</product>
          <component>Web Audio API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>TBD</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael[tm] Smith">mike</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>mage</cc>
    
    <cc>olivier.thereaux</cc>
    
    <cc>philipj</cc>
    
    <cc>public-audio</cc>
    
    <cc>roc</cc>
          
          <qa_contact name="This bug has no owner yet - up for the taking">dave.null</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68720</commentid>
    <comment_count>0</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2012-06-05 12:37:46 +0000</bug_when>
    <thetext>Audio-ISSUE-26 (NodeCreation): Node creation syntax

http://www.w3.org/2011/audio/track/issues/26

Raised by: Marcus Geelnard
On product: 

Each node has its own create* method on the AudioContext object.

A common way is to use a single method taking a string argument giving the object name and an optional parameter object for object-specific parameters.

Examples: document.createElement() and canvas.getContext().

While semantically similar, using a single create* method is probably preferable over many different create* methods (e.g less namespace pollution, clearer extensibility mechanism and more consistent with other Web interfaces).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68821</commentid>
    <comment_count>1</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-06-07 15:11:46 +0000</bug_when>
    <thetext>Comment from Robert O&apos;Callahan, 15 May 2012,

« I actually think the current set of methods is better. They&apos;re in the AudioContext so namespace pollution isn&apos;t a problem. Adding new methods is a perfectly adequate extension point. canvas.getContext() is a mess and being consistent with it is not a virtue. »</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68870</commentid>
    <comment_count>2</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2012-06-08 09:25:24 +0000</bug_when>
    <thetext>It seems like this provoked roc to blog:

http://robert.ocallahan.org/2012/05/canvas-getcontext-mistake.html

However, MediaStream Processing&apos;s createProcessor looks like it&apos;s repeating the &quot;getContext() mistake&quot;:

https://dvcs.w3.org/hg/audio/raw-file/tip/streams/StreamProcessing.html#mediastream-extensions

That being said, I&apos;m having a hard time forming a strong opinion on this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68872</commentid>
    <comment_count>3</comment_count>
    <who name="Robert O&apos;Callahan (Mozilla)">roc</who>
    <bug_when>2012-06-08 09:43:28 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; It seems like this provoked roc to blog:
&gt; 
&gt; http://robert.ocallahan.org/2012/05/canvas-getcontext-mistake.html

That is germane, but it isn&apos;t what provoked me to blog...

&gt; However, MediaStream Processing&apos;s createProcessor looks like it&apos;s repeating the
&gt; &quot;getContext() mistake&quot;:
&gt; 
&gt; https://dvcs.w3.org/hg/audio/raw-file/tip/streams/StreamProcessing.html#mediastream-extensions

Oops. Hoist by my own petard!

&gt; That being said, I&apos;m having a hard time forming a strong opinion on this issue.

I stand by my blog post.

(In reply to comment #0)
&gt; A common way is to use a single method taking a string argument giving the
&gt; object name and an optional parameter object for object-specific parameters.
&gt; 
&gt; Examples: document.createElement() and canvas.getContext().
&gt; 
&gt; While semantically similar, using a single create* method is probably
&gt; preferable over many different create* methods (e.g less namespace pollution,
&gt; clearer extensibility mechanism and more consistent with other Web interfaces).

document.createElement() is different because there&apos;s an infinite number of different HTML elements you can create, so a finite number of create methods can&apos;t work.

Also, &quot;document&quot; and especially &quot;window&quot; are such large and generic interfaces that adding dozens of new methods to them is undesirable. Canvas elements and AudioContexts don&apos;t have that problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68944</commentid>
    <comment_count>4</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-06-12 06:36:38 +0000</bug_when>
    <thetext>Points taken. I especially agree that as an extension mechanism, checking the presence of an object property is better than having to create an object an check if it succeeded or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73526</commentid>
    <comment_count>5</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-09-10 10:11:22 +0000</bug_when>
    <thetext>No objection since June, closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>