Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-pseudo/selection-transparent-text-ua-background.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: transparent text uses the UA selection foreground color</title>
<link rel="author" title="Helmut Januschka" href="mailto:helmut@januschka.com">
<link rel="mismatch" href="selection-transparent-text-invisible-ref.html">
<meta name="assert" content="When the originating element has a transparent 'color' and no ::selection color is specified, the selected text is painted with the UA default selection foreground color, so it becomes visible.">
<script src="support/selections.js"></script>
<style>
#test {
color: transparent;
font-size: 300%;
}
</style>
<p>Test passes if "Selected Text" is visible (not transparent) while selected.
<div id="test">Selected Text</div>
<script>selectNodeContents(document.getElementById("test"));</script>