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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>23809</bug_id>
          
          <creation_ts>2009-02-06 16:35:55 -0800</creation_ts>
          <short_desc>Return CanvasRenderingContext2D instead of DOMObject in IDL to avoid V8 #ifdefs</short_desc>
          <delta_ts>2009-03-02 20:04:18 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Darin Fisher (:fishd, Google)">fishd</reporter>
          <assigned_to name="Darin Fisher (:fishd, Google)">fishd</assigned_to>
          <cc>darin</cc>
    
    <cc>eric</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108764</commentid>
    <comment_count>0</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-06 16:35:55 -0800</bug_when>
    <thetext>Return CanvasRenderingContext2D instead of DOMObject in IDL to avoid V8 #ifdefs

The code generator for JSC and V8 is a bit simpler when the return type of a method matches the actual type in the code.  I know that getContext and getCSSCanvasContext are both spec&apos;d to return DOMObject, but presently our code generators go through some extra steps to force that to mean CanvasRenderingContext2D.  We might as well just change the IDL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108765</commentid>
    <comment_count>1</comment_count>
      <attachid>27432</attachid>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-06 16:44:48 -0800</bug_when>
    <thetext>Created attachment 27432
v1 patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108767</commentid>
    <comment_count>2</comment_count>
      <attachid>27432</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-02-06 16:47:57 -0800</bug_when>
    <thetext>Comment on attachment 27432
v1 patch

Long term, this is wrong. The context could be other classes depending on the passed-in context ID. So we may want to make a different type of change here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108768</commentid>
    <comment_count>3</comment_count>
      <attachid>27432</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-02-06 16:49:53 -0800</bug_when>
    <thetext>Comment on attachment 27432
v1 patch

Agreed.  This would make it impossible to implement Context3D for example (which I figure we&apos;ll eventually do to match moz and opera)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108794</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-06 19:16:18 -0800</bug_when>
    <thetext>Yeah, that&apos;s correct, but we don&apos;t have any Context3D yet.  When we do, we can figure out how to abstract this return value.  Why figure that out now?  Seems like premature effort to me.

My change just moves &quot;hard coded logic&quot; from the code generator into the IDL.  That doesn&apos;t seem like a step back to me :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108795</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-06 19:21:54 -0800</bug_when>
    <thetext>Would you guys prefer if the getContext return type were changed to CanvasRenderingContext instead of CanvasRenderingContext2D?  I could then add a CanvasRenderingContext header that includes the typedef that currently lives in CanvasRenderingContext2D.h.  Would that be better?  I&apos;m striving for avoiding hacks in the code generator :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108808</commentid>
    <comment_count>6</comment_count>
      <attachid>27432</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-02-07 02:11:32 -0800</bug_when>
    <thetext>Comment on attachment 27432
v1 patch

I agree, it&apos;s overkill.  The header with a separate CanvasRenderingContext would be cleanest, but we can solve that when we get a Context3d.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109033</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-09 14:34:02 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/40797

I left the patch as-is.  It turns out that toString() currently returns &quot;[object CanvasRenderingContext2D]&quot;, so the v1 patch also has the property of making the IDL match the JS better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109094</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-10 00:17:40 -0800</bug_when>
    <thetext>Re-opening since Sam didn&apos;t like this fix.

Reverted as:
http://trac.webkit.org/changeset/40810</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111957</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-03-02 20:04:18 -0800</bug_when>
    <thetext>Closing this out in favor of the solution in bug 24311.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>27432</attachid>
            <date>2009-02-06 16:44:48 -0800</date>
            <delta_ts>2009-02-10 00:18:07 -0800</delta_ts>
            <desc>v1 patch</desc>
            <filename>explicit_1.diff</filename>
            <type>text/plain</type>
            <size>2163</size>
            <attacher name="Darin Fisher (:fishd, Google)">fishd</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDQwN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hbnZhc0VsZW1lbnQuaWRsCj09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0t
IGh0bWwvSFRNTENhbnZhc0VsZW1lbnQuaWRsCShyZXZpc2lvbiA0MDczNCkKKysrIGh0bWwvSFRN
TENhbnZhc0VsZW1lbnQuaWRsCSh3b3JraW5nIGNvcHkpCkBAIC0zOCw3ICszOCw3IEBAIG1vZHVs
ZSBodG1sIHsKICAgICAgICAgICAgIHJhaXNlcyhET01FeGNlcHRpb24pOwogCiAjaWYgIWRlZmlu
ZWQoTEFOR1VBR0VfT0JKRUNUSVZFX0MpCi0gICAgICAgIERPTU9iamVjdCBnZXRDb250ZXh0KGlu
IERPTVN0cmluZyBjb250ZXh0SWQpOworICAgICAgICBDYW52YXNSZW5kZXJpbmdDb250ZXh0MkQg
Z2V0Q29udGV4dChpbiBET01TdHJpbmcgY29udGV4dElkKTsKICNlbmRpZgogCiAgICAgfTsK
</data>
<flag name="review"
          id="13266"
          type_id="1"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>