Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/ImageData.idl |
| diff --git a/third_party/WebKit/Source/core/html/ImageData.idl b/third_party/WebKit/Source/core/html/ImageData.idl |
| index 38051b047cbef49ce98acf3098f6448f702079d7..58cca5532a0f580e9235b5681b6c5fc912621284 100644 |
| --- a/third_party/WebKit/Source/core/html/ImageData.idl |
| +++ b/third_party/WebKit/Source/core/html/ImageData.idl |
| @@ -29,7 +29,7 @@ |
| // https://html.spec.whatwg.org/#dom-imagedata |
| // https://github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md#imagedata |
| -enum ImageDataColorSpace { "legacy-srgb", "srgb", "linear-rgb" }; |
| +typedef (Uint8ClampedArray or Uint16Array or Float32Array) ImageDataArray; |
| [ |
| Constructor(unsigned long sw, unsigned long sh), |
| @@ -38,12 +38,18 @@ enum ImageDataColorSpace { "legacy-srgb", "srgb", "linear-rgb" }; |
| RaisesException=Constructor, |
| ] interface ImageData { |
| - [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(unsigned long sw, unsigned long sh, ImageDataColorSpace colorSpace); |
| - [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(Uint8ClampedArray data, unsigned long sw, ImageDataColorSpace colorSpace); |
| - [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(Uint8ClampedArray data, unsigned long sw, unsigned long sh, ImageDataColorSpace colorSpace); |
| + // The following createImageData functions are used instead of the regular constructors |
| + // as currently Blink IDL does not allow to put custom constructors behind a flag |
| + // (crbug.com/672978). These must be replaced with regular constructor declaration |
| + // as specified in the proposal before shipping. |
| + // https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md |
| + |
| + [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(unsigned long sw, unsigned long sh, ImageDataColorSettings imageDataColorSettings); |
| + [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] ImageData createImageData(ImageDataArray data, unsigned long sw, unsigned long sh, ImageDataColorSettings imageDataColorSettings); |
| readonly attribute unsigned long width; |
| readonly attribute unsigned long height; |
| readonly attribute Uint8ClampedArray data; |
| - readonly attribute ImageDataColorSpace colorSpace; |
|
Justin Novosad
2017/03/13 20:00:52
Whoops, looks like this attribute was accidentally
|
| + [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute ImageDataArray dataUnion; |
| + [RuntimeEnabled=ExperimentalCanvasFeatures] readonly attribute ImageDataColorSettings colorSettings; |
| }; |