servo: Border Rendering fails on simple scaling
Describe the bug:
Some border edges not displayed when zoomed out under some percentage (Threshold varies depending on screen resolution. For me it is 100%).
Same behaviour in Firefox and Servo.
But Chrome/Edge does this correctly.
To Reproduce: Open following page in Firefox/Servo. May need zoom out.
<!DOCTYPE html>
<head>
<title>Border Radius Test</title>
<style>
.hi {
height: 1.6875rem;
line-height: 1.6875rem;
text-align: center;
color: #333;
padding: 0 .625rem;
display: inline-block;
background: #fff;
position: relative;
}
.hi::after {
content: "";
width: 200%;
height: 200%;
position: absolute;
top: 0;
left: 0;
-webkit-transform: scale(.5);
transform: scale(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
box-sizing: border-box;
border: 1px solid #999;
}
</style>
</head>
<body>
<span class="hi">Hi All!</span>
</body>
</html>
Platform: Any
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 16 (15 by maintainers)
I see no border at all with that. I see a grey border with
transform: scale(.1).Anyways, this seems to be a webrender thing, so changing the behavior should be done upstream in Firefox.
I think it is indeed a bug, after further investigation.
I tested on Firefox, the computed value of each border width is always >0.54px with whatever zoom. (And scale actually does not change computed border width). But the left/upper edge still disappears below 120% Zoom.
This is further confirmed by following debug print of Fragment Tree. The border rectangle of
<div>is 101.333px * 101.333px, no matter whether you scale or not. This is not enough, as we need 102px * 102px.