mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
implemented CreateImageBitmap function for Canvas image source
This commit is contained in:
parent
9dbc6554f0
commit
ef6f99d8f5
78 changed files with 394 additions and 71 deletions
|
@ -3,6 +3,9 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
||||
use crate::dom::bindings::codegen::Bindings::ImageBitmapBinding::{
|
||||
ImageBitmapOptions, ImageBitmapSource,
|
||||
};
|
||||
use crate::dom::bindings::codegen::Bindings::RequestBinding::RequestInit;
|
||||
use crate::dom::bindings::codegen::Bindings::VoidFunctionBinding::VoidFunction;
|
||||
use crate::dom::bindings::codegen::Bindings::WorkerBinding::WorkerType;
|
||||
|
@ -347,6 +350,18 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
.queue_function_as_microtask(callback);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-createimagebitmap
|
||||
fn CreateImageBitmap(
|
||||
&self,
|
||||
image: ImageBitmapSource,
|
||||
options: &ImageBitmapOptions,
|
||||
) -> Rc<Promise> {
|
||||
let p = self
|
||||
.upcast::<GlobalScope>()
|
||||
.create_image_bitmap(image, options);
|
||||
p
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
// https://fetch.spec.whatwg.org/#fetch-method
|
||||
fn Fetch(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue