commit 5147cd551dca654e51cbd23b1b16f33e5c215c8e
parent 4289d1e7a1954370b278c2a75906e06ac1e2dbac
Author: Manuel Rego Casasnovas <rego@igalia.com>
Date: Tue, 21 Oct 2025 10:37:50 +0000
Bug 1995328 [wpt PR 55549] - Add WPT test for caret-shape underscore, a=testonly
Automatic update from web-platform-tests
Add WPT test for caret-shape underscore
Bug: 353713061
Change-Id: If64a1a21cae1d6a01563781ea5e31591c3a9fc19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7062410
Commit-Queue: Manuel Rego <rego@igalia.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1532317}
--
wpt-commits: db3488b786f5363690739547eed5861f7e8647ad
wpt-pr: 55549
Diffstat:
4 files changed, 78 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001-notref-1.html b/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001-notref-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<script src="/common/reftest-wait.js"></script>
+<style>
+ #target {
+ font-size: 3em;
+ caret-color: green;
+ caret-shape: bar;
+ caret-animation: manual;
+ }
+ #target:focus {
+ outline: none;
+ }
+</style>
+<p>Test passes if, when the text below is focused for editing, the text insertion caret is a green underscore.</p>
+<div id="target" contenteditable spellcheck="false">test</div>
+<script>
+ document.getElementById("target").focus();
+ takeScreenshot();
+</script>
diff --git a/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001-notref-2.html b/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001-notref-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<script src="/common/reftest-wait.js"></script>
+<style>
+ #target {
+ font-size: 3em;
+ caret-color: green;
+ caret-shape: block;
+ caret-animation: manual;
+ }
+ #target:focus {
+ outline: none;
+ }
+</style>
+<p>Test passes if, when the text below is focused for editing, the text insertion caret is a green underscore.</p>
+<div id="target" contenteditable spellcheck="false">test</div>
+<script>
+ document.getElementById("target").focus();
+ takeScreenshot();
+</script>
diff --git a/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001-notref-3.html b/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001-notref-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<style>
+ #target {
+ font-size: 3em;
+ }
+</style>
+<p>Test passes if, when the text below is focused for editing, the text insertion caret is a green underscore.</p>
+<div id="target">test</div>
diff --git a/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001.html b/testing/web-platform/tests/css/css-ui/caret-shape-underscore-001.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>caret-shape underscore</title>
+<link rel="help" href="https://drafts.csswg.org/css-ui/#caret-shape">
+<link rel="mismatch" href="caret-shape-underscore-001-notref-1.html">
+<link rel="mismatch" href="caret-shape-underscore-001-notref-2.html">
+<link rel="mismatch" href="caret-shape-underscore-001-notref-3.html">
+<meta name="assert" content="Test checks that caret-shape underscore works as expected">
+<script src="/common/reftest-wait.js"></script>
+<style>
+ #target {
+ font-size: 3em;
+ caret-color: green;
+ caret-shape: underscore;
+ caret-animation: manual;
+ }
+ #target:focus {
+ outline: none;
+ }
+</style>
+<p>Test passes if, when the text below is focused for editing, the text insertion caret is a green underscore.</p>
+<div id="target" contenteditable spellcheck="false">test</div>
+<script>
+ document.getElementById("target").focus();
+ takeScreenshot();
+</script>