mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
imagebitmap: Add missing basic functionality (#37025)
Add missing basic functionality for ImageBitmap https://html.spec.whatwg.org/multipage/#imagebitmap including new variant of creation bitmap with source rectangle https://html.spec.whatwg.org/multipage/#dom-createimagebitmap but without support of cropping bitmap data with formatting. Add ImageBitmap to CanvasImageSource union type https://html.spec.whatwg.org/multipage/#canvasimagesource Add ImageBitmap to TexImageSource for WebGL https://registry.khronos.org/webgl/specs/latest/1.0/index.html Testing: Improvements in the following WPT tests - html/canvas/element/manual/imagebitmap/* - html/canvas/element/manual/wide-gamut-canvas/* - html/semantics/embedded-content/the-canvas-element/* - webgl/tests/conformance/textures/image_bitmap_from* - webmessaging/postMessage_cross_domain_image_transfer_2d.sub.htm Fixes: https://github.com/servo/servo/issues/34112 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
parent
a3c792e5aa
commit
7f536e8092
79 changed files with 653 additions and 1232 deletions
|
@ -646,7 +646,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'Window': {
|
||||
'canGc': ['Stop', 'Fetch', 'Scroll', 'Scroll_','ScrollBy', 'ScrollBy_', 'Stop', 'Fetch', 'Open', 'CreateImageBitmap', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'canGc': ['Stop', 'Fetch', 'Scroll', 'Scroll_','ScrollBy', 'ScrollBy_', 'Stop', 'Fetch', 'Open', 'CreateImageBitmap', 'CreateImageBitmap_', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'inRealms': ['Fetch', 'GetOpener', 'WebdriverCallback', 'WebdriverException'],
|
||||
'additionalTraits': ['crate::interfaces::WindowHelpers'],
|
||||
},
|
||||
|
@ -658,7 +658,7 @@ DOMInterfaces = {
|
|||
|
||||
'WorkerGlobalScope': {
|
||||
'inRealms': ['Fetch'],
|
||||
'canGc': ['Fetch', 'CreateImageBitmap', 'ImportScripts', 'TrustedTypes'],
|
||||
'canGc': ['Fetch', 'CreateImageBitmap', 'CreateImageBitmap_', 'ImportScripts', 'TrustedTypes'],
|
||||
},
|
||||
|
||||
'Worklet': {
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef HTMLImageElement HTMLOrSVGImageElement;
|
|||
typedef (HTMLOrSVGImageElement or
|
||||
HTMLVideoElement or
|
||||
HTMLCanvasElement or
|
||||
/*ImageBitmap or*/
|
||||
ImageBitmap or
|
||||
OffscreenCanvas or
|
||||
/*VideoFrame or*/
|
||||
/*CSSImageValue*/ CSSStyleValue) CanvasImageSource;
|
||||
|
|
|
@ -24,7 +24,8 @@ typedef unsigned long GLuint;
|
|||
typedef unrestricted float GLfloat;
|
||||
typedef unrestricted float GLclampf;
|
||||
|
||||
typedef (ImageData or
|
||||
typedef (ImageBitmap or
|
||||
ImageData or
|
||||
HTMLImageElement or
|
||||
HTMLCanvasElement or
|
||||
HTMLVideoElement) TexImageSource;
|
||||
|
|
|
@ -26,8 +26,9 @@ interface mixin WindowOrWorkerGlobalScope {
|
|||
// ImageBitmap
|
||||
[Pref="dom_imagebitmap_enabled"]
|
||||
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
|
||||
// Promise<ImageBitmap> createImageBitmap(
|
||||
// ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options);
|
||||
[Pref="dom_imagebitmap_enabled"]
|
||||
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh,
|
||||
optional ImageBitmapOptions options = {});
|
||||
|
||||
// structured cloning
|
||||
[Throws]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue