highlight-cascade-006.xhtml (2295B)
1 <?xml version="1.0"?><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> 2 <meta charset="utf-8"/> 3 <title>CSS Pseudo-Elements Test: highlight cascade: inheritance with both universal and namespace-universal rules</title> 4 <link rel="author" title="Delan Azabani" href="mailto:dazabani@igalia.com"/> 5 <link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#highlight-cascade"/> 6 <link rel="match" href="highlight-cascade-006-ref.xhtml"/> 7 <meta name="assert" content="This test verifies that, given both universal ::selection rules and ::selection rules that are actually non-universal due to an explicit namespace prefix or default @namespace rule, the non-universal rules are not erroneously treated as universal."/> 8 <script src="../support/selections.js"></script> 9 <style> 10 main * { all: initial; display: block; } 11 ::selection { color: green; } /* 1. universal (* means *|* if there is no default @namespace) */ 12 .red::selection { color: red; } /* 2. not universal; matches only .red */ 13 </style> 14 <style> 15 @namespace "http://example.org/default"; 16 @namespace foo "http://example.org/foo"; 17 *|*.bar::selection { color: red; } /* 3. not universal; matches only .bar */ 18 |*::selection { color: red; } /* 4. not universal; matches only no/empty xmlns */ 19 foo|*::selection { color: red; } /* 5. not universal; matches only xmlns http://example.org/foo */ 20 ::selection { color: red; } /* 6. not universal; matches only xmlns http://example.org/default */ 21 </style> 22 </head><body> 23 <main xmlns:other="http://example.org/other"> 24 <!-- div.red is red (1+2), span.bar is red (1+3), other:a is green (1) --> 25 <div class="red"><span class="bar"><other:a>green</other:a></span></div> 26 <!-- div.red is red (1+2), empty is red (1+4), other:b is green (1) --> 27 <div class="red"><empty xmlns=""><other:b>green</other:b></empty></div> 28 <!-- div.red is red (1+2), foo is red (1+5), other:c is green (1) --> 29 <div class="red"><foo xmlns="http://example.org/foo"><other:c>green</other:c></foo></div> 30 <!-- div.red is red (1+2), default is red (1+6), other:d is green (1) --> 31 <div class="red"><default xmlns="http://example.org/default"><other:d>green</other:d></default></div> 32 </main> 33 <script>selectNodeContents(document.body);</script> 34 </body></html>