title: WebGL rendering fails when using color buffer
body: <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html&gt;
  
  &lt;body&gt;
  &lt;canvas id ="ctx" width = "300" height = "300"&gt;&lt;/canvas&gt; 
      &lt;script&gt;
          //Getting Webgl Context
  
          var ctx = document.getElementById("ctx");
          var webgl = ctx.getContext("experimental-webgl");
  
          /*Creating Shader*/
  
          //Vertex Code
          var vertexCode =
          'attribute vec3 coordinates;'+
          'attribute vec3 color;'+
          'varying vec3 vColor;'+
          'void main(void) {' +
             ' gl_Position = vec4(coordinates, 1.0);' +
             'vColor = color;'+
          '}';
  
          //Creating Shader Object    
          var vertexShader = webgl.createShader(webgl.VERTEX_SHADER);
  
          //Assigning the Source
          webgl.shaderSource(vertexShader, vertexCode);
  
          //Compiling the Source
          webgl.compileShader(vertexShader);
  
          //Fragment Shader Code 
           var fragmentCode ='precision mediump float;'+
          'varying vec3 vColor;'+
          'void main(void) {'+
             'gl_FragColor = vec4(vColor, 1.);'+
          '}';
  
          //Creating Shader Object    
          var fragmentShader = webgl.createShader(webgl.FRAGMENT_SHADER);
  
          //Assigning the Source
          webgl.shaderSource(fragmentShader, fragmentCode);
  
          //Compiling the Source
          webgl.compileShader(fragmentShader);
  
          //Creating Program to store Shader
          var shaderProgram = webgl.createProgram();
  
          //Attaching the shaders
          webgl.attachShader(shaderProgram, vertexShader);
          webgl.attachShader(shaderProgram, fragmentShader);
  
          //linking the Program
          webgl.linkProgram(shaderProgram);
  
          //using the Program
          webgl.useProgram(shaderProgram);
  
          //Defining geometry
          var vertices = [
          -0.5,0.5,0.0,
          -0.5,-0.5,0.0,
          0.5,-0.5,0.0,
          0.5,0.5,0.0
       ];
  
       var colors = [0,0,1, 1,0,0, 0,1,0, 1,0,1,];
  
       indices = [3,2,1,3,1,0];
  
          //Creating a Buffer
          var VextexBuffer = webgl.createBuffer();
          var IndexBuffer = webgl.createBuffer();
          var colorBuffer = webgl.createBuffer();
  
          //Binding the Buffer
          webgl.bindBuffer(webgl.ARRAY_BUFFER, VextexBuffer);
          webgl.bindBuffer(webgl.ELEMENT_ARRAY_BUFFER, IndexBuffer);
          webgl.bindBuffer(webgl.ARRAY_BUFFER, colorBuffer);
  
          //Buffer Data
          webgl.bufferData(webgl.ARRAY_BUFFER, new Float32Array(vertices), webgl.STATIC_DRAW);
          webgl.bufferData(webgl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), webgl.STATIC_DRAW);
          webgl.bufferData(webgl.ARRAY_BUFFER, new Float32Array(colors), webgl.STATIC_DRAW);
  
          /*Associating the shaders to bufferObject*/
  
          //Getting attribute location
          var coord = webgl.getAttribLocation(shaderProgram,"coordinates");
          var color = webgl.getAttribLocation(shaderProgram, "color");
  
          //pointing an attribute to the currently bound VBO
          webgl.vertexAttribPointer(coord, 3, webgl.FLOAT, false ,0,0);
          webgl.vertexAttribPointer(color, 3, webgl.FLOAT, false ,0,0);
  
          //enabling the attributes
          webgl.enableVertexAttribArray(coord);
          webgl.enableVertexAttribArray(color);
          //Unbind Array
  
  
          /*Drawing the Triangle*/
  
          //Clearing the Colour
          webgl.clearColor(.5,.5,.5,1);
  
          //Enabling the depth test
          webgl.enable(webgl.DEPTH_TEST);
  
          //Clearing colour nuffer bit
          webgl.clear(webgl.COLOR_BUFFER_BIT);
  
          //Setting a viewport
          webgl.viewport(0,0,ctx.width,ctx.height);
  
          //Draw the triangle
              webgl.drawElements(webgl.TRIANGLES,indices.length,webgl.UNSIGNED_SHORT,0);
  
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>If I remove colour buffer and everything related to it, the code runs but with colour buffer, I only see gray canvas, nothing else.</p>
  
  <p>Also Chrome console doesn't show any errors or warnings.
  Please help me.</p>