Skip to content

Commit

Permalink
Refactoring of ImageBitmapOptions
Browse files Browse the repository at this point in the history
This is a prototype taking into account the feedback from
whatwg/html#4248 .

Bug: 983173
Change-Id: I622e10c892a552accd9c4b80c9f453ac9e10ced8
  • Loading branch information
Juanmihd authored and chromium-wpt-export-bot committed Oct 23, 2019
1 parent e68120d commit c86a8b7
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions interfaces/html.idl
Original file line number Diff line number Diff line change
Expand Up @@ -1950,8 +1950,8 @@ interface mixin WindowOrWorkerGlobalScope {
void queueMicrotask(VoidFunction callback);

// ImageBitmap
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional (ImageBitmapOptionsInit or ImageBitmapOptions) options = {});
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional (ImageBitmapOptionsInit or ImageBitmapOptions) options = {});
};
Window includes WindowOrWorkerGlobalScope;
WorkerGlobalScope includes WindowOrWorkerGlobalScope;
Expand Down Expand Up @@ -2057,13 +2057,27 @@ enum PremultiplyAlpha { "none", "premultiply", "default" };
enum ColorSpaceConversion { "none", "default" };
enum ResizeQuality { "pixelated", "low", "medium", "high" };

dictionary ImageBitmapOptions {
ImageOrientation imageOrientation = "none";
PremultiplyAlpha premultiplyAlpha = "default";
ColorSpaceConversion colorSpaceConversion = "default";
[EnforceRange] unsigned long resizeWidth;
[EnforceRange] unsigned long resizeHeight;
ResizeQuality resizeQuality = "low";
dictionary ImageBitmapOptionsInit {
ImageOrientation imageOrientation = "none";
[RuntimeEnabled=CanvasColorManagement] ImageBitmapPixelFormat imagePixelFormat = "default";
PremultiplyAlpha premultiplyAlpha = "default";
ColorSpaceConversion colorSpaceConversion = "default";
[EnforceRange] unsigned long resizeWidth;
[EnforceRange] unsigned long resizeHeight;
ResizeQuality resizeQuality = "low";
};

[
Constructor(optional ImageBitmapOptionsInit init),
Exposed=(Window,Worker)
] interface ImageBitmapOptions {
readonly attribute ImageOrientation imageOrientation;
[RuntimeEnabled=CanvasColorManagement] readonly attribute ImageBitmapPixelFormat imagePixelFormat;
readonly attribute PremultiplyAlpha premultiplyAlpha;
readonly attribute ColorSpaceConversion colorSpaceConversion;
[EnforceRange] readonly attribute unsigned long resizeWidth;
[EnforceRange] readonly attribute unsigned long resizeHeight;
readonly attribute ResizeQuality resizeQuality;
};

callback FrameRequestCallback = void (DOMHighResTimeStamp time);
Expand Down

0 comments on commit c86a8b7

Please sign in to comment.