mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #26296 - ramyananth:master, r=jdm
Implementing createImageBitmap <!-- Please describe your changes on the following line: --> Implementing createImageBitmap method for canvas image source. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #20650 (GitHub issue number if applicable) <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
39e4eb43c3
73 changed files with 340 additions and 46 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;
|
||||
|
@ -348,6 +351,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