Skip to content

Commit

Permalink
Add ::check pseudo element
Browse files Browse the repository at this point in the history
This pseudo element is added to allow <option> elements inside
<select> elements to have a standardized and customizable
checkmark icon.

Spec definition:
```
Option checkmark icon: the '::check' pseudo-element

The '::check' pseudo-element is only generated when the originating
element is a option element which has an ancestor select element
with base appearance.

'::check' is a tree-abiding pseudo-element. It accepts all
properties.
It inherits from its originating element.

'::check' generates a box as if it was an child of its originating
element, preceding any boxes generated by the '::before'
pseudo-element, with content as specified by 'content'.
```

Defined in:
w3c/csswg-drafts#10986

Bug: 369319576
Change-Id: Ie5058d66f90644f9732bc619a3f587b6203d1cf9
  • Loading branch information
tcaptan-cr authored and chromium-wpt-export-bot committed Oct 18, 2024
1 parent e2225ae commit bf220d2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script>
test(() => {
assert_equals(
getComputedStyle(document.querySelector('option'), '::before').content,
getComputedStyle(document.querySelector('option'), '::check').content,
`"\u2713" / ""`);
}, 'appearance:base-select options should have a checkmark with empty alt text.');
</script>

0 comments on commit bf220d2

Please sign in to comment.