mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
canvas: Apply large size limitations (#36445)
To prevent any potential crash/OOM issues with "canvas" element from "rogue" applications let's apply large size limitations for context canvas2d's draw target to Servo (similar approach in Firefox/Chromium - they limits width and height to 32767/65535 pixels). Fixes: #36155, #34117, #30164, #24710 -- - [x] ./mach build -d does not report any errors - [x] ./mach test-tidy does not report any errors - [x] There are tests for these changes tests/wpt/tests/html/canvas/element/canvas-host/2d.canvas.host.size.large.html tests/wpt/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html tests/wpt/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
parent
bd6928f3dc
commit
6b2a755736
7 changed files with 87 additions and 53 deletions
|
@ -65,7 +65,7 @@ impl OffscreenCanvasRenderingContext2D {
|
|||
}
|
||||
|
||||
pub(crate) fn set_canvas_bitmap_dimensions(&self, size: Size2D<u64>) {
|
||||
self.context.set_bitmap_dimensions(size.cast());
|
||||
self.context.set_canvas_bitmap_dimensions(size.cast());
|
||||
}
|
||||
|
||||
pub(crate) fn send_canvas_2d_msg(&self, msg: Canvas2dMsg) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue