Comment on attachment 53408[details]
Fixed build issue for mac
This looks good and I would like to get this landed. My one suggestion would be to put the test in platform independent location (if possible) and just skip it on platforms where this is not implemented (and file bugs for those platforms to implement the feature). You may also want to test that the quality argument does not effect non-jpep MIME types (if possible).
r=me.

(In reply to comment #12)
> (From update of attachment 53408[details])
> This looks good and I would like to get this landed. My one suggestion would
> be to put the test in platform independent location (if possible) and just skip
> it on platforms where this is not implemented (and file bugs for those
> platforms to implement the feature). You may also want to test that the quality
> argument does not effect non-jpep MIME types (if possible).
>
> r=me.
One additional thing that occurred to me was that we may want an illegal value for the default value instead of 1.0. For CG, for instance, the default compression for JPEG would not be 1.0, so we would want to know if no quality argument was passed. Does that seem reasonable. I suggest a value of -1.0 as the default.

(In reply to comment #23)
> Could this be done without custom bindings?
>
> Just take an optional double and then do the equivalent of
>
> if (!(0.0 <= quality && quality <= 1.0))
> quality = 1.0;
>
> in CanvasSurface::toDataURL?
It can't. Just as I said in comment #19, we need to check the real type of quality parameter.