wpt / css / css-borders / border-shape / border-shape-ellipse-extent-keywords.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-ellipse-extent-keywords.html

<!doctype html>
<title>CSS Borders: border-shape ellipse() radial-extent keywords</title>
<link rel="help" href="https://drafts.csswg.org/css-borders-4/#border-shape">
<link rel="help" href="https://drafts.csswg.org/css-images-3/#typedef-radial-size">
<link rel="match" href="border-shape-ellipse-extent-keywords-ref.html">
<meta name="assert" content="ellipse() per-axis radial-extent keywords resolve to the distance to the closest/farthest side in each axis.">
<style>
  .box {
    width: 300px;
    height: 400px;
    margin: 50px;
    background: green;
  }
  #closest { border-shape: ellipse(closest-side closest-side at 60px 80px); }
  #farthest { border-shape: ellipse(farthest-side farthest-side at 60px 80px); }
  #closest-farthest { border-shape: ellipse(closest-side farthest-side at 60px 80px); }
  #farthest-closest { border-shape: ellipse(farthest-side closest-side at 60px 80px); }
</style>
<div id="closest" class="box"></div>
<div id="farthest" class="box"></div>
<div id="closest-farthest" class="box"></div>
<div id="farthest-closest" class="box"></div>

/css/css-borders/border-shape/border-shape-ellipse-extent-keywords-ref.html

<!doctype html>
<title>CSS Borders: border-shape ellipse() radial-extent keywords reference</title>
<link rel="help" href="https://drafts.csswg.org/css-borders-4/#border-shape">
<style>
  .box {
    width: 300px;
    height: 400px;
    margin: 50px;
    background: green;
  }
  /* closest side: x = min(60, 240) = 60, y = min(80, 320) = 80 */
  #closest { border-shape: ellipse(60px 80px at 60px 80px); }
  /* farthest side: x = max(60, 240) = 240, y = max(80, 320) = 320 */
  #farthest { border-shape: ellipse(240px 320px at 60px 80px); }
  /* closest x, farthest y */
  #closest-farthest { border-shape: ellipse(60px 320px at 60px 80px); }
  /* farthest x, closest y */
  #farthest-closest { border-shape: ellipse(240px 80px at 60px 80px); }
</style>
<div id="closest" class="box"></div>
<div id="farthest" class="box"></div>
<div id="closest-farthest" class="box"></div>
<div id="farthest-closest" class="box"></div>