mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
layout: Do not add empty border images to the display list (#37534)
Zero-sized gradient border images cause WebRender to panic, so simply don't add them to the display list. Testing: This change adds a WPT crash test. Fixes: #37432 Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
fc2135cc02
commit
bdf8c0ebc8
3 changed files with 34 additions and 0 deletions
|
@ -1509,6 +1509,13 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
};
|
||||
|
||||
let size = euclid::Size2D::new(width as i32, height as i32);
|
||||
|
||||
// If the size of the border is zero or the size of the border image is zero, just
|
||||
// don't render anything. Zero-sized gradients cause problems in WebRender.
|
||||
if size.is_empty() || border_image_size.is_empty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
let details = BorderDetails::NinePatch(NinePatchBorder {
|
||||
source,
|
||||
width: size.width,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue