Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/css-ui/caret-shape-block-fallback-001.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>caret-shape block fallback</title>
<link rel="match" href="caret-shape-block-fallback-001-ref.html" />
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<meta name="assert" content="Test checks that caret-shape block width should fallback to 1ch when it's impractical to determine.">
<script src="/common/reftest-wait.js"></script>
<style>
  #target {
    font: 100px/1 Ahem;
    color: green;
    caret-color: green;
    caret-shape: block;
    caret-animation: manual;
    width: 2ch;
    background: red;
  }
  #target:focus {
    outline: none;
  }
  svg {
    vertical-align: top;
  }
</style>
<p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p>
<div id="target" contenteditable spellcheck="false">X<svg width="100" height="100"></svg></div>
<script>
  target.focus();
  window.getSelection().collapse(target, 1);
  takeScreenshot();
</script>