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-empty-001.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>caret-shape block empty text</title>
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<meta name="assert" content="Test checks that caret-shape block works as expected when there's no text">
<script src="/common/reftest-wait.js"></script>
<style>
  #target {
    font: 100px/1 Ahem;
    caret-color: green;
    caret-shape: block;
    caret-animation: manual;
    width: 1ch;
    background: red;
  }
  #target:focus {
    outline: none;
  }
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="target" contenteditable spellcheck="false"></div>
<script>
  document.getElementById("target").focus();
  takeScreenshot();
</script>