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
7
tests/wpt/mozilla/meta/MANIFEST.json
vendored
7
tests/wpt/mozilla/meta/MANIFEST.json
vendored
|
@ -12970,6 +12970,13 @@
|
|||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"invalid.html": [
|
||||
"d50ff1030c48794dfc92083b6fecde3f97524b7e",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
]
|
||||
},
|
||||
"canvas-oversize-serialization.html": [
|
||||
|
|
3
tests/wpt/mozilla/meta/mozilla/canvas/invalid.html.ini
vendored
Normal file
3
tests/wpt/mozilla/meta/mozilla/canvas/invalid.html.ini
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[invalid.html]
|
||||
prefs: ["dom_canvas_backend:none"]
|
||||
|
11
tests/wpt/mozilla/tests/mozilla/canvas/invalid.html
vendored
Normal file
11
tests/wpt/mozilla/tests/mozilla/canvas/invalid.html
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>empty canvas context with invalid backend pref</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<canvas id="c">
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementById('c').getContext('2d'), null);
|
||||
}, "Invalid canvas backend returns null context");
|
||||
</script>
|
2
tests/wpt/vello_canvas_subsuite.json
vendored
2
tests/wpt/vello_canvas_subsuite.json
vendored
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"vello_canvas": {
|
||||
"config": {
|
||||
"binary_args": ["--pref", "dom_canvas_vello_enabled"]
|
||||
"binary_args": ["--pref", "dom_canvas_backend=vello"]
|
||||
},
|
||||
"include": ["/html/canvas/element"]
|
||||
}
|
||||
|
|
2
tests/wpt/vello_cpu_canvas_subsuite.json
vendored
2
tests/wpt/vello_cpu_canvas_subsuite.json
vendored
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"vello_cpu_canvas": {
|
||||
"config": {
|
||||
"binary_args": ["--pref", "dom_canvas_vello_cpu_enabled"]
|
||||
"binary_args": ["--pref", "dom_canvas_backend=vello_cpu"]
|
||||
},
|
||||
"include": ["/html/canvas/element"]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue