New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 757442 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Review the exception types thrown by createImageBitmap

Project Member Reported by junov@chromium.org, Aug 21 2017

Issue description

It seems createImageBitmap is not always throwing the right type of exception.  For example, the are place in the code that call ImageBitmap::IsSourceSizeValid (which throws an IndexSizeError), where an InvalidStateError should be thrown.  Also there is this change to the spec: https://github.com/whatwg/html/pull/2942
 

Comment 1 by junov@chromium.org, Aug 22 2017

Owner: junov@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/57c60d68a86bcd9b7dded53d161330b7cd98e5b1

commit 57c60d68a86bcd9b7dded53d161330b7cd98e5b1
Author: Justin Novosad <junov@chromium.org>
Date: Mon Aug 28 23:22:36 2017

Fix and cleanup error handling in createImageBitmap

This CL fixes the following issues with errors generated by
createImageBitmap:
* Instead of throwing exceptions, promises are rejected (as per spec).
* resizeWidth/Height of 0 results in RangeError instead of
  InvalidStateError.
* Code refactored to centralize error handling.
* Distinction made between decode error and allocation error.
* Invalid args test re-written and migrated to web-platform-tests

BUG= 757442 

Change-Id: Ic8f5dc1a022f9b57b4d36454f5c877b26c806479
Reviewed-on: https://chromium-review.googlesource.com/628583
Commit-Queue: Justin Novosad <junov@chromium.org>
Reviewed-by: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497927}
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[delete] https://crrev.com/4af11b8f62dfebd1d2a36a554da4fb2039920ea4/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-drawImage.html
[add] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/external/wpt/imagebitmap/createImageBitmap-invalid-args.html
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageBitmap-close-expected.txt
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageData-neutered-source-expected.txt
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-args-in-workers-expected.txt
[delete] https://crrev.com/4af11b8f62dfebd1d2a36a554da4fb2039920ea4/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-args.html
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-invalid-blob-in-workers-expected.txt
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg-no-intrinsic-size-expected.txt
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/HTMLVideoElement.h
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/ImageData.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/ImageData.h
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/canvas/ImageElementBase.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/html/canvas/ImageElementBase.h
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.h
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.idl
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.h
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/57c60d68a86bcd9b7dded53d161330b7cd98e5b1/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h

Comment 3 by junov@chromium.org, Aug 29 2017

Status: Fixed (was: Started)

Sign in to add a comment