wpt / css / css-borders / border-shape / border-shape-half-border-box-default.html

Status: PASS | Duration: 5ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-borders/border-shape/border-shape-half-border-box-default.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Borders Test: border-shape defaults to half-border-box for single shape</title>
<link rel="help" href="https://drafts.csswg.org/css-borders-4/#border-shape">
<link rel="match" href="border-shape-half-border-box-default-ref.html">
<style>
body {
  margin: 0;
}
.container {
  display: flex;
  gap: 32px;
  padding: 20px;
}
.target {
  width: 100px;
  height: 100px;
  background: lightblue;
}
/* Circle with 10px border - shape should be centered in border */
#circle {
  border: 10px solid red;
  border-shape: circle(50%);
}
/* Ellipse with asymmetric borders */
#ellipse {
  border-top: 8px solid green;
  border-right: 12px solid green;
  border-bottom: 8px solid green;
  border-left: 12px solid green;
  border-shape: ellipse(50% 50%);
}
/* Inset with uniform borders */
#inset {
  border: 15px solid blue;
  border-shape: inset(10% round 20%);
}
</style>
<div class="container">
  <div class="target" id="circle"></div>
  <div class="target" id="ellipse"></div>
  <div class="target" id="inset"></div>
</div>

/css/css-borders/border-shape/border-shape-half-border-box-default-ref.html

<!DOCTYPE html>
<style>
body {
  margin: 0;
}
.container {
  display: flex;
  gap: 32px;
  padding: 20px;
}
.target {
  width: 100px;
  height: 100px;
  background: lightblue;
}
/* Circle with explicit half-border-box */
#circle {
  border: 10px solid red;
  border-shape: circle(50%) half-border-box;
}
/* Ellipse with asymmetric borders and explicit half-border-box */
#ellipse {
  border-top: 8px solid green;
  border-right: 12px solid green;
  border-bottom: 8px solid green;
  border-left: 12px solid green;
  border-shape: ellipse(50% 50%) half-border-box;
}
/* Inset with uniform borders and explicit half-border-box */
#inset {
  border: 15px solid blue;
  border-shape: inset(10% round 20%) half-border-box;
}
</style>
<div class="container">
  <div class="target" id="circle"></div>
  <div class="target" id="ellipse"></div>
  <div class="target" id="inset"></div>
</div>