mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
Implement correct corner clipping for background color
Add one regression ref test. See also #19649
This commit is contained in:
parent
691bff86b6
commit
b3b49e3ff0
4 changed files with 104 additions and 15 deletions
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Filled Background with Rounded Corner</title>
|
||||
<style>
|
||||
#a {
|
||||
width: 100px;
|
||||
height: 80px;
|
||||
border: 20px blue solid;
|
||||
border-top-right-radius: 20px;
|
||||
background-color: green;
|
||||
background-clip: border-box;
|
||||
}
|
||||
#shield {
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
left: 120px;
|
||||
top: 5px;
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div id="a"></div>
|
||||
<!-- Hide the curved outside border to deal with imprecise rendering. -->
|
||||
<div id="shield"></div>
|
||||
</body>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Filled Background with Rounded Corner</title>
|
||||
<link rel="match" href="clip-rounded-corner-ref.html">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#corner-clipping">
|
||||
<style>
|
||||
#b {
|
||||
width: 100px;
|
||||
height: 80px;
|
||||
border: 20px blue solid;
|
||||
border-top-right-radius: 20px;
|
||||
background-color: green;
|
||||
background-clip: content-box;
|
||||
}
|
||||
#shield {
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
left: 120px;
|
||||
top: 5px;
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div id="b"></div>
|
||||
<!-- Hide the curved outside border to deal with imprecise rendering. -->
|
||||
<div id="shield"></div>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue