Skip to content

Commit 1042442

Browse files
schenney-chromiummoz-wptsync-bot
authored andcommitted
Bug 1638583 [wpt PR 23657] - Fix missing borders on narrow elements, a=testonly
Automatic update from web-platform-tests Fix missing borders on narrow elements A recent change for painting narrow elements whose widths falls below 0.5 under zoom has caused problems when such elements have a single pixel border. In such cases, the element size, including the border, is greater than 1 and snaps normally, but the inner border rect has non zero size below 0.5 and snaps up to size 1, instead of zero. As a result the inner border rects is the same as the outer border rect and the border is clipped out. Here we change the rounding for inner border rect to not enforce the non-zero-width constraint, as it is inappropriate in this case. Bug: 1070091 Change-Id: Ia368ca00375fe5d8a060b88c2d9e314f25679b07 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2204362 Reviewed-by: Philip Rogers <[email protected]> Commit-Queue: Stephen Chenney <[email protected]> Cr-Commit-Position: refs/heads/master@{#769828} -- wpt-commits: 70abf62abfa74a05a4abc326a9708d0fe59e1be7 wpt-pr: 23657
1 parent e78421a commit 1042442

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<title>CSS Borders: Borders appear when the element is smaller than 1/2 a pixel</title>
4+
<link rel="author" title="Stephen Chenney" href="mailto:[email protected]">
5+
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-width">
6+
<link rel="match" href="reference/borders-on-sub-unit-sized-elements-ref.html">
7+
<meta name="assert" content="Borders on elements smaller than one pixel in size
8+
should still appear." />
9+
<head>
10+
<style>
11+
#right {
12+
position: absolute;
13+
top: 10px;
14+
left: 65px;
15+
width: 0.25px;
16+
height: 50px;
17+
border-right: 1px dashed black;
18+
}
19+
#left {
20+
position: absolute;
21+
top: 10px;
22+
left: 5px;
23+
width: 0.25px;
24+
height: 50px;
25+
border-left: 1px dashed black;
26+
}
27+
#top {
28+
position: absolute;
29+
top: 5px;
30+
left: 10px;
31+
width: 50px;
32+
height: 0.25px;
33+
border-top: 1px dashed black;
34+
}
35+
#bottom {
36+
position: absolute;
37+
top: 65px;
38+
left: 10px;
39+
width: 50px;
40+
height: 0.25px;
41+
border-bottom: 1px dashed black;
42+
}
43+
</style>
44+
</head>
45+
<body>
46+
<div id="top"></div>
47+
<div id="right"></div>
48+
<div id="bottom"></div>
49+
<div id="left"></div>
50+
</body>
51+
</html>
52+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<title>CSS Borders: Borders appear when the element is smaller than 1/2 a pixel, reference</title>
4+
<link rel="author" title="Stephen Chenney" href="mailto:[email protected]">
5+
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-width">
6+
<head>
7+
<style>
8+
#right {
9+
position: absolute;
10+
top: 10px;
11+
left: 65px;
12+
width: 0px;
13+
height: 50px;
14+
border-right: 1px dashed black;
15+
}
16+
#left {
17+
position: absolute;
18+
top: 10px;
19+
left: 5px;
20+
width: 0px;
21+
height: 50px;
22+
border-left: 1px dashed black;
23+
}
24+
#top {
25+
position: absolute;
26+
top: 5px;
27+
left: 10px;
28+
width: 50px;
29+
height: 0px;
30+
border-top: 1px dashed black;
31+
}
32+
#bottom {
33+
position: absolute;
34+
top: 65px;
35+
left: 10px;
36+
width: 50px;
37+
height: 0px;
38+
border-bottom: 1px dashed black;
39+
}
40+
</style>
41+
</head>
42+
<body>
43+
<div id="top"></div>
44+
<div id="right"></div>
45+
<div id="bottom"></div>
46+
<div id="left"></div>
47+
</body>
48+
</html>
49+

0 commit comments

Comments
 (0)