-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Implement ImageBitmap project
Josh Matthews edited this page Feb 15, 2020
·
2 revisions
Background information: Major browsers support the ImageBitmap standard which can be used to create images that ready to be drawn efficiently to HTML canvas elements. Servo is a new, experimental browser that supports these canvas APIs; the goal of this project is to implement support for image bitmaps and improve our canvasautomated test coverage as a result.
Tracking issue: (please ask questions in these issues)
- https://github.com/servo/servo/issues/20650 (implement the ImageBitmap API)
Useful references:
- Guide to getting Servo building
- Documentation for types and modules inside Servo
- Reference for implementing a new DOM interface
Initial steps:
- email the mozilla.dev.servo mailing list (be sure to subscribe to it first!) introducing your group and asking any necessary questions
- add a ImageBitmap WebIDL interface to
components/script/dom/webidls
and Rust implementation incomponents/script/dom/imagebitmap.rs
that is backed by aVec<u8>
buffer - add and implement the
createImageBitmap
method that takes no extra x/y/w/h parameters incomponent/script/dom/webidls/Window.webidl
, handling the HTMLCanvasElement and OffscreenCanvas types from the possible image sources
Subsequent steps:
- implement several remaining image source types (HTMLImageElement, ImageData, ImageBitmap)
- implement the
createImageBitmap
overload that accepts x/y/w/h parameters - implement support for ImageBitmaps as canvas image sources in
components/script/canvas_state.rs