Update web-platform-tests to revision d8b8e0b8efe993a37404d6c6fc75e16fdc16b7d8

This commit is contained in:
WPT Sync Bot 2018-10-25 21:32:39 -04:00
parent abc0f50d20
commit e07315e6af
221 changed files with 7334 additions and 774 deletions

View file

@ -0,0 +1,4 @@
[createImageBitmap-blob-invalidtype.html]
[createImageBitmap: blob with wrong mime type]
expected: FAIL

View file

@ -1,5 +1,5 @@
[createImageBitmap-invalid-args.html]
bug: https://github.com/servo/servo/issues/12973#issuecomment-241551718
bug: https://github.com/servo/servo/issues/12973
expected: TIMEOUT
[createImageBitmap with a HTMLImageElement source and sw set to 0 rejects with a RangeError.]
expected: FAIL
@ -247,3 +247,102 @@
[createImageBitmap with a an HTMLVideoElement from a data URL source and oversized (unallocatable) crop region]
expected: FAIL
[createImageBitmap with a vector HTMLImageElement source and sw set to 0]
expected: FAIL
[createImageBitmap with an HTMLCanvasElement source and sw set to 0]
expected: FAIL
[createImageBitmap with a vector HTMLImageElement source and oversized (unallocatable) crop region]
expected: FAIL
[createImageBitmap with a Blob source and sw set to 0]
expected: NOTRUN
[createImageBitmap with an HTMLVideoElement source and sh set to 0]
expected: FAIL
[createImageBitmap with a vector HTMLImageElement source and sh set to 0]
expected: FAIL
[createImageBitmap with a Blob source and sh set to 0]
expected: NOTRUN
[createImageBitmap with an HTMLVideoElement from a data URL source and sw set to 0]
expected: FAIL
[createImageBitmap with an ImageData source and sh set to 0]
expected: NOTRUN
[createImageBitmap with an HTMLVideoElement from a data URL source and oversized (unallocatable) crop region]
expected: FAIL
[createImageBitmap with an HTMLVideoElement source and sw set to 0]
expected: FAIL
[createImageBitmap with a vector SVGImageElement source and oversized (unallocatable) crop region]
expected: NOTRUN
[createImageBitmap with an HTMLCanvasElement source and oversized (unallocatable) crop region]
expected: FAIL
[createImageBitmap with an ImageBitmap source and oversized (unallocatable) crop region]
expected: NOTRUN
[createImageBitmap with an HTMLVideoElement source and oversized (unallocatable) crop region]
expected: FAIL
[createImageBitmap with a bitmap HTMLImageElement source and sh set to 0]
expected: FAIL
[createImageBitmap with an ImageData source and sw set to 0]
expected: NOTRUN
[createImageBitmap with an OffscreenCanvas source and sh set to 0]
expected: NOTRUN
[createImageBitmap with an OffscreenCanvas source and sw set to 0]
expected: NOTRUN
[createImageBitmap with an HTMLVideoElement from a data URL source and sh set to 0]
expected: FAIL
[createImageBitmap with an ImageData source and oversized (unallocatable) crop region]
expected: NOTRUN
[createImageBitmap with a bitmap SVGImageElement source and oversized (unallocatable) crop region]
expected: NOTRUN
[createImageBitmap with a vector SVGImageElement source and sh set to 0]
expected: NOTRUN
[createImageBitmap with an HTMLCanvasElement source and sh set to 0]
expected: FAIL
[createImageBitmap with a bitmap HTMLImageElement source and oversized (unallocatable) crop region]
expected: FAIL
[createImageBitmap with a bitmap SVGImageElement source and sw set to 0]
expected: TIMEOUT
[createImageBitmap with an ImageBitmap source and sh set to 0]
expected: NOTRUN
[createImageBitmap with a vector SVGImageElement source and sw set to 0]
expected: NOTRUN
[createImageBitmap with a Blob source and oversized (unallocatable) crop region]
expected: NOTRUN
[createImageBitmap with a bitmap SVGImageElement source and sh set to 0]
expected: NOTRUN
[createImageBitmap with an ImageBitmap source and sw set to 0]
expected: NOTRUN
[createImageBitmap with a bitmap HTMLImageElement source and sw set to 0]
expected: FAIL
[createImageBitmap with an OffscreenCanvas source and oversized (unallocatable) crop region]
expected: NOTRUN

View file

@ -0,0 +1,5 @@
[canvas-colorManaged-convertToBlob-roundtrip.html]
expected: ERROR
[Test canvas convertToBlob(): mimeType: image/png, blobPixelFormat: uint8, source color space: srgb, pixel format: uint8, alpha: 0.5]
expected: NOTRUN

View file

@ -0,0 +1,5 @@
[canvas-colorManaged-toBlob-toDataURL.html]
expected: ERROR
[Test if toBlob() respects legacy behavior in color managed canvas: ImageFormat: image/jpeg, source color space: srgb, pixel format: uint8, alpha: 0.5]
expected: NOTRUN

View file

@ -0,0 +1,19 @@
[canvas-colorspace-arguments.html]
[Test supported color settings srgb/float16]
expected: FAIL
[Test CanvasPixelFormat value uint8]
expected: FAIL
[Test CanvasColorSpace value srgb]
expected: FAIL
[Test default context creation parameters: srgb/uint8]
expected: FAIL
[Test CanvasPixelFormat value float16]
expected: FAIL
[Test supported color settings srgb/uint8]
expected: FAIL

View file

@ -0,0 +1,35 @@
[canvas-createImageBitmap-e_srgb.html]
expected: ERROR
[createImageBitmap in e-sRGB from a transparent e-sRGB HTMLCanvasElement with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from color managed Blob with resize. blobPixelFormat: uint8, transparency: false]
expected: NOTRUN
[createImageBitmap in e-sRGB from an opaque sRGB HTMLCanvasElement with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from an opaque sRGB HTMLImageElement (BMP, GIF, ICO, JPG, PNG, WEBP) with resize.]
expected: FAIL
[createImageBitmap in e-sRGB from a transparent sRGB HTMLCanvasElement with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from a sRGB SVG image with resize.]
expected: TIMEOUT
[createImageBitmap in e-sRGB from a transparent sRGB HTMLImageElement (BMP, ICO, PNG, WEBP) with resize.]
expected: FAIL
[createImageBitmap in e-sRGB from a transparent sRGB Blob with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from a sRGB HTMLVideoElement with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from an opaque e-sRGB HTMLCanvasElement with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from an opaque sRGB Blob with resize.]
expected: NOTRUN

View file

@ -0,0 +1,31 @@
[canvas-createPutGetImageData-colorManaged.html]
[Test color managed putImageData: {srgb, uint16} -> {srgb, uint8}]
expected: FAIL
[Test color managed cretateImageData: {srgb, float16} -> {srgb, float32}]
expected: FAIL
[Test color managed putImageData: {srgb, float32} -> {srgb, uint8}]
expected: FAIL
[Test color managed getImageData: {srgb, float16} -> {srgb, float32}]
expected: FAIL
[Test color managed putImageData: {srgb, uint16} -> {srgb, float16}]
expected: FAIL
[Test color managed putImageData: {srgb, uint8} -> {srgb, uint8}]
expected: FAIL
[Test color managed putImageData: {srgb, float32} -> {srgb, float16}]
expected: FAIL
[Test color managed cretateImageData: {srgb, uint8} -> {srgb, uint8}]
expected: FAIL
[Test color managed putImageData: {srgb, uint8} -> {srgb, float16}]
expected: FAIL
[Test color managed getImageData: {srgb, uint8} -> {srgb, uint8}]
expected: FAIL

View file

@ -0,0 +1,122 @@
[canvas-draw-high-bit-depth-images.html]
expected: ERROR
[Canvas color params: srgb, float16. Testing 2x2_8bit_Rec2020_opaque.png vs 2x2_16bit_Rec2020_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_ProPhoto_opaque.png vs 2x2_16bit_interlaced_ProPhoto_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_sRGB_opaque.png vs 2x2_16bit_sRGB_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_DisplayP3_opaque.png vs 2x2_16bit_DisplayP3_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_sRGB_transparent.png vs 2x2_16bit_sRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_DisplayP3_transparent.png vs 2x2_16bit_interlaced_DisplayP3_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_ProPhoto_opaque.png vs 2x2_16bit_ProPhoto_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_ProPhoto_transparent.png vs 2x2_16bit_interlaced_ProPhoto_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_AdobeRGB_transparent.png vs 2x2_16bit_interlaced_AdobeRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_DisplayP3_transparent.png vs 2x2_16bit_DisplayP3_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_DisplayP3_opaque.png vs 2x2_16bit_interlaced_DisplayP3_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_ProPhoto_opaque.png vs 2x2_16bit_ProPhoto_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_Rec2020_transparent.png vs 2x2_16bit_Rec2020_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_AdobeRGB_opaque.png vs 2x2_16bit_AdobeRGB_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_AdobeRGB_opaque.png vs 2x2_16bit_interlaced_AdobeRGB_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_ProPhoto_transparent.png vs 2x2_16bit_interlaced_ProPhoto_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_Rec2020_transparent.png vs 2x2_16bit_interlaced_Rec2020_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_ProPhoto_transparent.png vs 2x2_16bit_ProPhoto_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_AdobeRGB_transparent.png vs 2x2_16bit_AdobeRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_AdobeRGB_transparent.png vs 2x2_16bit_interlaced_AdobeRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_sRGB_opaque.png vs 2x2_16bit_interlaced_sRGB_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_DisplayP3_transparent.png vs 2x2_16bit_interlaced_DisplayP3_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_sRGB_opaque.png vs 2x2_16bit_sRGB_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_AdobeRGB_opaque.png vs 2x2_16bit_interlaced_AdobeRGB_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_AdobeRGB_transparent.png vs 2x2_16bit_AdobeRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_Rec2020_opaque.png vs 2x2_16bit_interlaced_Rec2020_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_Rec2020_opaque.png vs 2x2_16bit_interlaced_Rec2020_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_DisplayP3_opaque.png vs 2x2_16bit_interlaced_DisplayP3_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_Rec2020_transparent.png vs 2x2_16bit_interlaced_Rec2020_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_ProPhoto_transparent.png vs 2x2_16bit_ProPhoto_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_DisplayP3_opaque.png vs 2x2_16bit_DisplayP3_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_Rec2020_transparent.png vs 2x2_16bit_Rec2020_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_DisplayP3_transparent.png vs 2x2_16bit_DisplayP3_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_sRGB_transparent.png vs 2x2_16bit_sRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_sRGB_transparent.png vs 2x2_16bit_interlaced_sRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_AdobeRGB_opaque.png vs 2x2_16bit_AdobeRGB_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_Rec2020_opaque.png vs 2x2_16bit_Rec2020_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_ProPhoto_opaque.png vs 2x2_16bit_interlaced_ProPhoto_opaque.png]
expected: TIMEOUT
[Canvas color params: srgb, uint8. Testing 2x2_8bit_sRGB_transparent.png vs 2x2_16bit_interlaced_sRGB_transparent.png]
expected: TIMEOUT
[Canvas color params: srgb, float16. Testing 2x2_8bit_sRGB_opaque.png vs 2x2_16bit_interlaced_sRGB_opaque.png]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[canvas-drawImage-e_srgb.html]
[Draw SRGB image on an e-sRGB canvas and read back the e-sRGB pixels.]
expected: FAIL

View file

@ -0,0 +1,13 @@
[canvas-drawImage-offscreenCanvas.html]
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, uint8; OffscreenCanvas color params: srgb, float16]
expected: FAIL
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, float16; OffscreenCanvas color params: srgb, float16]
expected: FAIL
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, float16; OffscreenCanvas color params: srgb, uint8]
expected: FAIL
[Test drawing color managed OffscreenCanvas: Canvas color params: srgb, uint8; OffscreenCanvas color params: srgb, uint8]
expected: FAIL

View file

@ -0,0 +1,13 @@
[canvas-getImageData-e_srgb.html]
[tests putting and getting in-range e-sRGB image data on e-sRGB canvas.]
expected: FAIL
[tests putting SRGB image data on e-sRGB canvas and getting e-sRGB image data.]
expected: FAIL
[tests putting and getting out-of-range e-sRGB image data on e-sRGB canvas.]
expected: FAIL
[tests drawing SRGB color on e-sRGB canvas and getting e-sRGB image data.]
expected: FAIL

View file

@ -0,0 +1,4 @@
[imageData-colorManagedBehavior.html]
[imageData-colorManagedBehavior]
expected: FAIL

View file

@ -0,0 +1,19 @@
[imageData-colorSpace.html]
[Test default color space: {undefined, float32} -> {srgb, float32}]
expected: FAIL
[Test color settings: {srgb, uint8}]
expected: FAIL
[Test color settings: {srgb, float32}]
expected: FAIL
[Test color settings: {srgb, uint16}]
expected: FAIL
[Test default color settings: {undefined, undefined} -> {srgb, uint8}]
expected: FAIL
[Test default storage format: {srgb, undefined} -> {srgb, uint8}]
expected: FAIL

View file

@ -0,0 +1,7 @@
[imagedata-no-color-settings-crash.html]
[Putting a uint-16 ImageData with no color settings on a context 2D should not crash.]
expected: FAIL
[Putting a float-32 ImageData with no color settings on a context 2D should not crash.]
expected: FAIL

View file

@ -0,0 +1,25 @@
[transferFromImageBitmap.html]
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: float16, alpha: 0.5, intermediate color space: default]
expected: FAIL
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: uint8, alpha: 0.5, intermediate color space: none]
expected: FAIL
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: uint8, alpha: 0.5, intermediate color space: default]
expected: FAIL
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: float16, alpha: 0.5, intermediate color space: none]
expected: FAIL
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: uint8, alpha: 1, intermediate color space: none]
expected: FAIL
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: float16, alpha: 1, intermediate color space: default]
expected: FAIL
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: float16, alpha: 1, intermediate color space: none]
expected: FAIL
[Testing ImageBitmapRenderingContext: Source color space: srgb, pixel format: uint8, alpha: 1, intermediate color space: default]
expected: FAIL

File diff suppressed because it is too large Load diff

View file

@ -74,9 +74,6 @@
[Matching font-weight: '501' should prefer '390 410' over '300 350']
expected: FAIL
[Matching font-weight: '399' should prefer '350 399' over '340 360']
expected: FAIL
[Matching font-weight: '399' should prefer '340 360' over '200 300']
expected: FAIL
@ -128,9 +125,6 @@
[Matching font-style: 'oblique 20deg' should prefer 'oblique 20deg' over 'oblique 30deg 60deg']
expected: FAIL
[Matching font-style: 'oblique 21deg' should prefer 'oblique 40deg 50deg' over 'oblique 20deg']
expected: FAIL
[Matching font-style: 'oblique 21deg' should prefer 'oblique 20deg' over 'oblique 10deg']
expected: FAIL
@ -194,9 +188,6 @@
[Matching font-style: 'oblique -10deg' should prefer 'oblique -10deg' over 'oblique -5deg']
expected: FAIL
[Matching font-style: 'oblique -10deg' should prefer 'oblique -5deg' over 'oblique -1deg 0deg']
expected: FAIL
[Matching font-style: 'oblique -10deg' should prefer 'oblique -1deg 0deg' over 'oblique -20deg -15deg']
expected: FAIL

View file

@ -0,0 +1,91 @@
[inheritance.html]
[Property white-space has initial value normal]
expected: FAIL
[Property overflow-wrap has initial value normal]
expected: FAIL
[Property text-align-all has initial value start]
expected: FAIL
[Property word-break has initial value normal]
expected: FAIL
[Property text-indent inherits]
expected: FAIL
[Property overflow-wrap inherits]
expected: FAIL
[Property word-wrap has initial value normal]
expected: FAIL
[Property text-justify has initial value auto]
expected: FAIL
[Property hanging-punctuation inherits]
expected: FAIL
[Property text-transform inherits]
expected: FAIL
[Property tab-size inherits]
expected: FAIL
[Property letter-spacing inherits]
expected: FAIL
[Property text-justify inherits]
expected: FAIL
[Property word-spacing has initial value 0px]
expected: FAIL
[Property text-indent has initial value 0px]
expected: FAIL
[Property line-break inherits]
expected: FAIL
[Property word-break inherits]
expected: FAIL
[Property hyphens inherits]
expected: FAIL
[Property text-align-last inherits]
expected: FAIL
[Property letter-spacing has initial value normal]
expected: FAIL
[Property word-wrap inherits]
expected: FAIL
[Property white-space inherits]
expected: FAIL
[Property hyphens has initial value manual]
expected: FAIL
[Property hanging-punctuation has initial value none]
expected: FAIL
[Property tab-size has initial value 8]
expected: FAIL
[Property text-align-all inherits]
expected: FAIL
[Property text-align-last has initial value auto]
expected: FAIL
[Property line-break has initial value auto]
expected: FAIL
[Property text-transform has initial value none]
expected: FAIL
[Property word-spacing inherits]
expected: FAIL

View file

@ -0,0 +1,4 @@
[matrix-interpolation.html]
[Animation between "rotateY(360deg)" and "rotateX(720deg)" at progress 0.5]
expected: FAIL

View file

@ -50,9 +50,6 @@
[outline-width end]
expected: FAIL
[right end]
expected: FAIL
[word-spacing intermediate]
expected: FAIL
@ -77,15 +74,6 @@
[text-indent intermediate]
expected: FAIL
[padding-right end]
expected: FAIL
[height end]
expected: FAIL
[border-left-width end]
expected: FAIL
[opacity end]
expected: FAIL

View file

@ -0,0 +1,4 @@
[inheritance.html]
[Inheritance of CSS Basic User Interface properties]
expected: FAIL

View file

@ -624,3 +624,15 @@
[Element interface: document.createElement("div") must inherit property "scrollIntoView([object Object\],[object Object\])" with the proper type]
expected: FAIL
[Window interface: window must inherit property "screenLeft" with the proper type]
expected: FAIL
[Window interface: window must inherit property "screenTop" with the proper type]
expected: FAIL
[Window interface: attribute screenLeft]
expected: FAIL
[Window interface: attribute screenTop]
expected: FAIL

View file

@ -0,0 +1,4 @@
[Node-insertBefore.html]
[Should check the 'parent' type before checking whether 'child' is a child of 'parent']
expected: FAIL

View file

@ -0,0 +1,7 @@
[Node-replaceChild.html]
[If the context node is not a node that can contain children, a HierarchyRequestError exception should be thrown]
expected: FAIL
[Should check the 'parent' type before checking whether 'child' is a child of 'parent']
expected: FAIL

View file

@ -0,0 +1,52 @@
[DOMParser-parseFromString-xml-parsererror.html]
[DOMParser: <parsererror> element added on error, <span ="noattr">10</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, 15<span]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span x:test="testing">1</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span>5]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span data-test=testing>14</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span novalue>9</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span><em>4</span></em>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span xmlns:p1 xmlns:p2="urn:x-test:test"/>17]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span ::="test">11</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span>7< /span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <8:test xmlns:8="urn:x-test:test">16</8:test>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span xmlns:="urn:x-test:test">12</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, < span>2</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span :test="testing">3</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span xmlns:xmlns="">13</span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, <span>8</ span>]
expected: FAIL
[DOMParser: <parsererror> element added on error, 6</span>]
expected: FAIL

View file

@ -0,0 +1,82 @@
[script-resource-with-json-parser-breaker.tentative.sub.html]
[CORB-blocks 'application/pdf' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'application/zip' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'application/zip' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'text/json' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'text/xml' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'text/html' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'text/json' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'application/javascript' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'text/html' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'image/png' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'text/xml' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'image/png' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'text/html' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'application/pdf' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'image/png' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'text/xml' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'application/zip' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'text/plain' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'text/json' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'application/javascript' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'image/svg+xml' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'image/svg+xml' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'text/plain' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'text/plain' that starts with the following JSON parser breaker: {} &&]
expected: FAIL
[CORB-blocks 'application/pdf' that starts with the following JSON parser breaker: {}&&]
expected: FAIL
[CORB-blocks 'image/svg+xml' that starts with the following JSON parser breaker: )\]}']
expected: FAIL
[CORB-blocks 'application/javascript' that starts with the following JSON parser breaker: {} &&]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -11489,3 +11489,6 @@
[SVGElement interface: attribute ondrag]
expected: FAIL
[ImageData interface: new ImageData(10, 10) must inherit property "data" with the proper type]
expected: FAIL

View file

@ -1,8 +1,9 @@
[event_timeupdate_noautoplay.html]
type: testharness
expected: TIMEOUT
[calling play() on a sufficiently long audio should trigger timeupdate event]
expected: FAIL
expected: NOTRUN
[calling play() on a sufficiently long video should trigger timeupdate event]
expected: FAIL
expected: NOTRUN

View file

@ -1,4 +0,0 @@
[readyState_during_loadeddata.html]
type: testharness
[video.readyState should be >= HAVE_CURRENT_DATA during loadeddata event]
expected: FAIL

View file

@ -2,7 +2,7 @@
type: testharness
expected: TIMEOUT
[picture: source (max-width:500px) broken image, img valid image, resize to wide]
expected: TIMEOUT
expected: FAIL
[picture: source (max-width:500px) valid image, img valid image, resize to wide]
expected: FAIL
@ -11,23 +11,5 @@
expected: TIMEOUT
[picture: source (max-width:500px) valid image, img valid image, resize to narrow]
expected: FAIL
[picture: source (max-width:500px) broken image, img valid image, resize to narrow]
expected: FAIL
[img (srcset 1 cand) valid image, resize to wide]
expected: FAIL
[picture: same URL in source (max-width:500px) and img, resize to wide]
expected: FAIL
[img (srcset 1 cand) valid image, resize to narrow]
expected: FAIL
[picture: source (max-width:500px) valid image, img broken image, resize to wide]
expected: FAIL
[picture: same URL in source (max-width:500px) and img, resize to narrow]
expected: FAIL
expected: TIMEOUT

View file

@ -1,10 +0,0 @@
[non-active-document.html]
[DOMParser]
expected: FAIL
[createHTMLDocument]
expected: FAIL
[<template>]
expected: FAIL

View file

@ -1,283 +0,0 @@
[limited-quirks.html]
[top: -\\31 .5]
expected: FAIL
[bottom: -1A]
expected: FAIL
[bottom: -1a]
expected: FAIL
[top: @1]
expected: FAIL
[top: "1a"]
expected: FAIL
[top: @a]
expected: FAIL
[bottom: "1"]
expected: FAIL
[bottom: -/**/1]
expected: FAIL
[top: +/**/1]
expected: FAIL
[bottom: @1a]
expected: FAIL
[top: 1\\31 ]
expected: FAIL
[top: url('1')]
expected: FAIL
[bottom: -\\31 ]
expected: FAIL
[top: calc(1)]
expected: FAIL
[top: \\31 ]
expected: FAIL
[bottom: +1\\31 ]
expected: FAIL
[bottom: 1\\31 .5]
expected: FAIL
[bottom: #0001]
expected: FAIL
[top: calc(2 * 2px)]
expected: FAIL
[bottom: 1a]
expected: FAIL
[bottom: A]
expected: FAIL
[bottom: #01]
expected: FAIL
[top: +\\31 .5]
expected: FAIL
[bottom: #1]
expected: FAIL
[top: -/**/1]
expected: FAIL
[bottom: +\\31 .5]
expected: FAIL
[bottom: \\31 ]
expected: FAIL
[bottom: calc(1)]
expected: FAIL
[top: #001]
expected: FAIL
[top: +\\31 ]
expected: FAIL
[bottom: +\\31 ]
expected: FAIL
[top: +1.5]
expected: FAIL
[top: +1\\31 ]
expected: FAIL
[bottom: @a]
expected: FAIL
[bottom: @1]
expected: FAIL
[top: #1]
expected: FAIL
[top: 1a]
expected: FAIL
[bottom: +1a]
expected: FAIL
[bottom: +1A]
expected: FAIL
[bottom: "a"]
expected: FAIL
[top: #00001]
expected: FAIL
[bottom: -1\\31 .5]
expected: FAIL
[top: "1"]
expected: FAIL
[bottom: 1.5]
expected: FAIL
[bottom: -\\31 .5]
expected: FAIL
[bottom: url('1')]
expected: FAIL
[bottom: -1.5]
expected: FAIL
[top: \\31 .5]
expected: FAIL
[bottom: "1a"]
expected: FAIL
[bottom: calc(2 * 2px)]
expected: FAIL
[bottom: +1\\31 .5]
expected: FAIL
[bottom: 1\\31 ]
expected: FAIL
[bottom: +/**/1]
expected: FAIL
[bottom: #00001]
expected: FAIL
[top: url(1)]
expected: FAIL
[bottom: #001]
expected: FAIL
[top: +1\\31 .5]
expected: FAIL
[top: -1a]
expected: FAIL
[top: -1A]
expected: FAIL
[bottom: url(1)]
expected: FAIL
[top: a]
expected: FAIL
[top: A]
expected: FAIL
[top: #000001]
expected: FAIL
[top: 1]
expected: FAIL
[top: 1\\31 .5]
expected: FAIL
[bottom: a]
expected: FAIL
[bottom: 1]
expected: FAIL
[bottom: +1]
expected: FAIL
[bottom: #000001]
expected: FAIL
[bottom: +a]
expected: FAIL
[bottom: +A]
expected: FAIL
[top: 1.5]
expected: FAIL
[top: +A]
expected: FAIL
[top: +a]
expected: FAIL
[top: +1]
expected: FAIL
[top: -1.5]
expected: FAIL
[top: -1\\31 .5]
expected: FAIL
[top: +1a]
expected: FAIL
[top: +1A]
expected: FAIL
[top: @1a]
expected: FAIL
[bottom: \\31 .5]
expected: FAIL
[top: "a"]
expected: FAIL
[top: #01]
expected: FAIL
[bottom: +1.5]
expected: FAIL
[bottom: -A]
expected: FAIL
[bottom: -a]
expected: FAIL
[bottom: -1\\31 ]
expected: FAIL
[top: #0001]
expected: FAIL
[bottom: -1]
expected: FAIL
[top: -\\31 ]
expected: FAIL
[top: -A]
expected: FAIL
[top: -a]
expected: FAIL
[top: -1]
expected: FAIL
[top: -1\\31 ]
expected: FAIL

View file

@ -2,29 +2,29 @@
[request.formData() with input: a&b&c]
expected: FAIL
[request.formData() with input: _charset_=windows-1252&test=%C2x]
expected: FAIL
[urlencoded-parser.any.worker.html]
[request.formData() with input: a=b&c=d]
expected: FAIL
[request.formData() with input: a&b&c]
expected: FAIL
[response.formData() with input: a&b&c]
expected: FAIL
[response.formData() with input: a=b&c=d&]
expected: FAIL
[request.formData() with input: a=b&c=d]
expected: FAIL
[response.formData() with input: _charset_=windows-1252&test=%C2x]
expected: FAIL
[response.formData() with input: &&&a=b&&&&c=d&]
[urlencoded-parser.any.worker.html]
[request.formData() with input: a&b&c]
expected: FAIL
[response.formData() with input: a=b&c=d]
[response.formData() with input: a&b&c]
expected: FAIL
[response.formData() with input: a=b&c=d&]
expected: FAIL
[request.formData() with input: _charset_=windows-1252&test=%C2x]
expected: FAIL

View file

@ -23,6 +23,9 @@
[Stray argument]
expected: FAIL
[Empty buffer]
expected: FAIL
[compile.any.html]
[Invalid arguments]
@ -49,3 +52,6 @@
[Stray argument]
expected: FAIL
[Empty buffer]
expected: FAIL

View file

@ -74,6 +74,9 @@
[stray argument: Module argument]
expected: FAIL
[Empty buffer]
expected: FAIL
[instantiate.any.worker.html]
[Invalid arguments]
@ -151,3 +154,6 @@
[stray argument: Module argument]
expected: FAIL
[Empty buffer]
expected: FAIL

View file

@ -0,0 +1,27 @@
[abort.any.worker.html]
[instantiateStreaming() on an already-aborted request should reject with AbortError]
expected: FAIL
[compileStreaming() on an already-aborted request should reject with AbortError]
expected: FAIL
[instantiateStreaming() synchronously followed by abort should reject with AbortError]
expected: FAIL
[compileStreaming() synchronously followed by abort should reject with AbortError]
expected: FAIL
[abort.any.html]
[instantiateStreaming() on an already-aborted request should reject with AbortError]
expected: FAIL
[compileStreaming() on an already-aborted request should reject with AbortError]
expected: FAIL
[instantiateStreaming() synchronously followed by abort should reject with AbortError]
expected: FAIL
[compileStreaming() synchronously followed by abort should reject with AbortError]
expected: FAIL

View file

@ -0,0 +1,37 @@
[body.any.worker.html]
[compileStreaming before consumption]
expected: FAIL
[compileStreaming after consumption]
expected: FAIL
[instantiateStreaming after consumption]
expected: FAIL
[instantiateStreaming before consumption]
expected: FAIL
[body.any.html]
[compileStreaming before consumption]
expected: FAIL
[compileStreaming after consumption]
expected: FAIL
[instantiateStreaming after consumption]
expected: FAIL
[instantiateStreaming before consumption]
expected: FAIL
[body.any.serviceworker.html]
[body]
expected: FAIL
[body.any.sharedworker.html]
[body]
expected: FAIL

View file

@ -41,6 +41,24 @@
[Response with Content-Type "": compileStreaming]
expected: FAIL
[Response with Content-Type "application/wasm": compileStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/wasm": compileStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/wasm": instantiateStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/WASM": instantiateStreaming]
expected: FAIL
[Response with Content-Type "application/wasm": instantiateStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/WASM": compileStreaming]
expected: FAIL
[contenttype.any.sharedworker.html]
[contenttype]
@ -90,7 +108,26 @@
[Response with Content-Type "": compileStreaming]
expected: FAIL
[Response with Content-Type "application/wasm": compileStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/wasm": compileStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/wasm": instantiateStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/WASM": instantiateStreaming]
expected: FAIL
[Response with Content-Type "application/wasm": instantiateStreaming]
expected: FAIL
[Response with Content-Type "APPLICATION/WASM": compileStreaming]
expected: FAIL
[contenttype.any.serviceworker.html]
[contenttype]
expected: FAIL

View file

@ -0,0 +1,61 @@
[empty-body.any.worker.html]
[compileStreaming: empty body]
expected: FAIL
[instantiateStreaming: no body]
expected: FAIL
[compileStreaming: no body]
expected: FAIL
[compileStreaming: no body in a promise]
expected: FAIL
[instantiateStreaming: empty body]
expected: FAIL
[compileStreaming: empty body in a promise]
expected: FAIL
[instantiateStreaming: empty body in a promise]
expected: FAIL
[instantiateStreaming: no body in a promise]
expected: FAIL
[empty-body.any.sharedworker.html]
[empty-body]
expected: FAIL
[empty-body.any.html]
[compileStreaming: empty body]
expected: FAIL
[instantiateStreaming: no body]
expected: FAIL
[compileStreaming: no body]
expected: FAIL
[compileStreaming: no body in a promise]
expected: FAIL
[instantiateStreaming: empty body]
expected: FAIL
[compileStreaming: empty body in a promise]
expected: FAIL
[instantiateStreaming: empty body in a promise]
expected: FAIL
[instantiateStreaming: no body in a promise]
expected: FAIL
[empty-body.any.serviceworker.html]
[empty-body]
expected: FAIL

View file

@ -0,0 +1,189 @@
[instantiateStreaming-bad-imports.any.serviceworker.html]
[instantiateStreaming-bad-imports]
expected: FAIL
[instantiateStreaming-bad-imports.any.html]
expected: ERROR
[Imports argument with missing property: wrong property]
expected: FAIL
[Non-object module: symbol "Symbol()"]
expected: FAIL
[Non-object imports argument: null]
expected: FAIL
[Non-object imports argument: 1]
expected: FAIL
[Importing a function with an incorrectly-typed value: symbol "Symbol()"]
expected: FAIL
[Non-object module: 1]
expected: FAIL
[Non-object imports argument: symbol "Symbol()"]
expected: FAIL
[Importing a function with an incorrectly-typed value: 1]
expected: FAIL
[Importing an i64 global]
expected: FAIL
[Non-object imports argument: ""]
expected: FAIL
[Imports argument with missing property: undefined]
expected: FAIL
[Non-object module: ""]
expected: FAIL
[Importing a function with an incorrectly-typed value: null]
expected: FAIL
[Non-object module: NaN]
expected: FAIL
[Non-object module: 0.1]
expected: FAIL
[Missing imports argument]
expected: FAIL
[Non-object imports argument: true]
expected: FAIL
[Non-object imports argument: 0.1]
expected: FAIL
[Non-object module: undefined]
expected: FAIL
[Importing a function with an incorrectly-typed value: undefined]
expected: FAIL
[Non-object imports argument: NaN]
expected: FAIL
[Non-object module: true]
expected: FAIL
[Non-object module: null]
expected: FAIL
[Importing a function with an incorrectly-typed value: ""]
expected: FAIL
[Importing a function with an incorrectly-typed value: 0.1]
expected: FAIL
[Importing a function with an incorrectly-typed value: NaN]
expected: FAIL
[Importing a function with an incorrectly-typed value: object "[object Object\]"]
expected: FAIL
[Imports argument with missing property: empty object]
expected: FAIL
[Importing a function with an incorrectly-typed value: true]
expected: FAIL
[instantiateStreaming-bad-imports.any.worker.html]
expected: ERROR
[Imports argument with missing property: wrong property]
expected: FAIL
[Non-object module: symbol "Symbol()"]
expected: FAIL
[Non-object imports argument: null]
expected: FAIL
[Non-object imports argument: 1]
expected: FAIL
[Importing a function with an incorrectly-typed value: symbol "Symbol()"]
expected: FAIL
[Non-object module: 1]
expected: FAIL
[Non-object imports argument: symbol "Symbol()"]
expected: FAIL
[Importing a function with an incorrectly-typed value: 1]
expected: FAIL
[Importing an i64 global]
expected: FAIL
[Non-object imports argument: ""]
expected: FAIL
[Imports argument with missing property: undefined]
expected: FAIL
[Non-object module: ""]
expected: FAIL
[Importing a function with an incorrectly-typed value: null]
expected: FAIL
[Non-object module: NaN]
expected: FAIL
[Non-object module: 0.1]
expected: FAIL
[Missing imports argument]
expected: FAIL
[Non-object imports argument: true]
expected: FAIL
[Non-object imports argument: 0.1]
expected: FAIL
[Non-object module: undefined]
expected: FAIL
[Importing a function with an incorrectly-typed value: undefined]
expected: FAIL
[Non-object imports argument: NaN]
expected: FAIL
[Non-object module: true]
expected: FAIL
[Non-object module: null]
expected: FAIL
[Importing a function with an incorrectly-typed value: ""]
expected: FAIL
[Importing a function with an incorrectly-typed value: 0.1]
expected: FAIL
[Importing a function with an incorrectly-typed value: NaN]
expected: FAIL
[Importing a function with an incorrectly-typed value: object "[object Object\]"]
expected: FAIL
[Imports argument with missing property: empty object]
expected: FAIL
[Importing a function with an incorrectly-typed value: true]
expected: FAIL
[instantiateStreaming-bad-imports.any.sharedworker.html]
[instantiateStreaming-bad-imports]
expected: FAIL

View file

@ -0,0 +1,61 @@
[instantiateStreaming.any.html]
[Empty module with undefined imports argument]
expected: FAIL
[stray argument]
expected: FAIL
[imports]
expected: FAIL
[Empty module without imports argument]
expected: FAIL
[exports and imports]
expected: FAIL
[getter order for imports object]
expected: FAIL
[Empty module with empty imports argument]
expected: FAIL
[No imports]
expected: FAIL
[instantiateStreaming.any.serviceworker.html]
[instantiateStreaming]
expected: FAIL
[instantiateStreaming.any.sharedworker.html]
[instantiateStreaming]
expected: FAIL
[instantiateStreaming.any.worker.html]
[Empty module with undefined imports argument]
expected: FAIL
[stray argument]
expected: FAIL
[imports]
expected: FAIL
[Empty module without imports argument]
expected: FAIL
[exports and imports]
expected: FAIL
[getter order for imports object]
expected: FAIL
[Empty module with empty imports argument]
expected: FAIL
[No imports]
expected: FAIL

View file

@ -0,0 +1,277 @@
[invalid-args.any.serviceworker.html]
[invalid-args]
expected: FAIL
[invalid-args.any.sharedworker.html]
[invalid-args]
expected: FAIL
[invalid-args.any.worker.html]
[instantiateStreaming: "test" in a promise]
expected: FAIL
[compileStreaming: true in a promise]
expected: FAIL
[compileStreaming: "test" in a promise]
expected: FAIL
[compileStreaming: symbol "Symbol()"]
expected: FAIL
[instantiateStreaming: true]
expected: FAIL
[instantiateStreaming: Response interface object in a promise]
expected: FAIL
[instantiateStreaming: 0 in a promise]
expected: FAIL
[compileStreaming: Empty object]
expected: FAIL
[instantiateStreaming: Response interface prototype object in a promise]
expected: FAIL
[instantiateStreaming: undefined]
expected: FAIL
[compileStreaming: undefined]
expected: FAIL
[compileStreaming: Response interface prototype object]
expected: FAIL
[instantiateStreaming: 0.1]
expected: FAIL
[instantiateStreaming: symbol "Symbol()" in a promise]
expected: FAIL
[compileStreaming: 0.1 in a promise]
expected: FAIL
[instantiateStreaming: Empty object]
expected: FAIL
[instantiateStreaming: null]
expected: FAIL
[compileStreaming: Empty object in a promise]
expected: FAIL
[compileStreaming: null]
expected: FAIL
[instantiateStreaming: undefined in a promise]
expected: FAIL
[instantiateStreaming: Empty object in a promise]
expected: FAIL
[compileStreaming: NaN]
expected: FAIL
[instantiateStreaming: NaN]
expected: FAIL
[compileStreaming: 0]
expected: FAIL
[instantiateStreaming: Response interface prototype object]
expected: FAIL
[compileStreaming: undefined in a promise]
expected: FAIL
[compileStreaming: "test"]
expected: FAIL
[instantiateStreaming: 0]
expected: FAIL
[instantiateStreaming: "test"]
expected: FAIL
[instantiateStreaming: null in a promise]
expected: FAIL
[compileStreaming: true]
expected: FAIL
[instantiateStreaming: symbol "Symbol()"]
expected: FAIL
[compileStreaming: symbol "Symbol()" in a promise]
expected: FAIL
[instantiateStreaming: true in a promise]
expected: FAIL
[compileStreaming: Response interface object in a promise]
expected: FAIL
[compileStreaming: Response interface prototype object in a promise]
expected: FAIL
[instantiateStreaming: Response interface object]
expected: FAIL
[compileStreaming: 0.1]
expected: FAIL
[compileStreaming: null in a promise]
expected: FAIL
[compileStreaming: 0 in a promise]
expected: FAIL
[compileStreaming: Response interface object]
expected: FAIL
[compileStreaming: NaN in a promise]
expected: FAIL
[instantiateStreaming: 0.1 in a promise]
expected: FAIL
[instantiateStreaming: NaN in a promise]
expected: FAIL
[invalid-args.any.html]
[instantiateStreaming: "test" in a promise]
expected: FAIL
[compileStreaming: true in a promise]
expected: FAIL
[compileStreaming: "test" in a promise]
expected: FAIL
[compileStreaming: symbol "Symbol()"]
expected: FAIL
[instantiateStreaming: true]
expected: FAIL
[instantiateStreaming: Response interface object in a promise]
expected: FAIL
[instantiateStreaming: 0 in a promise]
expected: FAIL
[compileStreaming: Empty object]
expected: FAIL
[instantiateStreaming: Response interface prototype object in a promise]
expected: FAIL
[instantiateStreaming: undefined]
expected: FAIL
[compileStreaming: undefined]
expected: FAIL
[compileStreaming: Response interface prototype object]
expected: FAIL
[instantiateStreaming: 0.1]
expected: FAIL
[instantiateStreaming: symbol "Symbol()" in a promise]
expected: FAIL
[compileStreaming: 0.1 in a promise]
expected: FAIL
[instantiateStreaming: Empty object]
expected: FAIL
[instantiateStreaming: null]
expected: FAIL
[compileStreaming: Empty object in a promise]
expected: FAIL
[compileStreaming: null]
expected: FAIL
[instantiateStreaming: undefined in a promise]
expected: FAIL
[instantiateStreaming: Empty object in a promise]
expected: FAIL
[compileStreaming: NaN]
expected: FAIL
[instantiateStreaming: NaN]
expected: FAIL
[compileStreaming: 0]
expected: FAIL
[instantiateStreaming: Response interface prototype object]
expected: FAIL
[compileStreaming: undefined in a promise]
expected: FAIL
[compileStreaming: "test"]
expected: FAIL
[instantiateStreaming: 0]
expected: FAIL
[instantiateStreaming: "test"]
expected: FAIL
[instantiateStreaming: null in a promise]
expected: FAIL
[compileStreaming: true]
expected: FAIL
[instantiateStreaming: symbol "Symbol()"]
expected: FAIL
[compileStreaming: symbol "Symbol()" in a promise]
expected: FAIL
[instantiateStreaming: true in a promise]
expected: FAIL
[compileStreaming: Response interface object in a promise]
expected: FAIL
[compileStreaming: Response interface prototype object in a promise]
expected: FAIL
[instantiateStreaming: Response interface object]
expected: FAIL
[compileStreaming: 0.1]
expected: FAIL
[compileStreaming: null in a promise]
expected: FAIL
[compileStreaming: 0 in a promise]
expected: FAIL
[compileStreaming: Response interface object]
expected: FAIL
[compileStreaming: NaN in a promise]
expected: FAIL
[instantiateStreaming: 0.1 in a promise]
expected: FAIL
[instantiateStreaming: NaN in a promise]
expected: FAIL

View file

@ -0,0 +1,25 @@
[invalid-code.any.sharedworker.html]
[invalid-code]
expected: FAIL
[invalid-code.any.worker.html]
[Invalid code: instantiateStreaming]
expected: FAIL
[Invalid code: compileStreaming]
expected: FAIL
[invalid-code.any.serviceworker.html]
[invalid-code]
expected: FAIL
[invalid-code.any.html]
[Invalid code: instantiateStreaming]
expected: FAIL
[Invalid code: compileStreaming]
expected: FAIL

View file

@ -0,0 +1,37 @@
[origin.sub.any.sharedworker.html]
[origin]
expected: FAIL
[origin.sub.any.worker.html]
[Opaque response: compileStreaming]
expected: FAIL
[Opaque redirect response: compileStreaming]
expected: FAIL
[Opaque redirect response: instantiateStreaming]
expected: FAIL
[Opaque response: instantiateStreaming]
expected: FAIL
[origin.sub.any.html]
[Opaque response: compileStreaming]
expected: FAIL
[Opaque redirect response: compileStreaming]
expected: FAIL
[Opaque redirect response: instantiateStreaming]
expected: FAIL
[Opaque response: instantiateStreaming]
expected: FAIL
[origin.sub.any.serviceworker.html]
[origin]
expected: FAIL

View file

@ -0,0 +1,26 @@
[rejected-arg.any.sharedworker.html]
[rejected-arg]
expected: FAIL
[rejected-arg.any.worker.html]
[compileStreaming]
expected: FAIL
[instantiateStreaming]
expected: FAIL
[rejected-arg.any.serviceworker.html]
[rejected-arg]
expected: FAIL
[rejected-arg.any.html]
expected: ERROR
[compileStreaming]
expected: FAIL
[instantiateStreaming]
expected: FAIL

View file

@ -0,0 +1,109 @@
[status.any.html]
[Response with status 300: instantiateStreaming]
expected: FAIL
[Response with status 500: instantiateStreaming]
expected: FAIL
[Response with status 700: instantiateStreaming]
expected: FAIL
[Response with status 0: compileStreaming]
expected: FAIL
[Response with status 700: compileStreaming]
expected: FAIL
[Response with status 600: instantiateStreaming]
expected: FAIL
[Response with status 0: instantiateStreaming]
expected: FAIL
[Response with status 404: compileStreaming]
expected: FAIL
[Response with status 500: compileStreaming]
expected: FAIL
[Response with status 600: compileStreaming]
expected: FAIL
[Response with status 300: compileStreaming]
expected: FAIL
[Response with status 400: compileStreaming]
expected: FAIL
[Response with status 400: instantiateStreaming]
expected: FAIL
[Response with status 999: instantiateStreaming]
expected: FAIL
[Response with status 999: compileStreaming]
expected: FAIL
[Response with status 404: instantiateStreaming]
expected: FAIL
[status.any.serviceworker.html]
[status]
expected: FAIL
[status.any.sharedworker.html]
[status]
expected: FAIL
[status.any.worker.html]
[Response with status 300: instantiateStreaming]
expected: FAIL
[Response with status 500: instantiateStreaming]
expected: FAIL
[Response with status 700: instantiateStreaming]
expected: FAIL
[Response with status 0: compileStreaming]
expected: FAIL
[Response with status 700: compileStreaming]
expected: FAIL
[Response with status 600: instantiateStreaming]
expected: FAIL
[Response with status 0: instantiateStreaming]
expected: FAIL
[Response with status 404: compileStreaming]
expected: FAIL
[Response with status 500: compileStreaming]
expected: FAIL
[Response with status 600: compileStreaming]
expected: FAIL
[Response with status 300: compileStreaming]
expected: FAIL
[Response with status 400: compileStreaming]
expected: FAIL
[Response with status 400: instantiateStreaming]
expected: FAIL
[Response with status 999: instantiateStreaming]
expected: FAIL
[Response with status 999: compileStreaming]
expected: FAIL
[Response with status 404: instantiateStreaming]
expected: FAIL

View file

@ -1,5 +1,5 @@
[audiocontextoptions.html]
expected: TIMEOUT
expected: ERROR
[< [test-audiocontextoptions-latencyHint-basic\] 1 out of 9 assertions were failed.]
expected: FAIL

View file

@ -66,3 +66,9 @@
[The IDBTransaction interface object should be exposed.]
expected: FAIL
[The CanvasGradient interface object should be exposed.]
expected: FAIL
[The CanvasPattern interface object should be exposed.]
expected: FAIL

View file

@ -61,7 +61,7 @@ tasks:
owner: ${event.pusher.email}
source: ${event.repository.url}
payload:
image: jugglinmike/web-platform-tests:0.21
image: harjgam/web-platform-tests:0.22
maxRunTime: 7200
artifacts:
public/results:

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<title>createImageBitmap: blob with wrong mime type</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>
<script>
promise_test(t => {
// Source: https://commons.wikimedia.org/wiki/File:1x1.png (Public Domain)
const IMAGE = atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAA" +
"ACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=");
let bytes = new Array(IMAGE.length);
for (let i = 0; i < IMAGE.length; i++) {
bytes[i] = IMAGE.charCodeAt(i);
}
let blob = new Blob([new Uint8Array(bytes)], { type: "text/html"});
return window.createImageBitmap(blob)
.then(imageBitmap => {
assert_true(true, "Image created!");
assert_equals(imageBitmap.width, 1, "Image is 1x1");
assert_equals(imageBitmap.height, 1, "Image is 1x1");
});
});
</script>

View file

@ -49,7 +49,7 @@ function makeAvailableButBrokenImage(path) {
testCases = [
{
description: 'createImageBitmap with a <sourceType> source and sw set to 0',
description: 'createImageBitmap with <sourceType> source and sw set to 0',
promiseTestFunction:
(source, t) => {
return promise_rejects(t, new RangeError(),
@ -57,7 +57,7 @@ testCases = [
}
},
{
description: 'createImageBitmap with a <sourceType> source and sh set to 0',
description: 'createImageBitmap with <sourceType> source and sh set to 0',
promiseTestFunction:
(source, t) => {
return promise_rejects(t, new RangeError(),
@ -65,17 +65,23 @@ testCases = [
}
},
{
// This case is not explicitly documented in the specification for
// createImageBitmap, but it is expected that internal failures cause
// InvalidStateError.
//
// Note: https://bugs.chromium.org/p/chromium/issues/detail?id=799025
description: 'createImageBitmap with a <sourceType> source and oversized ' +
description: 'createImageBitmap with <sourceType> source and oversized ' +
'(unallocatable) crop region',
promiseTestFunction:
(source, t) => {
return promise_rejects(t, new DOMException('', 'InvalidStateError'),
createImageBitmap(source, 0, 0, 100000000, 100000000));
return createImageBitmap(source, 0, 0, 100000000, 100000000)
.then(i => {
assert_equals(i.width, 100000000);
assert_equals(i.height, 100000000);
})
.catch(e => {
// This case is not explicitly documented in the specification for
// createImageBitmap, but it is expected that internal failures
// cause InvalidStateError.
//
// Note: https://bugs.chromium.org/p/chromium/issues/detail?id=799025
assert_throws("InvalidStateError", () => { throw e });
});
}
},
];

View file

@ -0,0 +1,126 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
var image = new Image();
// This image is 256 by 1 and contains an opaque grayscale ramp from 0 to 255.
// The image has no embedded color profile.
image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAABCAYAAAAx" +
"WXB3AAAAG0lEQVQ4T2NkYGD4z8jIyDCKR8NgNA2MvDQAAPiPA/5tZ8G+AAAAAElFTkSuQmCC";
image.onload = function() {
var canvas = document.createElement('canvas');
canvas.width = 256;
canvas.height = 1;
var ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
var img = ctx.getImageData(0, 0, 256, 1);
t.step(function() {
for (var i = 0; i < 256; i++) {
assert_equals(img.data[4 * i], i, "red component");
assert_equals(img.data[4 * i + 1], i, "green component");
assert_equals(img.data[4 * i + 2], i, "blue component");
assert_equals(img.data[4 * i + 3], 255, "alpha component");
}
});
t.done();
}
}, "Verify that drawImage->getImageData round trip preserves color values " +
"when image metadata has no color space and canvas uses the default " +
"color space.");
async_test(function(t) {
var image = new Image();
// This image is 256 by 1 and contains an opaque grayscale ramp from 0 to 255.
// The image has an embedded sRGB color profile.
image.src =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAABCAYAAAAxWXB3AAAA" +
"G0lEQVQ4T2NkYGD4z8jIyDCKR8NgNA2MvDQAAPiPA/5tZ8G+AAAAo3pUWHRSYXcgcHJvZm" +
"lsZSB0eXBlIEFQUDEAAHicZU5bCsMwDPv3KXoEv/I6TrampTC20ft/LE7WETJBkK1YQrCX" +
"ZzmP+/I+X9vxKLAYyCGoC9En77FCV10ROWNHrM8hUW7cQZ00V/026tDZMRKbUQYDt4lJJr" +
"2FxeCTJc5BV4svNE4Nxl1Tn8N1LCgMIoKJ2sHvo25sHfK/odYT02luCWMP+AA5M0KbNr61" +
"PwAAAABJRU5ErkJggg==";
image.onload = function() {
var canvas = document.createElement('canvas');
canvas.width = 256;
canvas.height = 1;
var ctx = canvas.getContext('2d', {colorSpace: 'srgb'});
ctx.drawImage(image, 0, 0);
var img = ctx.getImageData(0, 0, 256, 1);
t.step(function() {
for (var i = 0; i < 256; i++) {
assert_equals(img.data[4 * i], i, "red component");
assert_equals(img.data[4 * i + 1], i, "green component");
assert_equals(img.data[4 * i + 2], i, "blue component");
assert_equals(img.data[4 * i + 3], 255, "alpha component");
}
});
t.done();
}
}, "Verify that drawImage->getImageData round trip preserves color values " +
"when image metadata has srgb color space and canvas uses the srgb " +
"color space.");
async_test(function(t) {
var image = new Image();
// This image is 256 by 1 and contains an opaque grayscale ramp from 0 to 255.
// The image has no embedded color profile.
image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAABCAYAAAAx" +
"WXB3AAAAG0lEQVQ4T2NkYGD4z8jIyDCKR8NgNA2MvDQAAPiPA/5tZ8G+AAAAAElFTkSuQmCC";
image.onload = function() {
var canvas = document.createElement('canvas');
canvas.width = 256;
canvas.height = 1;
var ctx = canvas.getContext('2d', {colorSpace: 'srgb'});
ctx.drawImage(image, 0, 0);
var img = ctx.getImageData(0, 0, 256, 1);
t.step(function() {
for (var i = 0; i < 256; i++) {
assert_equals(img.data[4 * i], i, "red component");
assert_equals(img.data[4 * i + 1], i, "green component");
assert_equals(img.data[4 * i + 2], i, "blue component");
assert_equals(img.data[4 * i + 3], 255, "alpha component");
}
});
t.done();
}
}, "Verify that drawImage->getImageData round trip preserves color values " +
"when image metadata has no color space and canvas uses the srgb " +
"color space.");
async_test(function(t) {
var image = new Image();
// This image is 256 by 1 and contains an opaque grayscale ramp from 0 to 255.
// The image has an embedded sRGB color profile.
image.src =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAABCAYAAAAxWXB3AAAA" +
"G0lEQVQ4T2NkYGD4z8jIyDCKR8NgNA2MvDQAAPiPA/5tZ8G+AAAAo3pUWHRSYXcgcHJvZm" +
"lsZSB0eXBlIEFQUDEAAHicZU5bCsMwDPv3KXoEv/I6TrampTC20ft/LE7WETJBkK1YQrCX" +
"ZzmP+/I+X9vxKLAYyCGoC9En77FCV10ROWNHrM8hUW7cQZ00V/026tDZMRKbUQYDt4lJJr" +
"2FxeCTJc5BV4svNE4Nxl1Tn8N1LCgMIoKJ2sHvo25sHfK/odYT02luCWMP+AA5M0KbNr61" +
"PwAAAABJRU5ErkJggg==";
image.onload = function() {
var canvas = document.createElement('canvas');
canvas.width = 256;
canvas.height = 1;
var ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
var img = ctx.getImageData(0, 0, 256, 1);
t.step(function() {
for (var i = 0; i < 256; i++) {
assert_equals(img.data[4 * i], i, "red component");
assert_equals(img.data[4 * i + 1], i, "green component");
assert_equals(img.data[4 * i + 2], i, "blue component");
assert_equals(img.data[4 * i + 3], 255, "alpha component");
}
});
t.done();
}
}, "Verify that drawImage->getImageData round trip preserves color values " +
"when image metadata has srgb color space and canvas uses the default " +
"color space.");
</script>

View file

@ -0,0 +1,149 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// No matter what is the color space and pixel format of the color managed
// canvas, toBlob() and toDataURL() always create the blob in sRGB color
// space, and respect the legacy behavior by not including any color space
// information in the blob/data url.
var opaqueReferencePxiels, transparentReferencePixels;
function testPixels(actualPixels, refPixels, testScenario)
{
// Narrowing down the source of expected error:
// - Alpha values should always match.
// - Color components should be acceptably close.
if (testScenario.canvasColorParam.pixelFormat == 'uint8') {
let tolerance_color = 4;
for (let i = 0; i < actualPixels.length; i++) {
// Alpha channel
if (i % 4 == 3)
assert_equals(actualPixels[i], refPixels[i]);
else
assert_approx_equals(actualPixels[i], refPixels[i], tolerance_color);
}
} else {
// For half float backed canvas, we expect the error < 0.01.
let tolerance_color = 0.01;
for (let i = 0; i < actualPixels.length; i++) {
// Alpha channel
if (i % 4 == 3)
assert_equals(actualPixels[i], refPixels[i]);
else
assert_approx_equals(actualPixels[i], refPixels[i], tolerance_color);
}
}
}
function createCanvas(testScenario)
{
var canvas = document.createElement("canvas");
canvas.width = 2;
canvas.height = 2;
return canvas;
}
function generateFillStyle(red, green, blue, alpha) {
return "rgba(" + red + "," + green + "," + blue + "," + alpha + ")";
}
function drawPatternOnCanvsa(ctx, alpha, compositeOverBlack) {
if (compositeOverBlack) {
ctx.fillStyle = generateFillStyle(0, 0, 0, 1);
ctx.fillRect(0, 0, 2, 2);
}
ctx.fillStyle = generateFillStyle(155, 27, 27, alpha);
ctx.fillRect(0, 0, 1, 1);
ctx.fillStyle = generateFillStyle(27, 155, 27, alpha);
ctx.fillRect(1, 0, 1, 1);
ctx.fillStyle = generateFillStyle(27, 27, 155, alpha);
ctx.fillRect(0, 1, 1, 1);
ctx.fillStyle = generateFillStyle(27, 27, 27, alpha);
ctx.fillRect(1, 1, 1, 1);
}
function testScenarioToString(testScenario) {
var str = "mimeType: " + testScenario.encodeOptions.type +
", blobPixelFormat: " + testScenario.encodeOptions.pixelFormat +
", source color space: " + testScenario.canvasColorParam.colorSpace +
", pixel format: " + testScenario.canvasColorParam.pixelFormat +
", alpha: " + testScenario.alpha;
return str;
}
function runConvertToBlobTest(testScenario) {
var srcCanvas = createCanvas(testScenario);
var ctx = srcCanvas.getContext('2d', testScenario.canvasColorParam);
var compositeOverBlack = (testScenario.encodeOptions.type == "image/jpeg");
drawPatternOnCanvsa(ctx, testScenario.alpha, compositeOverBlack);
var refPixels = ctx.getImageData(0, 0, 2, 2).dataUnion;
var t = async_test("Test canvas convertToBlob(): " +
testScenarioToString(testScenario));
var image = new Image();
image.onload = t.step_func_done(function() {
var dstCanvas = createCanvas(testScenario);
var dstCtx = dstCanvas.getContext('2d', testScenario.canvasColorParam);
dstCtx.drawImage(image, 0, 0);
var actualPixels = dstCtx.getImageData(0, 0, 2, 2).dataUnion;
testPixels(actualPixels, refPixels, testScenario);
});
srcCanvas.convertToBlob(testScenario.encodeOptions).then(
t.step_func(function(blob) {
var urlCreator = window.URL || window.webkitURL;
image.src = urlCreator.createObjectURL(blob);
}),
t.step_func_done(function(e) {
assert_false("convertToBlob failed.");
})
);
}
function runAllTests() {
var mimeTypes = ['image/png', 'image/jpeg', 'image/webp'];
var blobPixelFormats = ['uint8', 'uint16'];
var encodeOptionsSet = [];
for (var i = 0; i < mimeTypes.length; i++)
for (var k = 0; k < blobPixelFormats.length; k++) {
var encodeOptions = {};
encodeOptions.quality = 1;
encodeOptions.type = mimeTypes[i];
encodeOptions.pixelFormat = blobPixelFormats[k];
encodeOptionsSet.push(encodeOptions);
}
var canvasColorParams = [
{colorSpace: 'srgb', pixelFormat: 'uint8'},
{colorSpace: 'srgb', pixelFormat: 'float16'},
];
var alphaValues = [0.5, 1];
// The *correct* way to test convertToBlob() is to directly examine the
// image file for the expected color space and pixels. Since this is not
// easy to do in javascript, we use a round-trip test here and leave the
// more thorough testing to unit tests.
var testScenarioSet = [];
for (var i = 0; i < encodeOptionsSet.length; i++)
for (var j = 0; j < canvasColorParams.length; j++)
for (var k = 0; k < alphaValues.length; k++) {
var testScenario = {};
testScenario.encodeOptions = encodeOptionsSet[i];
testScenario.canvasColorParam = canvasColorParams[j];
testScenario.alpha = alphaValues[k];
testScenarioSet.push(testScenario);
}
for (var i = 0; i < testScenarioSet.length; i++)
runConvertToBlobTest(testScenarioSet[i]);
}
runAllTests();
</script>

View file

@ -0,0 +1,145 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// No matter what is the color space and pixel format of the color managed
// canvas, toBlob() and toDataURL() always create the blob in sRGB color
// space, and respect the legacy behavior by not including any color space
// information in the blob/data url.
var opaqueReferencePxiels, transparentReferencePixels;
function testPixels(actualPixels, alpha)
{
if (alpha == 1)
assert_array_approx_equals(actualPixels, opaqueReferencePxiels, 1);
else
assert_array_approx_equals(actualPixels, transparentReferencePixels, 2);
}
function generateFillStyle(red, green, blue, alpha) {
return "rgba(" + red + "," + green + "," + blue + "," + alpha + ")";
}
function contextDrawHelper(ctx, alpha) {
ctx.fillStyle = generateFillStyle(155, 27, 27, alpha);
ctx.fillRect(0, 0, 1, 1);
ctx.fillStyle = generateFillStyle(27, 155, 27, alpha);
ctx.fillRect(1, 0, 1, 1);
ctx.fillStyle = generateFillStyle(27, 27, 155, alpha);
ctx.fillRect(0, 1, 1, 1);
ctx.fillStyle = generateFillStyle(27, 27, 27, alpha);
ctx.fillRect(1, 1, 1, 1);
}
function prepareReferenceExpectedResults() {
var canvas1 = document.createElement("canvas");
canvas1.width = 2;
canvas1.height = 2;
var ctx1 = canvas1.getContext('2d');
contextDrawHelper(ctx1, 1);
opaqueReferencePxiels = ctx1.getImageData(0, 0, 2, 2).data;
var canvas2 = document.createElement("canvas");
canvas2.width = 2;
canvas2.height = 2;
var ctx2 = canvas2.getContext('2d');
contextDrawHelper(ctx2, 0.5);
transparentReferencePixels = ctx2.getImageData(0, 0, 2, 2).data;
}
function createCanvas(testScenario)
{
var canvas = document.createElement("canvas");
canvas.width = 2;
canvas.height = 2;
var ctx = canvas.getContext('2d', {colorSpace: testScenario.colorSpace,
pixelFormat: testScenario.pixelFormat});
contextDrawHelper(ctx, testScenario.alpha);
return canvas;
}
function testScenarioToString(testScenario) {
var str = "ImageFormat: " + testScenario.imageFormat +
", source color space: " + testScenario.colorSpace +
", pixel format: " + testScenario.pixelFormat +
", alpha: " + testScenario.alpha;
if (testScenario.hasOwnProperty('colorSpaceConversion'))
str = str + ", intermediate color space: " +
testScenario.colorSpaceConversion;
return str;
}
function runToBlobTest(testScenario) {
var srcCanvas = createCanvas(testScenario);
var t_blob = async_test("Test if toBlob() respects legacy behavior in \
color managed canvas: " + testScenarioToString(testScenario));
var image = new Image();
image.onload = t_blob.step_func_done(function() {
var dstCanvas = document.createElement("canvas");
dstCanvas.width = 2;
dstCanvas.height = 2;
var ctx = dstCanvas.getContext('2d');
ctx.drawImage(image, 0, 0);
var actualPixels = ctx.getImageData(0, 0, 2, 2).data;
testPixels(actualPixels, testScenario.alpha);
});
srcCanvas.toBlob(function(blob) {
var urlCreator = window.URL || window.webkitURL;
image.src = urlCreator.createObjectURL(blob);
}, 'image/png', 1);
}
function runToDataURLTest(testScenario) {
var srcCanvas = createCanvas(testScenario);
var t_dataURL = async_test("Test if toDataURL() respects legacy behavior \
in color managed canvas: " + testScenarioToString(testScenario));
var image = new Image();
image.onload = t_dataURL.step_func_done(function() {
var dstCanvas = document.createElement("canvas");
dstCanvas.width = 2;
dstCanvas.height = 2;
var ctx = dstCanvas.getContext('2d');
ctx.drawImage(image, 0, 0);
var actualPixels = ctx.getImageData(0, 0, 2, 2).data;
testPixels(actualPixels, testScenario.alpha);
});
image.src = srcCanvas.toDataURL();
}
function runAllTests() {
prepareReferenceExpectedResults();
var imageFormats = ['image/jpeg', 'image/png', 'image/webp'];
var colorSpaces = [
{colorSpace: 'srgb', pixelFormat: 'uint8'},
{colorSpace: 'srgb', pixelFormat: 'float16'},
];
var alphaValues = [0.5, 1];
var testScenarioSet = [];
for (var i = 0; i < imageFormats.length; i++)
for (var j = 0; j < colorSpaces.length; j++)
for (var k = 0; k < alphaValues.length; k++) {
var testScenario = {};
testScenario.imageFormat = imageFormats[i];
testScenario.colorSpace = colorSpaces[j].colorSpace;
testScenario.pixelFormat = colorSpaces[j].pixelFormat;
testScenario.alpha = alphaValues[k];
testScenarioSet.push(testScenario);
}
for (var i = 0; i < testScenarioSet.length; i++)
runToBlobTest(testScenarioSet[i]);
for (var i = 0; i < testScenarioSet.length; i++)
runToDataURLTest(testScenarioSet[i]);
}
runAllTests();
</script>

View file

@ -0,0 +1,48 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var testScenarios = [
{testDescription: "Test default context creation parameters: srgb/uint8",
canvasColorSettings: {},
expectedColorSettings: {colorSpace: "srgb", pixelFormat: "uint8"}},
{testDescription: "Test CanvasColorSpace value srgb",
canvasColorSettings: {colorSpace: "srgb"},
expectedColorSettings: {colorSpace: "srgb", pixelFormat: "uint8"}},
{testDescription: "Test CanvasPixelFormat value uint8",
canvasColorSettings: {pixelFormat: "uint8"},
expectedColorSettings: {colorSpace: "srgb", pixelFormat: "uint8"}},
{testDescription: "Test CanvasPixelFormat value float16",
canvasColorSettings: {pixelFormat: "float16"},
expectedColorSettings: {colorSpace: "srgb", pixelFormat: "float16"}},
{testDescription: "Test supported color settings srgb/uint8",
canvasColorSettings: {colorSpace: "srgb", pixelFormat: "uint8"},
expectedColorSettings: {colorSpace: "srgb", pixelFormat: "uint8"}},
{testDescription: "Test supported color settings srgb/float16",
canvasColorSettings: {colorSpace: "srgb", pixelFormat: "float16"},
expectedColorSettings: {colorSpace: "srgb", pixelFormat: "float16"}},
];
function runTestScenario(testScenario) {
var t = test(function() {
var canvas = document. createElement('canvas');
var ctx = canvas.getContext('2d', testScenario.canvasColorSettings);
var contextAttributes = ctx.getContextAttributes();
assert_equals(contextAttributes.colorSpace,
testScenario.expectedColorSettings.colorSpace);
assert_equals(contextAttributes.pixelFormat,
testScenario.expectedColorSettings.pixelFormat);
}, testScenario.testDescription);
}
function runAllTests() {
for (var i = 0; i < testScenarios.length; i++)
runTestScenario(testScenarios[i]);
}
runAllTests();
</script>

View file

@ -0,0 +1,579 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var transparentBlack = [0, 0, 0, 0];
var e_sRGB_Red = [1, 0, 0, 1]; // sRGB(255,0,0,255)
var e_sRGB_Green = [0, 1, 0, 1]; // sRGB(0,255,0,255)
var e_sRGB_Blue = [0, 0, 1, 1]; // sRGB(0,0,255,255)
var e_sRGB_Black = [0, 0, 0, 1]; // sRGB(0,0,0,255)
// sRGB(155,27,27,255)
var e_sRGB_OpaqueRed = [0.607422, 0.105835, 0.105835, 1];
// sRGB(27,155,27,255)
var e_sRGB_OpaqueGreen = [0.105835, 0.607422, 0.105835, 1];
// sRGB(27,27,155,255)
var e_sRGB_OpaqueBlue = [0.105835, 0.105835, 0.607422, 1];
// sRGB(27,27,27,255)
var e_sRGB_OpaqueBlack = [0.105835, 0.105835, 0.105835, 1];
// sRGB(155,27,27,128)
var e_sRGB_TransparentRed = [0.607422, 0.105835, 0.105835, 0.501953];
// sRGB(27, 155, 27, 128)
var e_sRGB_TransparentGreen = [0.105835, 0.607422, 0.105835, 0.501953];
// sRGB(27, 27, 155, 128)
var e_sRGB_TransparentBlue = [0.105835, 0.105835, 0.607422, 0.501953];
// sRGB(27, 27, 27, 128)
var e_sRGB_TransparentBlack = [0.105835, 0.105835, 0.105835, 0.501953];
// sRGB(226,31,31,128)
var e_sRGB_TransparentRedImage = [0.886230, 0.121521, 0.121521, 0.501953];
// sRGB(226,31,31,128)
var e_sRGB_TransparentGreenImage = [0.121521, 0.886230, 0.121521, 0.501953];
// sRGB(226,31,31,128)
var e_sRGB_TransparentBlueImage = [0.121521, 0.121521, 0.886230, 0.501953];
// sRGB(226,31,31,128)
var e_sRGB_TransparentBlackImage = [0.121521, 0.121521, 0.121521, 0.501953];
function testPixels(ctx, tests, sourceType)
{
var actual, expected, tolerance = 0.025;
if (sourceType === 'video')
tolerance = 0.03;
for (var i = 0; i < tests.length; i++) {
actual = ctx.getImageData(tests[i][0], tests[i][1], 1, 1).dataUnion;
expected = tests[i][2];
assert_true(actual.length === expected.length);
for (var j = 0; j < actual.length; j++)
assert_approx_equals(actual[j], expected[j], tolerance, tests[i][3]);
}
}
function checkNoCrop(imageBitmap, colorInfo, sourceType)
{
var canvas = document.createElement('canvas');
canvas.width = 50;
canvas.height = 50;
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(imageBitmap, 0, 0);
var tests;
if (colorInfo == 'fullColor')
tests = [[0, 0, e_sRGB_Red, "This pixel should be e-sRGB red."],
[39, 0, e_sRGB_Green, "This pixel should be e-sRGB green."],
[0, 39, e_sRGB_Blue, "This pixel should be e-sRGB blue."],
[39, 39, e_sRGB_Black, "This pixel should be e-sRGB black."],
[41, 41, transparentBlack, "This pixel should be transparent black."]];
else if (colorInfo == 'opaque')
tests = [[0, 0, e_sRGB_OpaqueRed,
"This pixel should be e-sRGB like red."],
[39, 0, e_sRGB_OpaqueGreen,
"This pixel should be e-sRGB like green."],
[0, 39, e_sRGB_OpaqueBlue,
"This pixel should be e-sRGB like blue."],
[39, 39, e_sRGB_OpaqueBlack,
"This pixel should be e-sRGB like black."],
[41, 41, transparentBlack, "This pixel should be transparent black."]];
else if (colorInfo == 'transparent')
tests = [[0, 0, e_sRGB_TransparentRed,
"This pixel should be e-sRGB transparent red."],
[39, 0, e_sRGB_TransparentGreen,
"This pixel should be e-sRGB transparent green."],
[0, 39, e_sRGB_TransparentBlue,
"This pixel should be e-sRGB transparent blue."],
[39, 39, e_sRGB_TransparentBlack,
"This pixel should be e-sRGB transparent black."],
[41, 41, transparentBlack,
"This pixel should be transparent black."]];
else if (colorInfo === 'transparent-image')
tests = [[0, 0, e_sRGB_TransparentRedImage,
"This pixel should be e-sRGB transparent red."],
[39, 0, e_sRGB_TransparentGreenImage,
"This pixel should be e-sRGB transparent green."],
[0, 39, e_sRGB_TransparentBlueImage,
"This pixel should be e-sRGB transparent blue."],
[39, 39, e_sRGB_TransparentBlackImage,
"This pixel should be e-sRGB transparent black."],
[41, 41, transparentBlack,
"This pixel should be transparent black."]];
testPixels(ctx, tests, sourceType);
}
function checkCrop(imageBitmap, colorInfo, sourceType)
{
var canvas = document.createElement('canvas');
canvas.width = 50;
canvas.height = 50;
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(imageBitmap, 0, 0);
var tests;
if (colorInfo === 'fullColor')
tests = [[0, 0, e_sRGB_Red, "This pixel should be e-sRGB red."],
[19, 0, e_sRGB_Green, "This pixel should be e-sRGB green."],
[0, 19, e_sRGB_Blue, "This pixel should be e-sRGB blue."],
[19, 19, e_sRGB_Black, "This pixel should be e-sRGB black."],
[21, 21, transparentBlack, "This pixel should be transparent black."]];
else if (colorInfo === 'opaque')
tests = [[0, 0, e_sRGB_OpaqueRed,
"This pixel should be e-sRGB like red."],
[19, 0, e_sRGB_OpaqueGreen,
"This pixel should be e-sRGB like green."],
[0, 19, e_sRGB_OpaqueBlue,
"This pixel should be e-sRGB like blue."],
[19, 19, e_sRGB_OpaqueBlack,
"This pixel should be e-sRGB like black."],
[21, 21, transparentBlack, "This pixel should be transparent black."]];
else if (colorInfo === 'transparent')
tests = [[0, 0, e_sRGB_TransparentRed,
"This pixel should be e-sRGB transparent red."],
[19, 0, e_sRGB_TransparentGreen,
"This pixel should be e-sRGB transparent green."],
[0, 19, e_sRGB_TransparentBlue,
"This pixel should be e-sRGB transparent blue."],
[19, 19, e_sRGB_TransparentBlack,
"This pixel should be e-sRGB transparent black."],
[21, 21, transparentBlack,
"This pixel should be transparent black."]];
else if (colorInfo === 'transparent-image')
tests = [[0, 0, e_sRGB_TransparentRedImage,
"This pixel should be e-sRGB transparent red."],
[19, 0, e_sRGB_TransparentGreenImage,
"This pixel should be e-sRGB transparent green."],
[0, 19, e_sRGB_TransparentBlueImage,
"This pixel should be e-sRGB transparent blue."],
[19, 19, e_sRGB_TransparentBlackImage,
"This pixel should be e-sRGB transparent black."],
[21, 21, transparentBlack,
"This pixel should be transparent black."]];
testPixels(ctx, tests, sourceType);
}
function compareBitmaps(bitmap1, bitmap2)
{
var canvas1 = document.createElement('canvas');
var canvas2 = document.createElement('canvas');
canvas1.width = 50;
canvas1.height = 50;
canvas2.width = 50;
canvas2.height = 50;
var ctx1 = canvas1.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
var ctx2 = canvas2.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
ctx1.clearRect(0, 0, canvas1.width, canvas1.height);
ctx2.clearRect(0, 0, canvas2.width, canvas2.height);
ctx1.drawImage(bitmap1, 0, 0);
ctx2.drawImage(bitmap2, 0, 0);
var data1 = ctx1.getImageData(0, 0, 50, 50).dataUnion;
var data2 = ctx2.getImageData(0, 0, 50, 50).dataUnion;
var dataMatched = true;
for (var i = 0; i < data1.length; i++) {
if (data1[i] != data2[i]) {
dataMatched = false;
break;
}
}
assert_false(dataMatched);
}
function testImageBitmap(source, colorInfo, sourceType)
{
return Promise.all([
createImageBitmap(source, {colorSpaceConversion: "srgb",
resizeWidth: 40, resizeHeight: 40, resizeQuality: "high"}),
createImageBitmap(source, {colorSpaceConversion: "srgb",
resizeWidth: 40, resizeHeight: 40, resizeQuality: "medium"}),
createImageBitmap(source, {colorSpaceConversion: "srgb",
resizeWidth: 40, resizeHeight: 40, resizeQuality: "low"}),
createImageBitmap(source, {colorSpaceConversion: "srgb",
resizeWidth: 40, resizeHeight: 40, resizeQuality: "pixelated"}),
createImageBitmap(source, 5, 5, 10, 10, {
colorSpaceConversion: "srgb",
resizeWidth: 20, resizeHeight: 20, resizeQuality: "high"}),
createImageBitmap(source, 5, 5, 10, 10, {
colorSpaceConversion: "srgb",
resizeWidth: 20, resizeHeight: 20, resizeQuality: "medium"}),
createImageBitmap(source, 5, 5, 10, 10, {
colorSpaceConversion: "srgb",
resizeWidth: 20, resizeHeight: 20, resizeQuality: "low"}),
createImageBitmap(source, 5, 5, 10, 10, {
colorSpaceConversion: "srgb",
resizeWidth: 20, resizeHeight: 20, resizeQuality: "pixelated"}),
]).then(([noCropHigh, noCropMedium, noCropLow, noCropPixelated, cropHigh,
cropMedium, cropLow, cropPixelated]) => {
checkNoCrop(noCropHigh, colorInfo, sourceType);
checkNoCrop(noCropMedium, colorInfo, sourceType);
checkNoCrop(noCropLow, colorInfo, sourceType);
checkNoCrop(noCropPixelated, colorInfo, sourceType);
checkCrop(cropHigh, colorInfo, sourceType);
checkCrop(cropMedium, colorInfo, sourceType);
checkCrop(cropLow, colorInfo, sourceType);
checkCrop(cropPixelated, colorInfo, sourceType);
// Brute-force comparison among all bitmaps is too expensive.
// In case of SVG, resize quality does not affect the images, so all
// of them are the same and the tests fail. Since, we ignore this test
// set for SVG.
if (sourceType != 'svg') {
compareBitmaps(noCropHigh, noCropMedium);
compareBitmaps(noCropLow, noCropPixelated);
compareBitmaps(cropHigh, cropMedium);
compareBitmaps(cropLow, cropPixelated);
}
});
}
function testImageBitmapTransparent(source)
{
return testImageBitmap(source, 'transparent', 'general');
}
function testImageBitmapFromTransparentImage(source)
{
return testImageBitmap(source, 'transparent-image', 'general');
}
function testImageBitmapVideoSource(source)
{
return testImageBitmap(source, 'fullColor', 'video');
}
function testImageBitmapOpaque(source)
{
return testImageBitmap(source, 'opaque', 'general');
}
function testImageBitmapFromSVG(source)
{
return testImageBitmap(source, 'opaque', 'svg');
}
function initializeTestCanvas(canvasColorSpace, canvasPixelFormat)
{
var testCanvas = document.createElement("canvas");
testCanvas.width = 20;
testCanvas.height = 20;
var testCtx = testCanvas.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
testCtx.fillStyle = "rgba(155, 27, 27, 1)";
testCtx.fillRect(0, 0, 10, 10);
testCtx.fillStyle = "rgba(27, 155, 27, 1)";
testCtx.fillRect(10, 0, 10, 10);
testCtx.fillStyle = "rgba(27, 27, 155, 1)";
testCtx.fillRect(0, 10, 10, 10);
testCtx.fillStyle = "rgba(27, 27, 27, 1)";
testCtx.fillRect(10, 10, 10, 10);
return testCanvas;
}
function initializeTestCanvasTransparent(canvasColorSpace, canvasPixelFormat)
{
var testCanvas = document.createElement("canvas");
testCanvas.width = 20;
testCanvas.height = 20;
var testCtx = testCanvas.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
testCtx.fillStyle = "rgba(155, 27, 27, 0.5)";
testCtx.fillRect(0, 0, 10, 10);
testCtx.fillStyle = "rgba(27, 155, 27, 0.5)";
testCtx.fillRect(10, 0, 10, 10);
testCtx.fillStyle = "rgba(27, 27, 155, 0.5)";
testCtx.fillRect(0, 10, 10, 10);
testCtx.fillStyle = "rgba(27, 27, 27, 0.5)";
testCtx.fillRect(10, 10, 10, 10);
return testCanvas;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLImageElement - Opaque sRGB
// File formats: Bitmap, GIF, ICO, JPEG, PNG, WEBP
promise_test(function() {
return Promise.all(['bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map(
ext => new Promise((resolve,reject) => {
var image = new Image();
image.onload = function() {
resolve(image);
}
image.src = 'resources/pattern-srgb.' + ext;
}).then(testImageBitmapOpaque)));
}, 'createImageBitmap in e-sRGB from an opaque sRGB HTMLImageElement (BMP, \
GIF, ICO, JPG, PNG, WEBP) with resize.');
// HTMLImageElement - Transparent sRGB
// File formats: Bitmap, GIF, ICO, PNG, WEBP
promise_test(function() {
return Promise.all(['bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve,reject) => {
var image = new Image();
image.onload = function() {
resolve(image);
}
image.src = 'resources/pattern-srgb-transparent.' + ext;
}).then(testImageBitmapFromTransparentImage)));
}, 'createImageBitmap in e-sRGB from a transparent sRGB HTMLImageElement \
(BMP, ICO, PNG, WEBP) with resize.');
////////////////////////////////////////////////////////////////////////////////
// SVG Image - sRGB
promise_test(function() {
return new Promise((resolve, reject) => {
var image = new Image();
image.onload = function() {
resolve(image);
}
image.src = 'resources/pattern-srgb.svg'
}).then(testImageBitmapFromSVG);
}, 'createImageBitmap in e-sRGB from a sRGB SVG image with resize.');
////////////////////////////////////////////////////////////////////////////////
// HTMLVideoElement - sRGB
promise_test(function() {
return new Promise((resolve, reject) => {
var video = document.createElement("video");
video.oncanplaythrough = function() {
resolve(video);
}
video.src = 'resources/pattern-srgb-fullcolor.ogv'
}).then(testImageBitmapVideoSource);
}, 'createImageBitmap in e-sRGB from a sRGB HTMLVideoElement with resize.');
////////////////////////////////////////////////////////////////////////////////
// HTMLCanvasElement - Opaque sRGB
promise_test(function() {
var testCanvas = initializeTestCanvas('srgb', 'uint8');
return testImageBitmapOpaque(testCanvas);
}, 'createImageBitmap in e-sRGB from an opaque sRGB HTMLCanvasElement with resize.');
// HTMLCanvasElement - Opaque e-sRGB
promise_test(function() {
var testCanvas = initializeTestCanvas('srgb', 'float16');
return testImageBitmapOpaque(testCanvas);
}, 'createImageBitmap in e-sRGB from an opaque e-sRGB HTMLCanvasElement with resize.');
////////////////////////////////////////////////////////////////////////////////
// HTMLCanvasElement - Transparent sRGB
promise_test(function() {
var testCanvas = initializeTestCanvasTransparent('srgb', 'uint8');
return testImageBitmapTransparent(testCanvas);
}, 'createImageBitmap in e-sRGB from a transparent sRGB HTMLCanvasElement with resize.');
// HTMLCanvasElement - Transparent e-sRGB
promise_test(function() {
var testCanvas = initializeTestCanvasTransparent('srgb', 'float16');
return testImageBitmapTransparent(testCanvas);
}, 'createImageBitmap in e-sRGB from a transparent e-sRGB HTMLCanvasElement with resize.');
//////////////////////////////////////////////////////////////////////////////
// Blob from file - Opaque sRGB
promise_test(function() {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapOpaque);
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob with resize.');
// Blob form file - Transparent sRGB
promise_test(function() {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb-transparent.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapFromTransparentImage);
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob with resize.');
// Color managed blob from canvas
function testCreateImageBitmapFromColorManagedBlob(pixelFormat, isTransparent) {
let canvasPixelFormat = 'uint8';
if (pixelFormat == 'uint16')
canvasPixelFormat = 'float16';
var testCanvas;
if (isTransparent)
testCanvas = initializeTestCanvasTransparent('srgb', canvasPixelFormat);
else
testCanvas = initializeTestCanvas('srgb', canvasPixelFormat);
var encodeOptions = {};
encodeOptions.quality = 1;
encodeOptions.type = 'image/png';
encodeOptions.pixelFormat = pixelFormat;
var t = async_test('createImageBitmap in e-sRGB from color managed Blob' +
' with resize. blobPixelFormat: ' + pixelFormat +
', transparency: ' + isTransparent);
testCanvas.convertToBlob(encodeOptions).then(
t.step_func_done(function(blob) {
if (isTransparent)
testImageBitmapTransparent(blob);
else
testImageBitmapOpaque(blob);
}));
}
function runAllCreateImageBitmapFromColorManagedBlobTests() {
var blobPixelFormats = ['uint8', 'uint16'];
var transparencies = [false, true];
for (var j = 0; j < blobPixelFormats.length; j++)
for (var k = 0; k < transparencies.length; k++) {
testCreateImageBitmapFromColorManagedBlob(
blobPixelFormats[j], transparencies[k]);
}
}
runAllCreateImageBitmapFromColorManagedBlobTests();
////////////////////////////////////////////////////////////////////////////////
// ImageData - Opaque sRGB
promise_test(function() {
var canvas = initializeTestCanvas('srgb', 'uint8');
var ctx = canvas.getContext('2d');
var data = ctx.getImageData(0, 0, 20, 20);
return testImageBitmapOpaque(data);
}, 'createImageBitmap in e-sRGB from an opaque sRGB ImageData with resize.');
// ImageData - Opaque e-sRGB
promise_test(function() {
var canvas = initializeTestCanvas('srgb', 'float16');
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
var data = ctx.getImageData(0, 0, 20, 20);
return testImageBitmapOpaque(data);
}, 'createImageBitmap in e-sRGB from an opaque e-sRGB ImageData with resize.');
////////////////////////////////////////////////////////////////////////////////
// ImageData - Transparent sRGB
promise_test(function() {
var canvas = initializeTestCanvasTransparent('srgb', 'uint8');
var ctx = canvas.getContext('2d');
var data = ctx.getImageData(0, 0, 20, 20);
return testImageBitmapTransparent(data);
}, 'createImageBitmap in e-sRGB from a transparent sRGB ImageData with resize.');
// ImageData - Transparent e-sRGB
promise_test(function() {
var canvas = initializeTestCanvasTransparent('srgb', 'float16');
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
var data = ctx.getImageData(0, 0, 20, 20);
return testImageBitmapTransparent(data);
}, 'createImageBitmap in e-sRGB from a transparent e-sRGB ImageData with resize.');
////////////////////////////////////////////////////////////////////////////////
// ImageBitmap - Opaque sRGB
promise_test(function() {
var testCanvas = initializeTestCanvas('srgb', 'uint8');
return createImageBitmap(testCanvas).then(testImageBitmapOpaque);
}, 'createImageBitmap in e-sRGB from an opaque sRGB ImageBitmap with resize.');
// ImageBitmap - Opaque e-sRGB
promise_test(function() {
var testCanvas = initializeTestCanvas('srgb', 'float16');
return createImageBitmap(testCanvas, {colorSpaceConversion: "srgb"}
).then(testImageBitmapOpaque);
}, 'createImageBitmap in e-sRGB from an opaque e-sRGB ImageBitmap with resize.');
////////////////////////////////////////////////////////////////////////////////
// ImageBitmap - Transparent sRGB
promise_test(function() {
var testCanvas = initializeTestCanvasTransparent('srgb', 'uint8');
return createImageBitmap(testCanvas).then(testImageBitmapTransparent);
}, 'createImageBitmap in e-sRGB from a transparent sRGB ImageBitmap with resize.');
// ImageBitmap - Transparent e-sRGB
promise_test(function() {
var testCanvas = initializeTestCanvasTransparent('srgb', 'float16');
return createImageBitmap(testCanvas, {colorSpaceConversion: "srgb"}
).then(testImageBitmapTransparent);
}, 'createImageBitmap in e-sRGB from a transparent e-sRGB ImageBitmap with resize.');
////////////////////////////////////////////////////////////////////////////////
function initializeOffscreenCanvas(canvasColorSpace, canvasPixelFormat)
{
var canvas = document.createElement("canvas");
canvas.width = 20;
canvas.height = 20;
var offscreen = canvas.transferControlToOffscreen();
var ctx = offscreen.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
ctx.fillStyle = "rgba(155, 27, 27, 1)";
ctx.fillRect(0, 0, 10, 10);
ctx.fillStyle = "rgba(27, 155, 27, 1)";
ctx.fillRect(10, 0, 10, 10);
ctx.fillStyle = "rgba(27, 27, 155, 1)";
ctx.fillRect(0, 10, 10, 10);
ctx.fillStyle = "rgba(27, 27, 27, 1)";
ctx.fillRect(10, 10, 10, 10);
return offscreen;
}
//OffscreenCanvas - Opaque sRGB
promise_test(function() {
var offscreen = initializeOffscreenCanvas('srgb', 'uint8');
return testImageBitmapOpaque(offscreen);
}, 'createImageBitmap in e-sRGB from an opaque sRGB OffscreenCanvas with resize.');
//OffscreenCanvas - Opaque e-sRGB
promise_test(function() {
var offscreen = initializeOffscreenCanvas('srgb', 'float16');
return testImageBitmapOpaque(offscreen);
}, 'createImageBitmap in e-sRGB from an opaque e-sRGB OffscreenCanvas with resize.');
////////////////////////////////////////////////////////////////////////////////
function initializeOffscreenCanvasTransparent(canvasColorSpace, canvasPixelFormat)
{
var canvas = document.createElement("canvas");
canvas.width = 20;
canvas.height = 20;
var offscreen = canvas.transferControlToOffscreen();
var ctx = offscreen.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
ctx.fillStyle = "rgba(155, 27, 27, 0.5)";
ctx.fillRect(0, 0, 10, 10);
ctx.fillStyle = "rgba(27, 155, 27, 0.5)";
ctx.fillRect(10, 0, 10, 10);
ctx.fillStyle = "rgba(27, 27, 155, 0.5)";
ctx.fillRect(0, 10, 10, 10);
ctx.fillStyle = "rgba(27, 27, 27, 0.5)";
ctx.fillRect(10, 10, 10, 10);
return offscreen;
}
//OffscreenCanvas - Transparent sRGB
promise_test(function() {
var offscreen = initializeOffscreenCanvasTransparent('srgb', 'uint8');
return testImageBitmapTransparent(offscreen);
}, 'createImageBitmap in e-sRGB from a transparent sRGB OffscreenCanvas with resize.');
//OffscreenCanvas - Transparent e-sRGB
promise_test(function() {
var offscreen = initializeOffscreenCanvasTransparent('srgb', 'float16');
return testImageBitmapTransparent(offscreen);
}, 'createImageBitmap in e-sRGB from a transparent e-sRGB OffscreenCanvas with resize.');
////////////////////////////////////////////////////////////////////////////////
</script>

View file

@ -0,0 +1,142 @@
<!DOCTYPE html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var xWidth = xHeight = 10;
function checkImageData(canvasColorSettings, imageData) {
var imageDataColorSettings = imageData.getColorSettings();
assert_equals(canvasColorSettings.colorSpace, imageDataColorSettings.colorSpace);
if (canvasColorSettings.pixelFormat == "uint8") {
assert_equals("uint8", imageDataColorSettings.storageFormat);
assert_equals(imageData.data.length, 4 * xWidth * xHeight);
} else {
assert_equals("float32", imageDataColorSettings.storageFormat);
assert_equals(imageData.dataUnion.length, 4 * xWidth * xHeight);
}
}
// Test createImageData when the canvas is color managed
var helperImageData = new ImageData(xWidth, xHeight);
function runTestCreateImageData(canvasColorSettings) {
var aCanvas = document.createElement("canvas");
aCanvas.width = xWidth;
aCanvas.height = xHeight;
var ctx = aCanvas.getContext('2d', canvasColorSettings);
var imageData = ctx.createImageData(xWidth, xHeight);
checkImageData(canvasColorSettings, imageData);
imageData = ctx.createImageData(helperImageData);
checkImageData(canvasColorSettings, imageData);
}
var testScenariosCreateImageData = [
["Test color managed cretateImageData: {srgb, uint8} -> {srgb, uint8}",
{colorSpace: "srgb", pixelFormat: "uint8"}],
["Test color managed cretateImageData: {srgb, float16} -> {srgb, float32}",
{colorSpace: "srgb", pixelFormat: "float16"}],
];
function runCreateImageDataTests() {
for (var i = 0; i < testScenariosCreateImageData.length; i++){
var t = test(function() {
runTestCreateImageData(testScenariosCreateImageData[i][1]);
}, testScenariosCreateImageData[i][0]);
}
}
runCreateImageDataTests();
// Test getImageData when the canvas is color managed
function runTestGetImageData(canvasColorSettings) {
var aCanvas = document.createElement("canvas");
aCanvas.width = xWidth;
aCanvas.height = xHeight;
var ctx = aCanvas.getContext('2d', canvasColorSettings);
var imageData = ctx.getImageData(0, 0, xWidth, xHeight);
checkImageData(canvasColorSettings, imageData);
}
var testScenariosGetImageData = [
["Test color managed getImageData: {srgb, uint8} -> {srgb, uint8}",
{colorSpace: "srgb", pixelFormat: "uint8"}],
["Test color managed getImageData: {srgb, float16} -> {srgb, float32}",
{colorSpace: "srgb", pixelFormat: "float16"}],
];
function runGetImageDataTests() {
for (var i = 0; i < testScenariosGetImageData.length; i++){
var t = test(function() {
runTestGetImageData(testScenariosGetImageData[i][1]);
}, testScenariosGetImageData[i][0]);
}
}
runGetImageDataTests();
// Test putImageData when the canvas is color managed.
var dataU8 = new Uint8ClampedArray(4 * xWidth * xHeight);
var dataU16 = new Uint16Array(4 * xWidth * xHeight);
var dataF32 = new Float32Array(4 * xWidth * xHeight);
function prepareDataArrays() {
for (i = 0; i < 4 * xWidth * xHeight; i++) {
dataU8[i] = (i % 4 == 3) ? 255 : i % 256;
dataU16[i] = dataU8[i] * 257;
dataF32[i] = dataU8[i] / 255.0;
}
}
var testScenariosPutImageData = [];
function prepareTestScenariosPutImageData() {
var colorSpaces = ["srgb"];
var imageDataStorageFormats = ["uint8", "uint16", "float32"];
var canvasPixelFormats = ["uint8", "float16"];
for (i = 0; i < colorSpaces.length; i++)
for (j = 0; j < imageDataStorageFormats.length; j++)
for (k = 0; k < colorSpaces.length; k++)
for (l = 0; l < canvasPixelFormats.length; l++) {
testTitle = "Test color managed putImageData: ".concat(
"{", colorSpaces[i], ", ", imageDataStorageFormats[j], "} -> {", colorSpaces[k],
", ", canvasPixelFormats[l], "}");
imageDataColorSettings =
{colorSpace: colorSpaces[i], storageFormat: imageDataStorageFormats[j]};
canvasColorSettings =
{colorSpace: colorSpaces[k], pixelFormat: canvasPixelFormats[l]};
testScenariosPutImageData.push([testTitle, imageDataColorSettings, canvasColorSettings]);
}
}
function createAndPutImageData(data, imageDataColorSettings, canvasColorSettings) {
// create color managed canvas
var aCanvas = document.createElement("canvas");
aCanvas.width = xWidth;
aCanvas.height = xHeight;
var ctx = aCanvas.getContext('2d', canvasColorSettings);
// create color managed ImageData
var imageData = ctx.createImageData(data, xWidth, xHeight, imageDataColorSettings);
// put image data into canvas. test succeeds if this does not crash.
ctx.putImageData(imageData, 0, 0);
}
function runTestPutImageData(imageDataColorSettings, canvasColorSettings) {
createAndPutImageData(dataU8, imageDataColorSettings, canvasColorSettings);
createAndPutImageData(dataU16, imageDataColorSettings, canvasColorSettings);
createAndPutImageData(dataF32, imageDataColorSettings, canvasColorSettings);
}
prepareDataArrays();
prepareTestScenariosPutImageData();
function runPutImageDataTests() {
for (var i = 0; i < testScenariosPutImageData.length; i++){
var t = test(function() {
runTestPutImageData(testScenariosPutImageData[i][1]);
}, testScenariosPutImageData[i][0]);
}
}
runPutImageDataTests();
</script>
</body>

View file

@ -0,0 +1,109 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var testImagesPath = "resources/png-16bit/";
// Source of pixel comparison error in these tests:
// - color conversion from different color profiles (sRGB, Adobe RGB, Display P3,
// ProPhoto and Rec 2020) to target canvas color space (sRGB, e-sRGB).
// - comparing the result of drawing 8 bit and 16 bit PNGs with each other.
var defaultColorConversionTolerance = 8;
var wideGamutColorConversionTolerance = 0.05;
function runTest(testScenario) {
var _8bitImageSrc = testImagesPath + testScenario._8bitImagePath;
var _16bitImageSrc = testImagesPath + testScenario._16bitImagePath;
var tolerance = defaultColorConversionTolerance;
if (testScenario.canvasColorParams.pixelFormat == 'float16')
tolerance = wideGamutColorConversionTolerance;
var _8bitImage = new Image();
var _16bitImage = new Image();
var t_image = async_test(testScenarioToString(testScenario));
_8bitImage.onload = t_image.step_func(function() {
_16bitImage.onload = function() {
var refCanvas = document.createElement("canvas");
refCanvas.width = refCanvas.height = 2;
var refCtx = refCanvas.getContext(
'2d', testScenario.canvasColorParams);
refCtx.drawImage(_8bitImage, 0, 0);
var refPixels = refCtx.getImageData(0, 0, 2, 2).dataUnion;
var testCanvas = document.createElement("canvas");
testCanvas.width = testCanvas.height = 2;
var testCtx = testCanvas.getContext(
'2d', testScenario.canvasColorParams);
testCtx.drawImage(_16bitImage, 0, 0);
var testPixels = testCtx.getImageData(0, 0, 2, 2).dataUnion;
assert_array_approx_equals(refPixels, testPixels, tolerance);
t_image.done();
};
_16bitImage.src = _16bitImageSrc;
});
_8bitImage.src = _8bitImageSrc;
}
function runAllTests() {
var pngColorSpaces = [
"_sRGB",
"_AdobeRGB",
"_DisplayP3",
"_ProPhoto",
"_Rec2020",
];
var pngTransparencyStatus = [
"_opaque",
"_transparent",
];
var pngInterlaceStatus = [
"", // non-interlaced
"_interlaced",
];
var _8bitPngPrefix = "2x2_8bit";
var _16bitPngPrefix = "2x2_16bit";
var canvasColorParams = [
{colorSpace: 'srgb', pixelFormat: 'uint8'},
{colorSpace: 'srgb', pixelFormat: 'float16'},
];
var testScenarioSet = [];
var id = 1;
for (var i = 0; i < canvasColorParams.length; i++) {
for (var j = 0; j < pngColorSpaces.length; j++) {
for (var k = 0; k < pngTransparencyStatus.length; k++) {
for (var m = 0; m < pngInterlaceStatus.length; m++) {
var testScenario = {};
testScenario.canvasColorParams = canvasColorParams[i];
testScenario._8bitImagePath = _8bitPngPrefix +
pngColorSpaces[j] + pngTransparencyStatus[k] + ".png";
testScenario._16bitImagePath = _16bitPngPrefix +
pngInterlaceStatus[m] + pngColorSpaces[j] +
pngTransparencyStatus[k] + ".png";
testScenarioSet.push(testScenario);
}
}
}
}
for (var i = 0; i < testScenarioSet.length; i++)
runTest(testScenarioSet[i]);
}
function testScenarioToString(testScenario) {
var str = "Canvas color params: " +
testScenario.canvasColorParams.colorSpace + ", " +
testScenario.canvasColorParams.pixelFormat + ". Testing " +
testScenario._8bitImagePath + " vs " + testScenario._16bitImagePath;
return str;
}
runAllTests();
</script>

View file

@ -0,0 +1,53 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// sRGB(226,31,31,128)
var e_sRGB_TransparentRed = [0.886230, 0.121521, 0.121521, 0.501953];
// sRGB(226,31,31,128)
var e_sRGB_TransparentGreen = [0.121521, 0.886230, 0.121521, 0.501953];
// sRGB(226,31,31,128)
var e_sRGB_TransparentBlue = [0.121521, 0.121521, 0.886230, 0.501953];
// sRGB(226,31,31,128)
var e_sRGB_TransparentBlack = [0.121521, 0.121521, 0.121521, 0.501953];
function testPixels(ctx, tests)
{
var actual, expected, tolerance = 0.01;
for (var i = 0; i < tests.length; i++) {
actual = ctx.getImageData(tests[i].x, tests[i].y, 1, 1).dataUnion;
expected = tests[i].color;
assert_true(actual.length === expected.length);
for (var j = 0; j < actual.length; j++)
assert_approx_equals(actual[j], expected[j], tolerance);
}
}
function drawSRGBImageOnExtendedSRGBCanvas(source)
{
var canvas = document.createElement('canvas');
canvas.width = 20;
canvas.height = 20;
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
ctx.drawImage(source, 0, 0);
var tests = [{x: 5, y: 5, color: e_sRGB_TransparentRed},
{x: 15, y: 5, color: e_sRGB_TransparentGreen},
{x: 5, y: 15, color: e_sRGB_TransparentBlue},
{x: 15, y: 15, color: e_sRGB_TransparentBlack}];
testPixels(ctx, tests);
}
promise_test(function() {
return new Promise((resolve, reject) => {
var image = new Image();
image.onload = function() {
resolve(image);
}
image.src = 'resources/pattern-semitransparent-srgb.png'
}).then(drawSRGBImageOnExtendedSRGBCanvas);
}, 'Draw SRGB image on an e-sRGB canvas and read back the e-sRGB pixels.');
</script>

View file

@ -0,0 +1,176 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
function initializeBlankCanvas(canvasColorSpace, canvasPixelFormat)
{
var testCanvas = document.createElement("canvas");
testCanvas.width = 4;
testCanvas.height = 4;
var testCtx = testCanvas.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
return testCtx;
}
function initializeCanvas(canvasColorSpace, canvasPixelFormat)
{
var testCanvas = document.createElement("canvas");
testCanvas.width = 4;
testCanvas.height = 4;
var testCtx = testCanvas.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
testCtx.fillStyle = "rgba(155, 27, 27, 1)";
testCtx.fillRect(0, 0, 2, 2);
testCtx.fillStyle = "rgba(27, 155, 27, 1)";
testCtx.fillRect(2, 0, 2, 2);
testCtx.fillStyle = "rgba(27, 27, 155, 1)";
testCtx.fillRect(0, 2, 2, 2);
testCtx.fillStyle = "rgba(27, 27, 27, 1)";
testCtx.fillRect(2, 2, 2, 2);
return testCtx;
}
function initializeCanvasTransparent(canvasColorSpace, canvasPixelFormat)
{
var testCanvas = document.createElement("canvas");
testCanvas.width = 4;
testCanvas.height = 4;
var testCtx = testCanvas.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
testCtx.fillStyle = "rgba(155, 27, 27, 0.5)";
testCtx.fillRect(0, 0, 2, 2);
testCtx.fillStyle = "rgba(27, 155, 27, 0.5)";
testCtx.fillRect(2, 0, 2, 2);
testCtx.fillStyle = "rgba(27, 27, 155, 0.5)";
testCtx.fillRect(0, 2, 2, 2);
testCtx.fillStyle = "rgba(27, 27, 27, 0.5)";
testCtx.fillRect(2, 2, 2, 2);
return testCtx;
}
function initializeOffscreenCanvas(canvasColorSpace, canvasPixelFormat)
{
var canvas = document.createElement("canvas");
canvas.width = 4;
canvas.height = 4;
var offscreen = canvas.transferControlToOffscreen();
var ctx = offscreen.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
ctx.fillStyle = "rgba(155, 27, 27, 1)";
ctx.fillRect(0, 0, 2, 2);
ctx.fillStyle = "rgba(27, 155, 27, 1)";
ctx.fillRect(2, 0, 2, 2);
ctx.fillStyle = "rgba(27, 27, 155, 1)";
ctx.fillRect(0, 2, 2, 2);
ctx.fillStyle = "rgba(27, 27, 27, 1)";
ctx.fillRect(2, 2, 2, 2);
return offscreen;
}
function initializeOffscreenCanvasTransparent(canvasColorSpace, canvasPixelFormat)
{
var canvas = document.createElement("canvas");
canvas.width = 4;
canvas.height = 4;
var offscreen = canvas.transferControlToOffscreen();
var ctx = offscreen.getContext('2d',
{colorSpace: canvasColorSpace, pixelFormat:canvasPixelFormat});
ctx.fillStyle = "rgba(155, 27, 27, 0.5)";
ctx.fillRect(0, 0, 2, 2);
ctx.fillStyle = "rgba(27, 155, 27, 0.5)";
ctx.fillRect(2, 0, 2, 2);
ctx.fillStyle = "rgba(27, 27, 155, 0.5)";
ctx.fillRect(0, 2, 2, 2);
ctx.fillStyle = "rgba(27, 27, 27, 0.5)";
ctx.fillRect(2, 2, 2, 2);
return offscreen;
}
function testPixels(testCtx, refCtx, pixelFormat, isTrnasparent)
{
var actual = testCtx.getImageData(0, 0, 4, 4).dataUnion;
var expected = refCtx.getImageData(0, 0, 4, 4).dataUnion;
var tolerance = 4;
if (pixelFormat === 'float16')
tolerance = 0.02;
if (isTrnasparent)
tolerance = tolerance * 2;
assert_array_approx_equals(actual, expected, tolerance);
}
function runDrawOffscreenCanvasTestOpaque(testScenario) {
var canvas_ctx_opaque = initializeCanvas(
testScenario.canvasColorSpace, testScenario.canvasPixelFormat);
var canvas_ctx_blank = initializeBlankCanvas(
testScenario.canvasColorSpace, testScenario.canvasPixelFormat);
var offscreen_canvas_opaque = initializeOffscreenCanvas(
testScenario.imageColorSpace, testScenario.imagePixelFormat);
canvas_ctx_blank.drawImage(offscreen_canvas_opaque, 0, 0);
testPixels(canvas_ctx_blank, canvas_ctx_opaque,
testScenario.canvasPixelFormat, false);
}
function runDrawOffscreenCanvasTestTransparent(testScenario) {
var canvas_ctx_transparent = initializeCanvasTransparent(
testScenario.canvasColorSpace, testScenario.canvasPixelFormat);
var canvas_ctx_blank = initializeBlankCanvas(
testScenario.canvasColorSpace, testScenario.canvasPixelFormat);
var offscreen_canvas_transparent = initializeOffscreenCanvasTransparent(
testScenario.imageColorSpace, testScenario.imagePixelFormat);
canvas_ctx_blank.drawImage(offscreen_canvas_transparent, 0, 0);
testPixels(canvas_ctx_blank, canvas_ctx_transparent,
testScenario.canvasPixelFormat, true);
}
function runAllTests() {
var canvasColorSpaces = ['srgb'];
var canvasPixelFormats = ['uint8', 'float16'];
var testScenarioSet = [];
for (var i = 0; i < canvasColorSpaces.length; i++) {
for (var j = 0; j < canvasPixelFormats.length; j++) {
var canvas_color_space = canvasColorSpaces[i];
var canvas_pixel_format = canvasPixelFormats[j];
for (var k = 0; k < canvasColorSpaces.length; k++) {
for (var m = 0; m < canvasPixelFormats.length; m++) {
var image_host_color_space = canvasColorSpaces[k];
var image_host_pixel_format = canvasPixelFormats[m];
var testScenario = {};
testScenario.canvasColorSpace = canvas_color_space;
testScenario.canvasPixelFormat = canvas_pixel_format;
testScenario.imageColorSpace = image_host_color_space;
testScenario.imagePixelFormat = image_host_pixel_format;
testScenarioSet.push(testScenario);
}
}
}
}
for (var i = 0; i < testScenarioSet.length; i++) {
test(function(t) {
runDrawOffscreenCanvasTestOpaque(testScenarioSet[i]);
runDrawOffscreenCanvasTestTransparent(testScenarioSet[i]);
}, testScenarioToString(testScenarioSet[i]));
}
}
function testScenarioToString(testScenario) {
var str = "Test drawing color managed OffscreenCanvas: " +
"Canvas color params: " +
testScenario.canvasColorSpace + ", " +
testScenario.canvasPixelFormat +
"; OffscreenCanvas color params: " +
testScenario.imageColorSpace + ", " +
testScenario.imagePixelFormat;
return str;
}
runAllTests();
</script>

View file

@ -0,0 +1,96 @@
<!DOCTYPE html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(drawSRGBThenGetImageData_e_sRGB, 'tests drawing SRGB color on e-sRGB \
canvas and getting e-sRGB image data.');
test(putImageData_e_sRGBThenGetImageData_e_sRGB_InRange, 'tests putting and \
getting in-range e-sRGB image data on e-sRGB canvas.');
test(putImageData_e_sRGBThenGetImageData_e_sRGB_OutOfRange, 'tests putting and \
getting out-of-range e-sRGB image data on e-sRGB canvas.');
test(putImageDataSRGBThenGetImageData_e_sRGB, 'tests putting SRGB image data \
on e-sRGB canvas and getting e-sRGB image data.');
function assert_array_approx_equals(actual, expected, epsilon)
{
assert_true(actual.length === expected.length);
for (var i=0; i < actual.length; i++)
assert_approx_equals(actual[i], expected[i], epsilon);
}
function drawSRGBThenGetImageData_e_sRGB() {
var canvas = document.createElement('canvas');
canvas.width = 10;
canvas.height = 10;
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
ctx.fillStyle = 'rgba(51, 102, 153, 0.8)';
ctx.fillRect(0, 0, 10, 10);
var pixel = ctx.getImageData(5, 5, 1, 1).dataUnion;
// Check against the same color in e-sRGB. 0.01 protects the test against
// color conversion deviations.
assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01);
}
function putImageData_e_sRGBThenGetImageData_e_sRGB_InRange() {
var canvas = document.createElement('canvas');
canvas.width = 10;
canvas.height = 10;
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'})
var data_e_sRGB = new Float32Array(4);
data_e_sRGB[0] = 0.2;
data_e_sRGB[1] = 0.4;
data_e_sRGB[2] = 0.6;
data_e_sRGB[3] = 0.8;
var imageData = ctx.createImageData(data_e_sRGB, 1, 1,
{colorSpace: 'srgb', storageFormat:'float32'});
ctx.putImageData(imageData, 5, 5);
var pixel = ctx.getImageData(5, 5, 1, 1).dataUnion;
// Check against the same color in e-sRGB. 0.001 protects the test against
// rounding errors.
assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01);
}
function putImageData_e_sRGBThenGetImageData_e_sRGB_OutOfRange() {
var canvas = document.createElement('canvas');
canvas.width = 10;
canvas.height = 10;
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'})
var data_e_sRGB = new Float32Array(4);
data_e_sRGB[0] = 1.3;
data_e_sRGB[1] = -1.13;
data_e_sRGB[2] = 0.7;
data_e_sRGB[3] = 1.8;
var imageData = ctx.createImageData(data_e_sRGB, 1, 1,
{colorSpace: 'srgb', storageFormat:'float32'});
ctx.putImageData(imageData, 5, 5);
var pixel = ctx.getImageData(5, 5, 1, 1).dataUnion;
// Check against the same color in e-sRGB. 0.001 protects the test against
// rounding errors.
assert_array_approx_equals(pixel, [1.3, -1.13, 0.7, 1.8], 0.01);
}
function putImageDataSRGBThenGetImageData_e_sRGB() {
var canvas = document.createElement('canvas');
canvas.width = 10;
canvas.height = 10;
var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'});
var dataSRGB = new Uint8ClampedArray(4);
dataSRGB[0] = 51;
dataSRGB[1] = 102;
dataSRGB[2] = 153;
dataSRGB[3] = 204;
var imageData = ctx.createImageData(dataSRGB, 1, 1,
{colorSpace: 'srgb', storageFormat:'uint8'});
ctx.putImageData(imageData, 5, 5);
var pixel = ctx.getImageData(5, 5, 1, 1).dataUnion;
// Check against the same color in e-sRGB. 0.01 protects the test against
// color conversion deviations.
assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01);
}
</script>
</body>

View file

@ -0,0 +1,364 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var srgbPixels =
[[155,27,27,128, "srgbRed"], [27,155,27,128, "srgbGreen"],
[27,27,155,128, "srgbBlue"], [27,27,27,128, "srgbBlack"]];
var e_srgbPixels =
[[0.607422, 0.121521, 0.121521, 0.501953, "e_sRgbRed"],
[0.121521, 0.607422, 0.121521, 0.501953, "e_sRgbGreen"],
[0.121521, 0.121521, 0.607422, 0.501953, "e_sRgbBlue"],
[0.121521, 0.121521, 0.121521, 0.501953, "e_sRgbBlack"]];
var xWidth = xHeight = 2;
var colorCorrectionToleranceSRGB = 1;
// The error level in SRGB->WCG_U8->SRGB is higher than normal color correction
// operations as the pixels are clipped in WCG when U8 storage is used instead
// of F16 storage.
var colorCorrectionToleranceWCG_U8toSRGB_U8 = 6;
var colorCorrectionToleranceWCG = 0.02;
function testBlankPixels(actualData, width, height)
{
var message = "This pixel should be transparent black";
var blankData = new Array(4 * width * height).fill(0);
assert_array_equals(actualData, blankData, message);
}
function testPixels(actualData, expectedPixels, tolerance)
{
assert_equals(actualData.length, 4 * xWidth * xHeight);
for (var i = 0; i < xWidth * xHeight; i++) {
var message = "This pixel should be " + expectedPixels[i][4];
for (var j = 0; j < 4; j++)
assert_approx_equals(actualData[i*4+j], expectedPixels[i][j], tolerance,
message);
}
}
function checkImageDataColorSettings(canvasColorSettings, imageData) {
var imageDataColorSettings = imageData.getColorSettings();
assert_equals(canvasColorSettings.colorSpace,
imageDataColorSettings.colorSpace);
if (canvasColorSettings.pixelFormat == "uint8")
assert_equals("uint8", imageDataColorSettings.storageFormat);
else
assert_equals("float32", imageDataColorSettings.storageFormat);
}
function checkImageDataColorValues(canvasColorSettings, imageData, isBlank = '',
width = xWidth, height = xHeight, isWCG_U8toSRGB_U8 = '') {
var data = imageData.dataUnion;
if (isBlank === 'isBlank') {
testBlankPixels(data, width, height);
} else {
var expectedPixels = srgbPixels;
var tolerance = colorCorrectionToleranceSRGB;
if (isWCG_U8toSRGB_U8 === 'isWCG_U8toSRGB_U8')
tolerance = colorCorrectionToleranceWCG_U8toSRGB_U8;
if (canvasColorSettings.pixelFormat != "uint8") {
expectedPixels = e_srgbPixels;
tolerance = colorCorrectionToleranceWCG;
}
testPixels(data, expectedPixels, tolerance);
}
}
function initializeColorManagedCanvas(canvasColorSettings)
{
var canvas = document.createElement('canvas');
canvas.width = xWidth;
canvas.height = xHeight;
var ctx = canvas.getContext('2d',
{colorSpace: canvasColorSettings.colorSpace,
pixelFormat: canvasColorSettings.pixelFormat});
ctx.fillStyle = "rgba(155, 27, 27, 0.5)";
ctx.fillRect(0, 0, xWidth/2, xHeight/2);
ctx.fillStyle = "rgba(27, 155, 27, 0.5)";
ctx.fillRect(xWidth/2, 0, xWidth/2, xHeight/2);
ctx.fillStyle = "rgba(27, 27, 155, 0.5)";
ctx.fillRect(0, xHeight/2, xWidth/2, xHeight/2);
ctx.fillStyle = "rgba(27, 27, 27, 0.5)";
ctx.fillRect(xWidth/2, xHeight/2, xWidth/2, xHeight/2);
return canvas;
}
var canvasColorSettingsSet = [
{name: "SRGB", colorSettings: {colorSpace: "srgb", pixelFormat: "uint8"}},
{name: "e-SRGB", colorSettings: {colorSpace: "srgb", pixelFormat: "float16"}},
];
var srgbImageDataU8, e_srgbImageDataU16, e_srgbImageDataF32;
function PreparePredefinedImageDataObjects() {
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
srgbImageDataU8 = ctx.createImageData(xWidth, xHeight,
{colorSpace: "srgb", storageFormat: "uint8"});
e_srgbImageDataU16 = ctx.createImageData(xWidth, xHeight,
{colorSpace: "srgb", storageFormat: "uint16"});
e_srgbImageDataF32 = ctx.createImageData(xWidth, xHeight,
{colorSpace: "srgb", storageFormat: "float32"});
for (var i = 0; i < xWidth * xHeight; i++)
for (var j = 0; j < 4; j++) {
srgbImageDataU8.dataUnion[i*4+j] = srgbPixels[i][j];
e_srgbImageDataU16.dataUnion[i*4+j] =
Math.round(e_srgbPixels[i][j] * 65535);
e_srgbImageDataF32.dataUnion[i*4+j] = e_srgbPixels[i][j];
}
}
PreparePredefinedImageDataObjects();
var imageDataColorSettingsSet = [
{name: "SRGB U8", colorSettings: {colorSpace: "srgb", storageFormat: "uint8"},
imageData: srgbImageDataU8},
{name: "e-SRGB U16", colorSettings: {colorSpace: "srgb",
storageFormat: "uint16"}, imageData: e_srgbImageDataU16},
{name: "e-SRGB F32", colorSettings: {colorSpace: "srgb",
storageFormat: "float32"}, imageData: e_srgbImageDataF32},
];
////////////////////////////////////////////////////////////////////////////////
// * ImageData imagedata = ctx.createImageData(width, height);
// No color conversion. imagedata follows the color settings of the canvas.
function runTestCreateImageDataWH(canvasColorSettings) {
var canvas = initializeColorManagedCanvas(canvasColorSettings);
var ctx = canvas.getContext('2d');
var imageData = ctx.createImageData(xWidth, xHeight);
checkImageDataColorSettings(canvasColorSettings, imageData);
}
var testScenariosCreateImageDataWH = [];
for (var i = 0; i < canvasColorSettingsSet.length; i++) {
var message = "Test cretateImageData(width, height) from " +
canvasColorSettingsSet[i].name + " canvas ";
testScenariosCreateImageDataWH.
push([message, canvasColorSettingsSet[i].colorSettings]);
}
function runTestCreateImageDataWHTests() {
for (var i = 0; i < testScenariosCreateImageDataWH.length; i++){
var t = test(function() {
runTestCreateImageDataWH(testScenariosCreateImageDataWH[i][1]);
}, testScenariosCreateImageDataWH[i][0]);
}
}
runTestCreateImageDataWHTests();
////////////////////////////////////////////////////////////////////////////////
// * ImageData imagedata = ctx.getImageData(sx, sy, sw, sh);
// No color conversion. imagedata follows the color settings of the canvas.
function runTestGetImageDataXYWH(canvasColorSettings) {
var canvas = initializeColorManagedCanvas(canvasColorSettings);
var ctx = canvas.getContext('2d');
var imageData = ctx.getImageData(0, 0, xWidth, xHeight);
checkImageDataColorSettings(canvasColorSettings, imageData);
checkImageDataColorValues(canvasColorSettings, imageData);
}
var testScenariosGetImageDataXYWH = [];
for (var i = 0; i < canvasColorSettingsSet.length; i++) {
var message = "Test getImageData(sx, sy, sw, sh) from " +
canvasColorSettingsSet[i].name + " canvas ";
testScenariosGetImageDataXYWH.
push([message, canvasColorSettingsSet[i].colorSettings]);
}
function runTestGetImageDataXYWHTests() {
for (var i = 0; i < testScenariosGetImageDataXYWH.length; i++){
var t = test(function() {
runTestGetImageDataXYWH(testScenariosGetImageDataXYWH[i][1]);
}, testScenariosGetImageDataXYWH[i][0]);
}
}
runTestGetImageDataXYWHTests();
////////////////////////////////////////////////////////////////////////////////
// * void ctx.putImageData(imagedata, dx, dy, ...);
// Color conversion, if needed, to the color settings of the canvas.
function runTestPutImageDataDxDy(canvasColorSettings, imageData) {
var canvas = document.createElement('canvas');
canvas.width = xWidth * 2;
canvas.height = xHeight * 2;
var ctx = canvas.getContext('2d',
{colorSpace: canvasColorSettings.colorSpace,
pixelFormat: canvasColorSettings.pixelFormat});
ctx.putImageData(imageData, xWidth/2, xHeight/2);
var ctxImageData = ctx.getImageData(xWidth/2, xHeight/2, xWidth, xHeight);
checkImageDataColorSettings(canvasColorSettings, ctxImageData);
checkImageDataColorValues(canvasColorSettings, ctxImageData, 'noBlank',
xWidth, xHeight, 'isWCG_U8toSRGB_U8');
}
var testScenariosPutImageDataDxDy = [];
for (var i = 0; i < canvasColorSettingsSet.length; i++) {
for (var j = 0; j < imageDataColorSettingsSet.length; j++) {
var message = "Test putImageData(imagedata, dx, dy): " +
canvasColorSettingsSet[i].name + " canvas, " +
imageDataColorSettingsSet[j].name + " ImageData";
testScenariosPutImageDataDxDy.
push([message, canvasColorSettingsSet[i].colorSettings,
imageDataColorSettingsSet[j].imageData]);
}
}
function runTestPutImageDataDxDyTests() {
for (var i = 0; i < testScenariosPutImageDataDxDy.length; i++){
var t = test(function() {
runTestPutImageDataDxDy(
testScenariosPutImageDataDxDy[i][1], testScenariosPutImageDataDxDy[i][2]);
}, testScenariosPutImageDataDxDy[i][0]);
}
}
runTestPutImageDataDxDyTests();
////////////////////////////////////////////////////////////////////////////////
// * ImageData imageData = ctx.createImageData(imagedata);
// Color conversion, if needed, to the color settings of the canvas. The
// returned imageData should be transparent black.
function runTestCreateImageDataFromImageData(canvasColorSettings, imageData) {
var canvas = document.createElement('canvas');
canvas.width = xWidth * 2;
canvas.height = xHeight * 2;
var ctx = canvas.getContext('2d',
{colorSpace: canvasColorSettings.colorSpace,
pixelFormat: canvasColorSettings.pixelFormat});
var ctxImageData = ctx.createImageData(imageData);
checkImageDataColorSettings(canvasColorSettings, ctxImageData);
checkImageDataColorValues(canvasColorSettings, ctxImageData, 'isBlank');
}
var testScenariosCreateImageDataFromImageData = [];
for (var i = 0; i < canvasColorSettingsSet.length; i++) {
for (var j = 0; j < imageDataColorSettingsSet.length; j++) {
var message = "Test createImageData(imagedata): " +
canvasColorSettingsSet[i].name + " canvas, " +
imageDataColorSettingsSet[j].name + " ImageData";
testScenariosCreateImageDataFromImageData.
push([message, canvasColorSettingsSet[i].colorSettings,
imageDataColorSettingsSet[j].imageData]);
}
}
function runTestCreateImageDataFromImageDataTests() {
for (var i = 0; i < testScenariosCreateImageDataFromImageData.length; i++){
var t = test(function() {
runTestCreateImageDataFromImageData(
testScenariosCreateImageDataFromImageData[i][1],
testScenariosCreateImageDataFromImageData[i][2]);
}, testScenariosCreateImageDataFromImageData[i][0]);
}
}
runTestCreateImageDataFromImageDataTests();
////////////////////////////////////////////////////////////////////////////////
// *ImageData ctx.createImageData(width, height, imageDataColorSettings);
// No color conversion to the color settings of the canvas. Blank ImageData
// should be created based on imageDataColorSettings.
function runTestCreateImageDataWHC(canvasColorSettings, imageDataColorSettings) {
var canvas = initializeColorManagedCanvas(canvasColorSettings);
var ctx = canvas.getContext('2d');
width = height = 3;
var imageData = ctx.createImageData(width, height, imageDataColorSettings);
var colorSettings = imageData.getColorSettings();
assert_equals(colorSettings.colorSpace,
imageDataColorSettings.colorSpace,
"colorSpace should match");
assert_equals(colorSettings.storageFormat,
imageDataColorSettings.storageFormat,
"storageFormat should match");
var blankData = new Array(4 * width * height).fill(0);
assert_array_equals(imageData.dataUnion, blankData,
"ImageData should be transparent black");
}
var testScenariosCreateImageDataWHC = [];
for (var i = 0; i < canvasColorSettingsSet.length; i++) {
for (var j = 0; j < imageDataColorSettingsSet.length; j++) {
message = "Test createImageData(width, height, imageDataColorSettings): " +
canvasColorSettingsSet[i].name + " canvas, " +
imageDataColorSettingsSet[j].name + " ImageData";
testScenariosCreateImageDataWHC.
push([message, canvasColorSettingsSet[i].colorSettings,
imageDataColorSettingsSet[j].colorSettings]);
}
}
function runTestCreateImageDataWHCTests() {
for (var i = 0; i < testScenariosCreateImageDataWHC.length; i++){
var t = test(function() {
runTestCreateImageDataWHC(
testScenariosCreateImageDataWHC[i][1],
testScenariosCreateImageDataWHC[i][2]);
}, testScenariosCreateImageDataWHC[i][0]);
}
}
runTestCreateImageDataWHCTests();
////////////////////////////////////////////////////////////////////////////////
// *ImageData ctx.createImageData(data, width, height, imageDataColorSettings);
// No color conversion to the color settings of the canvas. ImageData is created
// from param "data" with proper storage format and is tagged with the
// CanvasColorSpace which is given in imageDataColorSettings.
function runTestCreateImageDataDWHC(canvasColorSettings, imageData) {
var data = imageData.dataUnion;
width = xWidth;
height = xHeight;
var colorSettings = imageData.getColorSettings();
var canvas = initializeColorManagedCanvas(canvasColorSettings);
var ctx = canvas.getContext('2d');
var newImageData = ctx.createImageData(data, width, height, colorSettings);
var newColorSettings = newImageData.getColorSettings();
assert_equals(newColorSettings.colorSpace,
colorSettings.colorSpace,
"colorSpace should match");
assert_equals(newColorSettings.storageFormat,
colorSettings.storageFormat,
"storageFormat should match");
assert_array_equals(newImageData.dataUnion, imageData.dataUnion,
"ImageData should be transparent black");
}
var testScenariosCreateImageDataDWHC = [];
for (var i = 0; i < canvasColorSettingsSet.length; i++) {
for (var j = 0; j < imageDataColorSettingsSet.length; j++) {
message = "Test createImageData(data, width, height, imageDataColorSettings): " +
canvasColorSettingsSet[i].name + " canvas, " +
imageDataColorSettingsSet[j].name + " ImageData";
testScenariosCreateImageDataDWHC.
push([message, canvasColorSettingsSet[i].colorSettings,
imageDataColorSettingsSet[j].imageData]);
}
}
function runTestCreateImageDataDWHCTests() {
for (var i = 0; i < testScenariosCreateImageDataDWHC.length; i++){
var t = test(function() {
runTestCreateImageDataDWHC(
testScenariosCreateImageDataDWHC[i][1],
testScenariosCreateImageDataDWHC[i][2]);
}, testScenariosCreateImageDataDWHC[i][0]);
}
}
runTestCreateImageDataDWHCTests();
////////////////////////////////////////////////////////////////////////////////
</script>

View file

@ -0,0 +1,71 @@
<!DOCTYPE html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var dataU8 = new Uint8ClampedArray([255, 192, 128, 64]);
var dataU16 = new Uint16Array([65535, 256*192, 256*128, 256*64]);
var dataF32 = new Float32Array([1.0, 0.75, 0.5, 0.25]);
function checkDataTypeAgainstStorageFormat(data, storageFormat) {
if (storageFormat == "uint8")
assert_equals(Object.prototype.toString.call(data), "[object Uint8ClampedArray]");
else if (storageFormat == "uint16")
assert_equals(Object.prototype.toString.call(data), "[object Uint16Array]");
else if (storageFormat == "float32")
assert_equals(Object.prototype.toString.call(data), "[object Float32Array]");
}
function checkColorSettings(colorSettings, colorSpace, storageFormat) {
assert_equals(colorSettings.colorSpace, colorSpace);
assert_equals(colorSettings.storageFormat, storageFormat);
}
function runTest(colorSettings, expectedColorSettings) {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
imageData = ctx.createImageData(1, 1, colorSettings);
checkDataTypeAgainstStorageFormat(imageData.dataUnion, colorSettings.storageFormat);
assert_array_equals(imageData.dataUnion, [0, 0, 0, 0]);
checkColorSettings(imageData.getColorSettings(), expectedColorSettings.colorSpace, expectedColorSettings.storageFormat);
imageData = ctx.createImageData(dataU8, 1, 1, colorSettings);
assert_equals(Object.prototype.toString.call(imageData.dataUnion), "[object Uint8ClampedArray]");
assert_array_equals(imageData.dataUnion, dataU8);
checkColorSettings(imageData.getColorSettings(), expectedColorSettings.colorSpace, "uint8");
imageData = ctx.createImageData(dataU16, 1, 1, colorSettings);
assert_equals(Object.prototype.toString.call(imageData.dataUnion), "[object Uint16Array]");
assert_array_equals(imageData.dataUnion, dataU16);
checkColorSettings(imageData.getColorSettings(), expectedColorSettings.colorSpace, "uint16");
imageData = ctx.createImageData(dataF32, 1, 1, colorSettings);
assert_equals(Object.prototype.toString.call(imageData.dataUnion), "[object Float32Array]");
assert_array_equals(imageData.dataUnion, dataF32);
checkColorSettings(imageData.getColorSettings(), expectedColorSettings.colorSpace, "float32");
}
var testScenarios = [
["Test default color settings: {undefined, undefined} -> {srgb, uint8}", {}, {colorSpace: "srgb", storageFormat: "uint8"}],
["Test default color space: {undefined, float32} -> {srgb, float32}", {storageFormat: "float32"}, {colorSpace: "srgb", storageFormat: "float32"}],
["Test default storage format: {srgb, undefined} -> {srgb, uint8}", {colorSpace: "srgb"}, {colorSpace: "srgb", storageFormat: "uint8"}],
["Test color settings: {srgb, uint8}", {colorSpace: "srgb", storageFormat: "uint8"}, {colorSpace: "srgb", storageFormat: "uint8"}],
["Test color settings: {srgb, uint16}", {colorSpace: "srgb", storageFormat: "uint16"}, {colorSpace: "srgb", storageFormat: "uint16"}],
["Test color settings: {srgb, float32}", {colorSpace: "srgb", storageFormat: "float32"}, {colorSpace: "srgb", storageFormat: "float32"}],
];
function runAllTests() {
for (var i = 0; i < testScenarios.length; i++){
var t = test(function() {
runTest(testScenarios[i][1], testScenarios[i][2]);
}, testScenarios[i][0]);
}
}
runAllTests();
</script>
</body>

View file

@ -0,0 +1,26 @@
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d',
{})
var dataFloat32 = new Float32Array(4);
var imageData = ctx.createImageData(dataFloat32, 1, 1,
{});
ctx.putImageData(imageData, 5, 5);
var data = ctx.getImageData(5,5,1,1).dataUnion;
}, "Putting a float-32 ImageData with no color settings on a context 2D should not crash.");
test(function() {
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d',
{})
var dataUint16 = new Uint16Array(4);
var imageData = ctx.createImageData(dataUint16, 1, 1,
{});
ctx.putImageData(imageData, 5, 5);
var data = ctx.getImageData(5,5,1,1).dataUnion;
}, "Putting a uint-16 ImageData with no color settings on a context 2D should not crash.");
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

View file

@ -0,0 +1,6 @@
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="0" y="0" width="10px" height="10px" fill="#9b1b1b"/>
<rect x="10" y="0" width="10px" height="10px" fill="#1b9b1b"/>
<rect x="0" y="10" width="10px" height="10px" fill="#1b1b9b"/>
<rect x="10" y="10" width="10px" height="10px" fill="#1b1b1b"/>
</svg>

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Some files were not shown because too many files have changed in this diff Show more