mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
canvas: Make 2D context state creation failable and use dom_canvas_backend
pref for backend selection (#38310)
Before script just crashed in those cases because IPCSender was dropped, now we send `None` to tell script about the failure and fail getContext or registerPainter accordingly. This PR also unifies `dom_canvas_{backends}_enabled` prefs into `dom_canvas_backend` which is more flexible in multi-backends scenarios. Reviewable per commit. Testing: Added servo specific WPT test. --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
93d234d270
commit
ae69646371
17 changed files with 116 additions and 61 deletions
|
@ -563,7 +563,9 @@ impl PaintWorkletGlobalScopeMethods<crate::DomTypeHolder> for PaintWorkletGlobal
|
|||
}
|
||||
|
||||
// Step 19.
|
||||
let context = PaintRenderingContext2D::new(self, CanGc::note());
|
||||
let Some(context) = PaintRenderingContext2D::new(self, CanGc::note()) else {
|
||||
return Err(Error::Operation);
|
||||
};
|
||||
let definition = PaintDefinition::new(
|
||||
paint_val.handle(),
|
||||
paint_function.handle(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue