summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-pseudo/highlight-paired-cascade-004.html
blob: 61e2b7d7f0735e75a34b043354a60ac58659083b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: paired cascade: rule includes highlight pseudos other than ::selection</title>
<link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#highlight-cascade">
<link rel="mismatch" href="highlight-paired-cascade-004-notref.html">
<meta name="assert" value="This test verifies that setting color on ::target-text suppresses any UA non-initial used value for background-color. ::target-text is a highlight pseudo with a recommended UA default background-color that is not initial (Mark), so paired cascade can be observed.">
<link rel="stylesheet" href="support/highlights.css">
<style>
    :link, :visited {
        color: blue;
    }
    main {
        font-size: 7em;
        margin: 0.5em;
    }
    main::target-text {
        /*
            Used background-color should be initial (transparent).
            https://www.w3.org/TR/CSS21/colors.html#propdef-background-color
        */
        color: black;
    }
</style>
<p>Test passes if the text below does not appear to be highlighted (<a href="">test again</a>).
<main class="highlight_reftest">quick</main>
<script>location.href = "#:~:text=quick";</script>