Bug 767933 part 3. Update our IDL as needed to use unrestricted float/double or [LenientFloat]. r=khuey,bjacob
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 27 Nov 2012 15:32:05 -0500
changeset 114272 935af8796e8fa12184300805d7ad49a720caaff1
parent 114271 c426c6ea5ff73c5ba6e4566cebf22340cb197386
child 114273 4ce2a3b3b08e1baf232fd77b30cb037433ec0647
push id23913
push useremorley@mozilla.com
push dateWed, 28 Nov 2012 17:11:31 +0000
treeherdermozilla-central@17c267a881cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, bjacob
bugs767933
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 767933 part 3. Update our IDL as needed to use unrestricted float/double or [LenientFloat]. r=khuey,bjacob
dom/webidl/CanvasRenderingContext2D.webidl
dom/webidl/Performance.webidl
dom/webidl/WebGLRenderingContext.webidl
--- a/dom/webidl/CanvasRenderingContext2D.webidl
+++ b/dom/webidl/CanvasRenderingContext2D.webidl
@@ -28,54 +28,60 @@ interface CanvasRenderingContext2D {
   readonly attribute HTMLCanvasElement? canvas;
 
   // state
   void save(); // push state on state stack
   void restore(); // pop state stack and restore state
 
   // transformations (default transform is the identity matrix)
 // NOT IMPLEMENTED           attribute SVGMatrix currentTransform;
-  [Throws]
+  [Throws, LenientFloat]
   void scale(double x, double y);
-  [Throws]
+  [Throws, LenientFloat]
   void rotate(double angle);
-  [Throws]
+  [Throws, LenientFloat]
   void translate(double x, double y);
-  [Throws]
+  [Throws, LenientFloat]
   void transform(double a, double b, double c, double d, double e, double f);
-  [Throws]
+  [Throws, LenientFloat]
   void setTransform(double a, double b, double c, double d, double e, double f);
 // NOT IMPLEMENTED  void resetTransform();
 
   // compositing
-           attribute double globalAlpha; // (default 1.0)
+           attribute unrestricted double globalAlpha; // (default 1.0)
            [Throws]
            attribute DOMString globalCompositeOperation; // (default source-over)
 
   // colors and styles (see also the CanvasDrawingStyles interface)
            [GetterThrows]
            attribute any strokeStyle; // (default black)
            [GetterThrows]
            attribute any fillStyle; // (default black)
   [Throws]
   CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
   [Throws]
   CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
   [Throws]
   CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, [TreatNullAs=EmptyString] DOMString repetition);
 
   // shadows
+           [LenientFloat]
            attribute double shadowOffsetX; // (default 0)
+           [LenientFloat]
            attribute double shadowOffsetY; // (default 0)
+           [LenientFloat]
            attribute double shadowBlur; // (default 0)
            attribute DOMString shadowColor; // (default transparent black)
 
   // rects
+  [LenientFloat]
   void clearRect(double x, double y, double w, double h);
+  [LenientFloat]
   void fillRect(double x, double y, double w, double h);
+  [LenientFloat]
   void strokeRect(double x, double y, double w, double h);
 
   // path API (see also CanvasPathMethods)
   void beginPath();
   void fill();
 // NOT IMPLEMENTED  void fill(Path path);
   void stroke();
 // NOT IMPLEMENTED  void stroke(Path path);
@@ -83,34 +89,34 @@ interface CanvasRenderingContext2D {
 // NOT IMPLEMENTED  void drawSystemFocusRing(Path path, Element element);
 // NOT IMPLEMENTED  boolean drawCustomFocusRing(Element element);
 // NOT IMPLEMENTED  boolean drawCustomFocusRing(Path path, Element element);
 // NOT IMPLEMENTED  void scrollPathIntoView();
 // NOT IMPLEMENTED  void scrollPathIntoView(Path path);
   void clip();
 // NOT IMPLEMENTED  void clip(Path path);
 // NOT IMPLEMENTED  void resetClip();
-  boolean isPointInPath(double x, double y);
-// NOT IMPLEMENTED  boolean isPointInPath(Path path, double x, double y);
+  boolean isPointInPath(unrestricted double x, unrestricted double y);
+// NOT IMPLEMENTED  boolean isPointInPath(Path path, unrestricted double x, unrestricted double y);
 
   // text (see also the CanvasDrawingStyles interface)
-  [Throws]
+  [Throws, LenientFloat]
   void fillText(DOMString text, double x, double y, optional double maxWidth);
-  [Throws]
+  [Throws, LenientFloat]
   void strokeText(DOMString text, double x, double y, optional double maxWidth);
   [Throws]
   TextMetrics measureText(DOMString text);
 
   // drawing images
 // NOT IMPLEMENTED           attribute boolean imageSmoothingEnabled; // (default true)
-  [Throws]
+  [Throws, LenientFloat]
   void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double dx, double dy);
-  [Throws]
+  [Throws, LenientFloat]
   void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double dx, double dy, double dw, double dh);
-  [Throws]
+  [Throws, LenientFloat]
   void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
 
   // hit regions
 // NOT IMPLEMENTED  void addHitRegion(HitRegionOptions options);
 
   // pixel manipulation
   [Creator, Throws]
   ImageData createImageData(double sw, double sh);
@@ -130,26 +136,27 @@ interface CanvasRenderingContext2D {
   [Throws]
   attribute object mozCurrentTransformInverse;
 
   attribute DOMString mozFillRule; /* "evenodd", "nonzero" (default) */
 
   [Throws]
   attribute any mozDash; /* default |null| */
 
+  [LenientFloat]
   attribute double mozDashOffset; /* default 0.0 */
 
   [SetterThrows]
   attribute DOMString mozTextStyle;
 
   // image smoothing mode -- if disabled, images won't be smoothed
   // if scaled.
   attribute boolean mozImageSmoothingEnabled;
 
-  boolean mozIsPointInStroke(double x, double y);
+  boolean mozIsPointInStroke(unrestricted double x, unrestricted double y);
 
   // Show the caret if appropriate when drawing
   [ChromeOnly]
   const unsigned long DRAWWINDOW_DRAW_CARET   = 0x01;
   // Don't flush pending layout notifications that could otherwise
   // be batched up
   [ChromeOnly]
   const unsigned long DRAWWINDOW_DO_NOT_FLUSH = 0x02;
@@ -210,46 +217,53 @@ interface CanvasRenderingContext2D {
                            optional unsigned long flags = 0);
 };
 CanvasRenderingContext2D implements CanvasDrawingStyles;
 CanvasRenderingContext2D implements CanvasPathMethods;
 
 [NoInterfaceObject]
 interface CanvasDrawingStyles {
   // line caps/joins
+           [LenientFloat]
            attribute double lineWidth; // (default 1)
            attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
            [GetterThrows]
            attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
+           [LenientFloat]
            attribute double miterLimit; // (default 10)
 
   // dashed lines
-// NOT IMPLEMENTED    void setLineDash(sequence<double> segments); // default empty
+// NOT IMPLEMENTED    [LenientFloat] void setLineDash(sequence<double> segments); // default empty
 // NOT IMPLEMENTED    sequence<double> getLineDash();
-// NOT IMPLEMENTED             attribute double lineDashOffset;
+// NOT IMPLEMENTED             [LenientFloat] attribute double lineDashOffset;
 
   // text
            [SetterThrows]
            attribute DOMString font; // (default 10px sans-serif)
            attribute DOMString textAlign; // "start", "end", "left", "right", "center" (default: "start")
            attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
 };
 
 [NoInterfaceObject]
 interface CanvasPathMethods {
   // shared path API methods
   void closePath();
+  [LenientFloat]
   void moveTo(double x, double y);
+  [LenientFloat]
   void lineTo(double x, double y);
+  [LenientFloat]
   void quadraticCurveTo(double cpx, double cpy, double x, double y);
 
+  [LenientFloat]
   void bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
 
-  [Throws]
+  [Throws, LenientFloat]
   void arcTo(double x1, double y1, double x2, double y2, double radius); 
-// NOT IMPLEMENTED  void arcTo(double x1, double y1, double x2, double y2, double radiusX, double radiusY, double rotation);
+// NOT IMPLEMENTED  [LenientFloat] void arcTo(double x1, double y1, double x2, double y2, double radiusX, double radiusY, double rotation);
 
+  [LenientFloat]
   void rect(double x, double y, double w, double h);
 
-  [Throws]
+  [Throws, LenientFloat]
   void arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean anticlockwise = false); 
-// NOT IMPLEMENTED  void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, boolean anticlockwise);
+// NOT IMPLEMENTED  [LenientFloat] void ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, boolean anticlockwise);
 };
--- a/dom/webidl/Performance.webidl
+++ b/dom/webidl/Performance.webidl
@@ -5,17 +5,16 @@
  *
  * The origin of this IDL file is
  * http://www.w3.org/TR/hr-time/
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-// typedef double DOMHighResTimeStamp;
+typedef double DOMHighResTimeStamp;
 
 interface Performance {
-  // DOMHighResTimeStamp now();
-  double now();
+  DOMHighResTimeStamp now();
 
   readonly attribute PerformanceTiming timing;
   readonly attribute PerformanceNavigation navigation;
 };
--- a/dom/webidl/WebGLRenderingContext.webidl
+++ b/dom/webidl/WebGLRenderingContext.webidl
@@ -31,18 +31,18 @@ typedef short          GLshort;
 typedef long           GLint;
 typedef long           GLsizei;
 typedef long long      GLintptr;
 typedef long long      GLsizeiptr;
 // Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL.
 typedef octet          GLubyte;        /* 'octet' should be an unsigned 8 bit type. */
 typedef unsigned short GLushort;
 typedef unsigned long  GLuint;
-typedef float          GLfloat;
-typedef float          GLclampf;  
+typedef unrestricted float GLfloat;
+typedef unrestricted float GLclampf;  
 
 dictionary WebGLContextAttributes {
     boolean alpha = true;
     boolean depth = true;
     boolean stencil = false;
     boolean antialias = true;
     boolean premultipliedAlpha = true;
     boolean preserveDrawingBuffer = false;
@@ -700,67 +700,67 @@ interface WebGLRenderingContext {
     void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
                        GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException
     [Throws]
     void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
                        GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException
 
     void uniform1f(WebGLUniformLocation? location, GLfloat x);
     void uniform1fv(WebGLUniformLocation? location, Float32Array v);
-    void uniform1fv(WebGLUniformLocation? location, sequence<float> v);
+    void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v);
     void uniform1i(WebGLUniformLocation? location, GLint x);
     void uniform1iv(WebGLUniformLocation? location, Int32Array v);
     void uniform1iv(WebGLUniformLocation? location, sequence<long> v);
     void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
     void uniform2fv(WebGLUniformLocation? location, Float32Array v);
-    void uniform2fv(WebGLUniformLocation? location, sequence<float> v);
+    void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v);
     void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
     void uniform2iv(WebGLUniformLocation? location, Int32Array v);
     void uniform2iv(WebGLUniformLocation? location, sequence<long> v);
     void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
     void uniform3fv(WebGLUniformLocation? location, Float32Array v);
-    void uniform3fv(WebGLUniformLocation? location, sequence<float> v);
+    void uniform3fv(WebGLUniformLocation? location, sequence<GLfloat> v);
     void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
     void uniform3iv(WebGLUniformLocation? location, Int32Array v);
     void uniform3iv(WebGLUniformLocation? location, sequence<long> v);
     void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
     void uniform4fv(WebGLUniformLocation? location, Float32Array v);
-    void uniform4fv(WebGLUniformLocation? location, sequence<float> v);
+    void uniform4fv(WebGLUniformLocation? location, sequence<GLfloat> v);
     void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
     void uniform4iv(WebGLUniformLocation? location, Int32Array v);
     void uniform4iv(WebGLUniformLocation? location, sequence<long> v);
 
     void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, 
                           Float32Array value);
     void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, 
-                          sequence<float> value);
+                          sequence<GLfloat> value);
     void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, 
                           Float32Array value);
     void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, 
-                          sequence<float> value);
+                          sequence<GLfloat> value);
     void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, 
                           Float32Array value);
     void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, 
-                          sequence<float> value);
+                          sequence<GLfloat> value);
 
     void useProgram(WebGLProgram? program);
     void validateProgram(WebGLProgram? program);
 
     void vertexAttrib1f(GLuint indx, GLfloat x);
     void vertexAttrib1fv(GLuint indx, Float32Array values);
-    void vertexAttrib1fv(GLuint indx, sequence<float> values);
+    void vertexAttrib1fv(GLuint indx, sequence<GLfloat> values);
     void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
     void vertexAttrib2fv(GLuint indx, Float32Array values);
-    void vertexAttrib2fv(GLuint indx, sequence<float> values);
+    void vertexAttrib2fv(GLuint indx, sequence<GLfloat> values);
     void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
     void vertexAttrib3fv(GLuint indx, Float32Array values);
-    void vertexAttrib3fv(GLuint indx, sequence<float> values);
+    void vertexAttrib3fv(GLuint indx, sequence<GLfloat> values);
     void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
     void vertexAttrib4fv(GLuint indx, Float32Array values);
-    void vertexAttrib4fv(GLuint indx, sequence<float> values);
+    void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values);
     void vertexAttribPointer(GLuint indx, GLint size, GLenum type, 
                              GLboolean normalized, GLsizei stride, GLintptr offset);
 
     void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
 };
 
 /*[Constructor(DOMString type, optional WebGLContextEventInit eventInit)]
 interface WebGLContextEvent : Event {