<?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>12524</bug_id>
          
          <creation_ts>2011-04-19 23:11:53 +0000</creation_ts>
          <short_desc>It would be nice if you could see the pretty glowing lines</short_desc>
          <delta_ts>2011-08-04 05:03:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML Canvas 2D Context</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#examples</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47558</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-04-19 23:11:53 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Section: http://www.whatwg.org/specs/web-apps/current-work/complete.html#examples

Comment:
It would be nice if you could see the pretty glowing lines

Posted from: 67.180.99.41
User agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47968</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-05-04 18:27:49 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Who can argue with that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47969</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-05-04 18:28:02 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6062.
Check-in comment: by request
http://html5.org/tools/web-apps-tracker?from=6061&amp;to=6062</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47989</commentid>
    <comment_count>3</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-05-04 23:15:01 +0000</bug_when>
    <thetext>Why is it base64-encoded in the source?  That makes me sad.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48002</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-05-04 23:34:21 +0000</bug_when>
    <thetext>What would make you happy?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48125</commentid>
    <comment_count>5</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-05-05 22:56:30 +0000</bug_when>
    <thetext>Not base64-encoding it, so it&apos;s readable in the source.  base64 data URLs are only really needed for binary formats, not HTML.  So just do something like

&lt;a href=&quot;data:text/html,&lt;!DOCTYPE HTML&gt;
&lt;html lang=en&gt;
 &lt;head&gt;
  &lt;title&gt;Pretty Glowing Lines&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
&lt;canvas width=800 height=450&gt;&lt;/canvas&gt;
&lt;script&gt;

 var context = document.getElementsByTagName(&apos;canvas&apos;)[0].getContext(&apos;2d&apos;);

 var lastX = context.canvas.width * Math.random();
 var lastY = context.canvas.height * Math.random();
 var hue = 0;
 function line() {
   context.save();
   context.translate(context.canvas.width/2, context.canvas.height/2);
   context.scale(0.9, 0.9);
   context.translate(-context.canvas.width/2, -context.canvas.height/2);
   context.beginPath();
   context.lineWidth = 5 + Math.random() * 10;
   context.moveTo(lastX, lastY);
   lastX = context.canvas.width * Math.random();
   lastY = context.canvas.height * Math.random();
   context.bezierCurveTo(context.canvas.width * Math.random(),
                         context.canvas.height * Math.random(),
                         context.canvas.width * Math.random(),
                         context.canvas.height * Math.random(),
                         lastX, lastY);

   hue = hue + 10 * Math.random();
   context.strokeStyle = &apos;hsl(&apos; + hue + &apos;, 50%, 50%)&apos;;
   context.shadowColor = &apos;white&apos;;
   context.shadowBlur = 10;
   context.stroke();
   context.restore();
 }
 setInterval(line, 50);

 function blank() {
   context.fillStyle = &apos;rgba(0,0,0,0.1)&apos;;
   context.fillRect(0, 0, context.canvas.width, context.canvas.height);
 }
 setInterval(blank, 40);

&lt;/script&gt;
 &lt;/body&gt;
&lt;/html&gt;&quot;&gt;pretty glowing lines&lt;/a&gt;

Or is that invalid for some reason?  I don&apos;t see why it should be.  It works fine in browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48126</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-05-05 23:10:22 +0000</bug_when>
    <thetext>Pretty sure that&apos;s not a valid URL (for one it has spaces in it). V.nu says

Error: Bad value data:text/html,&lt;!DOCTYPE HTML&gt;... for attribute href on element a: Illegal character in path component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48187</commentid>
    <comment_count>7</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-05-06 16:03:46 +0000</bug_when>
    <thetext>Why should it not be a valid URL, if it works in all browsers (assuming they support data URLs at all in this situation)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48232</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-05-06 20:18:40 +0000</bug_when>
    <thetext>The script is _right there_ in the spec already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48242</commentid>
    <comment_count>9</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-05-06 20:42:35 +0000</bug_when>
    <thetext>Um.  Well, okay, that&apos;s true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52708</commentid>
    <comment_count>10</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:03:46 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>