wpt / css / css-borders / border-shape / border-shape-stroke-from-border.html

Status: FAIL | Duration: 21ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-borders/border-shape/border-shape-stroke-from-border.html

<!DOCTYPE html>
<title>CSS Borders Test: border-shape takes stroke from relevant border side</title>
<link rel="help" href="https://drafts.csswg.org/css-borders-4/#relevant-side-for-border-shape">
<link rel="match" href="border-shape-stroke-from-border-ref.html">
<meta name="assert" content="When border-shape provides a single shape without an explicit stroke, the stroke width and color follow the first renderable logical border side (block-start, inline-start, block-end, inline-end).">
<meta name="fuzzy" content="maxDifference=0-70;totalPixels=0-3500">
<style>
body {
  margin: 0;
}
.container {
  display: flex;
  gap: 32px;
  padding: 20px;
}
.target {
  width: 120px;
  height: 120px;
}
.single-shape {
  border-shape: circle(45px at 60px 60px);
}
.double-shape {
  border-shape: circle(100px at 60px 60px) circle(45px at 60px 60px);
}
.case1 {
  border-top: 18px solid rgb(220, 0, 0);
  border-left: 10px solid rgb(0, 140, 0);
  border-bottom: 4px solid rgb(200, 200, 0);
  border-right: 6px solid rgb(0, 0, 220);
}
.case2 {
  writing-mode: vertical-rl;
  border-top: 18px solid rgb(220, 0, 0);
  border-left: 10px solid rgb(0, 140, 0);
  border-bottom: 4px solid rgb(200, 200, 0);
  border-right: 6px solid rgb(0, 0, 220);
}
.case3 {
  writing-mode: vertical-rl;
  border-top: 18px solid rgb(220, 0, 0);
  border-left: 10px solid rgb(0, 140, 0);
  border-bottom: 4px solid rgb(200, 200, 0);
  border-right: none;
}
.case4 {
  writing-mode: vertical-lr;
  border-top: 18px solid rgb(220, 0, 0);
  border-left: 10px solid rgb(0, 140, 0);
  border-bottom: 4px solid rgb(200, 200, 0);
  border-right: none;
}
</style>
<div class="container">
  <div class="target single-shape case1"></div>
  <div class="target single-shape case2"></div>
  <div class="target single-shape case3"></div>
  <div class="target single-shape case4"></div>
</div>
<div class="container">
  <div class="target double-shape case1"></div>
  <div class="target double-shape case2"></div>
  <div class="target double-shape case3"></div>
  <div class="target double-shape case4"></div>
</div>

/css/css-borders/border-shape/border-shape-stroke-from-border-ref.html

<!DOCTYPE html>
<title>Reference for border-shape stroke derived from logical border sides</title>
<link rel="help" href="https://drafts.csswg.org/css-borders-4/#border-shape">
<style>
body {
  margin: 0;
}
.container {
  display: flex;
  gap: 32px;
  padding: 20px;
}
.target {
  width: 120px;
  height: 120px;
  overflow: visible;
  box-sizing: padding-box;
}
.case1 {
  border-width: 18px 10px 4px 6px;
  border-color: transparent;
  border-style: solid;
}
.case2 {
  writing-mode: vertical-rl;
  border-width: 18px 10px 4px 6px;
  border-color: transparent;
  border-style: solid;
}
.case3 {
  writing-mode: vertical-rl;
  border-width: 18px 10px 4px 0px;
  border-color: transparent;
  border-style: solid;
}
.case4 {
  writing-mode: vertical-lr;
  border-width: 18px 10px 4px 0px;
  border-color: transparent;
  border-style: solid;
}
</style>
<div class="container">
  <svg class="target case1" viewBox="0 0 120 120">
    <circle cx="59" cy="51" r="45" fill="none" stroke="rgb(220, 0, 0)" stroke-width="18"/>
  </svg>
  <svg class="target case2" viewBox="0 0 120 120">
    <circle cx="59" cy="51" r="45" fill="none" stroke="rgb(0, 0, 220)" stroke-width="6"/>
  </svg>
  <svg class="target case3" viewBox="0 0 120 120">
    <circle cx="65" cy="51" r="45" fill="none" stroke="rgb(220, 0, 0)" stroke-width="18"/>
  </svg>
  <svg class="target case4" viewBox="0 0 120 120">
    <circle cx="65" cy="51" r="45" fill="none" stroke="rgb(0, 140, 0)" stroke-width="10"/>
  </svg>
</div>
<div class="container">
  <svg class="target double-shape case1" viewBox="0 0 120 120">
    <circle cx="54" cy="42" r="72.5" fill="rgb(220, 0, 0)" stroke="rgb(220, 0, 0)" stroke-width="55"/>
    <circle cx="64" cy="60" r="45" fill="white"/>
  </svg>
  <svg class="target double-shape case2" viewBox="0 0 120 120">
    <circle cx="54" cy="42" r="72.5" fill="rgb(0, 0, 220)" stroke="rgb(0, 0, 220)" stroke-width="55"/>
    <circle cx="64" cy="60" r="45" fill="white"/>
  </svg>
  <svg class="target double-shape case3" viewBox="0 0 120 120">
    <circle cx="60" cy="42" r="72.5" fill="rgb(220, 0, 0)" stroke="rgb(220, 0, 0)" stroke-width="55"/>
    <circle cx="70" cy="60" r="45" fill="white"/>
  </svg>
  <svg class="target double-shape case4" viewBox="0 0 120 120">
    <circle cx="60" cy="42" r="72.5" fill="rgb(0, 140, 0)" stroke="rgb(0, 140, 0)" stroke-width="55"/>
    <circle cx="70" cy="60" r="45" fill="white"/>
  </svg>
</div>