Changeset 223775 in webkit
- Timestamp:
- Oct 20, 2017 10:47:09 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r223748 r223775 1 2017-10-20 Dean Jackson <dino@apple.com> 2 3 Add createImageBitmap to Window and Worker 4 https://bugs.webkit.org/show_bug.cgi?id=178573 5 <rdar://problem/35092692> 6 7 Reviewed by Sam Weinig. 8 9 Update the expected results now that createImageBitmap exists. 10 11 * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: 12 * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt: 13 * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow-expected.txt: 14 * web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt: 15 * web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha-expected.txt: 16 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-expected.txt: 17 * web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached-expected.txt: 18 1 19 2017-10-19 Antti Koivisto <antti@apple.com> 2 20 -
trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt
r223686 r223775 2 2 Harness Error (TIMEOUT), message = null 3 3 4 FAIL createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object " ReferenceError: Can't find variable: createImageBitmap"5 FAIL createImageBitmap from a Blob, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object " ReferenceError: Can't find variable: createImageBitmap"6 FAIL createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap Can't find variable: createImageBitmap7 FAIL createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object " ReferenceError: Can't find variable: createImageBitmap"8 FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap Can't find variable: createImageBitmap4 FAIL createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error" 5 FAIL createImageBitmap from a Blob, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error" 6 FAIL createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error" 7 FAIL createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error" 8 FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error" 9 9 TIMEOUT createImageBitmap from a HTMLVideoElement, and drawImage on the created ImageBitmap Test timed out 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt
r223686 r223775 2 2 Harness Error (TIMEOUT), message = null 3 3 4 FAIL createImageBitmap with a HTMLImageElement source and sw set to 0 rejects with a RangeError. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap" 5 FAIL createImageBitmap with a HTMLImageElement source and sh set to 0 rejects with a RangeError. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap" 6 FAIL createImageBitmap with a HTMLImageElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap"4 PASS createImageBitmap with a HTMLImageElement source and sw set to 0 rejects with a RangeError. 5 PASS createImageBitmap with a HTMLImageElement source and sh set to 0 rejects with a RangeError. 6 FAIL createImageBitmap with a HTMLImageElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code 7 7 TIMEOUT createImageBitmap with a HTMLVideoElement source and sw set to 0 rejects with a RangeError. Test timed out 8 8 NOTRUN createImageBitmap with a HTMLVideoElement source and sh set to 0 rejects with a RangeError. -
trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow-expected.txt
r223686 r223775 1 1 2 FAIL createImageBitmap does not crash or reject the promise when passing very large sx promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap" 3 FAIL createImageBitmap does not crash or reject the promise when passing very large sy promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap" 4 FAIL createImageBitmap does not crash or reject the promise when passing very large sw promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap" 5 FAIL createImageBitmap does not crash or reject the promise when passing very large sh promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap" 6 FAIL createImageBitmap does not crash or reject the promise when passing very large sx, sy, sw and sh promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: createImageBitmap" 2 PASS createImageBitmap does not crash or reject the promise when passing very large sx 3 PASS createImageBitmap does not crash or reject the promise when passing very large sy 4 PASS createImageBitmap does not crash or reject the promise when passing very large sw 5 PASS createImageBitmap does not crash or reject the promise when passing very large sh 6 PASS createImageBitmap does not crash or reject the promise when passing very large sx, sy, sw and sh 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt
r223079 r223775 1 1 2 FAIL Test that createImageBitmap from a bitmaprenderer canvas produces correct result Can't find variable: createImageBitmap3 FAIL Test that createImageBitmap on a bitmaprenderer canvas that never consumes any source produces correct result Can't find variable: createImageBitmap2 FAIL Test that createImageBitmap from a bitmaprenderer canvas produces correct result myCtx.transferFromImageBitmap is not a function. (In 'myCtx.transferFromImageBitmap(image)', 'myCtx.transferFromImageBitmap' is undefined) 3 FAIL Test that createImageBitmap on a bitmaprenderer canvas that never consumes any source produces correct result assert_equals: expected 10 but got 0 4 4 FAIL Test that createImageBitmap on a bitmaprenderer canvas that consumes null produces correct result ctx.transferFromImageBitmap is not a function. (In 'ctx.transferFromImageBitmap(null)', 'ctx.transferFromImageBitmap' is undefined) 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha-expected.txt
r223060 r223775 1 1 2 FAIL Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque Can't find variable: createImageBitmap3 FAIL Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha Can't find variable: createImageBitmap4 FAIL Test that the 'alpha' context creation attribute is true by default Can't find variable: createImageBitmap2 FAIL Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque promise_test: Unhandled rejection with value: object "TypeError: dstCtx.transferFromImageBitmap is not a function. (In 'dstCtx.transferFromImageBitmap(image)', 'dstCtx.transferFromImageBitmap' is undefined)" 3 FAIL Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha promise_test: Unhandled rejection with value: object "TypeError: dstCtx.transferFromImageBitmap is not a function. (In 'dstCtx.transferFromImageBitmap(image)', 'dstCtx.transferFromImageBitmap' is undefined)" 4 FAIL Test that the 'alpha' context creation attribute is true by default promise_test: Unhandled rejection with value: object "TypeError: dstCtx.transferFromImageBitmap is not a function. (In 'dstCtx.transferFromImageBitmap(image)', 'dstCtx.transferFromImageBitmap' is undefined)" 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-expected.txt
r223060 r223775 1 1 2 FAIL Test that transferFromImageBitmap(null) discards the previously transferred image Can't find variable: createImageBitmap2 FAIL Test that transferFromImageBitmap(null) discards the previously transferred image promise_test: Unhandled rejection with value: object "TypeError: bitmapCtx.transferFromImageBitmap is not a function. (In 'bitmapCtx.transferFromImageBitmap(greenImage)', 'bitmapCtx.transferFromImageBitmap' is undefined)" 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached-expected.txt
r223060 r223775 1 1 2 FAIL Test transferFromImageBitmap(image) with a detached image should throw InvalidStateError Can't find variable: createImageBitmap2 FAIL Test transferFromImageBitmap(image) with a detached image should throw InvalidStateError promise_test: Unhandled rejection with value: object "TypeError: dstCtx.transferFromImageBitmap is not a function. (In 'dstCtx.transferFromImageBitmap(image)', 'dstCtx.transferFromImageBitmap' is undefined)" 3 3 -
trunk/Source/WebCore/ChangeLog
r223766 r223775 1 2017-10-20 Dean Jackson <dino@apple.com> 2 3 Add createImageBitmap to Window and Worker 4 https://bugs.webkit.org/show_bug.cgi?id=178573 5 <rdar://problem/35092692> 6 7 Reviewed by Sam Weinig. 8 9 Implement the createImageBitmap functions that are exposed on the Window 10 and Worker objects. 11 12 Covered by the Web Platform Tests. 13 14 * html/ImageBitmap.cpp: Make sure to call suspendIfNeeded since this is 15 an ActiveDOMObject. 16 * html/ImageBitmap.h: Change the order of the classes in the Variant 17 to match the order of definitions in the IDL. 18 * page/DOMWindow.cpp: 19 (WebCore::DOMWindow::createImageBitmap): Call ImageBitmap::createPromise. 20 * page/DOMWindow.h: 21 * page/WindowOrWorkerGlobalScope.idl: Add the createImageBitmap methods. 22 * workers/WorkerGlobalScope.cpp: 23 (WebCore::WorkerGlobalScope::createImageBitmap): Call ImageBitmap::createPromise. 24 * workers/WorkerGlobalScope.h: 25 1 26 2017-10-20 Joanmarie Diggs <jdiggs@igalia.com> 2 27 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r223747 r223775 1305 1305 316FE11A0E6E1DA700BF6088 /* KeyframeAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE1100E6E1DA700BF6088 /* KeyframeAnimation.h */; }; 1306 1306 31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1307 31815A311F9A6C8F00FCBF89 /* ImageBitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D26BBF1F86D189008FF255 /* ImageBitmap.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1307 1308 318891611AB7EEA100EA627B /* missingImage@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = CDF419991AB0DA14004E64E1 /* missingImage@3x.png */; }; 1308 1309 31955A86160D199000858025 /* RenderSnapshottedPlugIn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31E8D8BA160BC94B004CE8F5 /* RenderSnapshottedPlugIn.cpp */; }; … … 30228 30229 B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */, 30229 30230 A7151BD812F1558F005A0F64 /* TextCheckerClient.h in Headers */, 30231 31815A311F9A6C8F00FCBF89 /* ImageBitmap.h in Headers */, 30230 30232 A77D0012133B0AEB00D6658C /* TextChecking.h in Headers */, 30231 30233 A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */, -
trunk/Source/WebCore/html/ImageBitmap.cpp
r223728 r223775 220 220 , m_promise(WTFMove(promise)) 221 221 { 222 suspendIfNeeded(); 222 223 } 223 224 -
trunk/Source/WebCore/html/ImageBitmap.h
r222986 r223775 49 49 using Source = Variant< 50 50 RefPtr<HTMLImageElement>, 51 #if ENABLE(VIDEO) 52 RefPtr<HTMLVideoElement>, 53 #endif 51 54 RefPtr<HTMLCanvasElement>, 52 RefPtr<HTMLVideoElement>, // FIXME: Make conditional53 55 RefPtr<ImageBitmap>, 54 56 RefPtr<Blob>, -
trunk/Source/WebCore/page/DOMWindow.cpp
r223476 r223775 1744 1744 } 1745 1745 1746 void DOMWindow::createImageBitmap(ImageBitmap::Source&& source, ImageBitmapOptions&& options, ImageBitmap::Promise&& promise) 1747 { 1748 auto* document = this->document(); 1749 if (!document) { 1750 promise.reject(InvalidStateError); 1751 return; 1752 } 1753 ImageBitmap::createPromise(*document, WTFMove(source), WTFMove(options), WTFMove(promise)); 1754 } 1755 1756 void DOMWindow::createImageBitmap(ImageBitmap::Source&& source, int sx, int sy, int sw, int sh, ImageBitmapOptions&& options, ImageBitmap::Promise&& promise) 1757 { 1758 auto* document = this->document(); 1759 if (!document) { 1760 promise.reject(InvalidStateError); 1761 return; 1762 } 1763 ImageBitmap::createPromise(*document, WTFMove(source), WTFMove(options), sx, sy, sw, sh, WTFMove(promise)); 1764 } 1765 1746 1766 bool DOMWindow::isSecureContext() const 1747 1767 { -
trunk/Source/WebCore/page/DOMWindow.h
r222422 r223775 32 32 #include "ExceptionOr.h" 33 33 #include "FrameDestructionObserver.h" 34 #include "ImageBitmap.h" 34 35 #include "ScrollToOptions.h" 35 36 #include "Supplementable.h" … … 79 80 class WebKitPoint; 80 81 82 struct ImageBitmapOptions; 81 83 struct WindowFeatures; 82 84 … … 249 251 int webkitRequestAnimationFrame(Ref<RequestAnimationFrameCallback>&&); 250 252 void cancelAnimationFrame(int id); 253 254 // ImageBitmap 255 void createImageBitmap(ImageBitmap::Source&&, ImageBitmapOptions&&, ImageBitmap::Promise&&); 256 void createImageBitmap(ImageBitmap::Source&&, int sx, int sy, int sw, int sh, ImageBitmapOptions&&, ImageBitmap::Promise&&); 251 257 252 258 // Secure Contexts -
trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl
r219873 r223775 26 26 */ 27 27 28 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO 29 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource; 30 #else 31 typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource; 32 #endif 33 34 typedef (CanvasImageSource or Blob or ImageData) ImageBitmapSource; 35 28 36 [ 29 37 NoInterfaceObject, … … 45 53 // Secure Contexts 46 54 [EnabledAtRuntime=IsSecureContextAttribute] readonly attribute boolean isSecureContext; 55 56 // ImageBitmap. 57 Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options); 58 Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options); 47 59 }; -
trunk/Source/WebCore/workers/WorkerGlobalScope.cpp
r223476 r223775 32 32 #include "Crypto.h" 33 33 #include "IDBConnectionProxy.h" 34 #include "ImageBitmapOptions.h" 34 35 #include "InspectorInstrumentation.h" 35 36 #include "Performance.h" … … 49 50 #include <inspector/ScriptCallStack.h> 50 51 51 52 52 namespace WebCore { 53 53 using namespace Inspector; … … 395 395 } 396 396 397 void WorkerGlobalScope::createImageBitmap(ImageBitmap::Source&& source, ImageBitmapOptions&& options, ImageBitmap::Promise&& promise) 398 { 399 ImageBitmap::createPromise(*this, WTFMove(source), WTFMove(options), WTFMove(promise)); 400 } 401 402 void WorkerGlobalScope::createImageBitmap(ImageBitmap::Source&& source, int sx, int sy, int sw, int sh, ImageBitmapOptions&& options, ImageBitmap::Promise&& promise) 403 { 404 ImageBitmap::createPromise(*this, WTFMove(source), WTFMove(options), sx, sy, sw, sh, WTFMove(promise)); 405 } 406 397 407 } // namespace WebCore -
trunk/Source/WebCore/workers/WorkerGlobalScope.h
r223277 r223775 30 30 #include "CacheStorageConnection.h" 31 31 #include "EventTarget.h" 32 #include "ImageBitmap.h" 32 33 #include "ScriptExecutionContext.h" 33 34 #include "Supplementable.h" … … 112 113 113 114 void removeAllEventListeners() final; 115 116 void createImageBitmap(ImageBitmap::Source&&, ImageBitmapOptions&&, ImageBitmap::Promise&&); 117 void createImageBitmap(ImageBitmap::Source&&, int sx, int sy, int sw, int sh, ImageBitmapOptions&&, ImageBitmap::Promise&&); 114 118 115 119 protected:
Note: See TracChangeset
for help on using the changeset viewer.