mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
canvas: Don't do operations on paths with uninvertible transforms (#37551)
When the path is created with an uninvertible transform, don't do any path-based operations. Now `ensure_path()` returns a `Path` object and this change adds early returns which prevent trying to use it. Testing: This change adds a WPT crash test. Fixes #36995. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
a27c9ee691
commit
e5c328d660
3 changed files with 39 additions and 42 deletions
9
tests/wpt/meta/MANIFEST.json
vendored
9
tests/wpt/meta/MANIFEST.json
vendored
|
@ -7814,6 +7814,15 @@
|
|||
],
|
||||
"element": {
|
||||
"manual": {
|
||||
"drawing-paths-to-the-canvas": {
|
||||
"fill-path-with-uninvertible-transform-crash.html": [
|
||||
"9d032ddba9637c8bee07c8cb9c4ec618a1c5d701",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
]
|
||||
},
|
||||
"filters": {
|
||||
"svg-filter-crash.html": [
|
||||
"f64379c79241409ab55535596f4cbad894f45b42",
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
let context = document.createElement("canvas").getContext("2d");
|
||||
context.moveTo(0, 0);
|
||||
context.setTransform(4, 2, 6, 3, 0, 0); // non-invertible (4 * 3 - 6 * 2 = 0)
|
||||
context.fill("nonzero");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue