mirror of
https://github.com/servo/servo.git
synced 2025-06-10 17:43:16 +00:00
Implement HTMLCanvasElement.toBlob (#34938)
This refactors some of the code that is shared with toDataURL, and updates the webidl definition to match the current spec (using a default value for the mime type). Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
9aaa6934b7
commit
44d1e2ae0d
13 changed files with 206 additions and 130 deletions
|
@ -24,6 +24,7 @@ use crate::task_manager::TaskManager;
|
|||
/// [`TaskSourceName::all`].
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, JSTraceable, MallocSizeOf, PartialEq)]
|
||||
pub(crate) enum TaskSourceName {
|
||||
Canvas,
|
||||
DOMManipulation,
|
||||
FileReading,
|
||||
HistoryTraversal,
|
||||
|
@ -44,6 +45,7 @@ pub(crate) enum TaskSourceName {
|
|||
impl From<TaskSourceName> for ScriptThreadEventCategory {
|
||||
fn from(value: TaskSourceName) -> Self {
|
||||
match value {
|
||||
TaskSourceName::Canvas => ScriptThreadEventCategory::ScriptEvent,
|
||||
TaskSourceName::DOMManipulation => ScriptThreadEventCategory::ScriptEvent,
|
||||
TaskSourceName::FileReading => ScriptThreadEventCategory::FileRead,
|
||||
TaskSourceName::HistoryTraversal => ScriptThreadEventCategory::HistoryEvent,
|
||||
|
@ -66,6 +68,7 @@ impl From<TaskSourceName> for ScriptThreadEventCategory {
|
|||
impl TaskSourceName {
|
||||
pub(crate) fn all() -> &'static [TaskSourceName] {
|
||||
&[
|
||||
TaskSourceName::Canvas,
|
||||
TaskSourceName::DOMManipulation,
|
||||
TaskSourceName::FileReading,
|
||||
TaskSourceName::HistoryTraversal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue