mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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,
|
||||
|
|
9
tests/wpt/meta/MANIFEST.json
vendored
9
tests/wpt/meta/MANIFEST.json
vendored
|
@ -952,6 +952,15 @@
|
|||
]
|
||||
]
|
||||
},
|
||||
"css-borders": {
|
||||
"border-image-gradient-zero-size-transform-crash.html": [
|
||||
"c722267fc08e41e1d5e4496d583fcaf4d179b2dd",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
]
|
||||
},
|
||||
"css-break": {
|
||||
"area-crash.html": [
|
||||
"d47327cde3f6a963b8c6e61280d3063b28a2d25c",
|
||||
|
|
18
tests/wpt/tests/css/css-borders/border-image-gradient-zero-size-transform-crash.html
vendored
Normal file
18
tests/wpt/tests/css/css-borders/border-image-gradient-zero-size-transform-crash.html
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
#container {
|
||||
border-style: dotted hidden;
|
||||
border-image: repeating-linear-gradient(to left top, blue, red);
|
||||
width: 0;
|
||||
transition: all 0.5s;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="container"></div>
|
||||
|
||||
<script>
|
||||
addEventListener("load", () => {
|
||||
container.style.padding = "1px";
|
||||
});
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue