lang-pseudo-class-in-has-xhtml.xhtml (2336B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 <html class="reftest-wait" xmlns="http://www.w3.org/1999/xhtml"> 5 <head> 6 <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/> 7 <link rel="help" href="https://drafts.csswg.org/selectors/#relational"/> 8 <link rel="help" href="https://drafts.csswg.org/selectors/#lang-pseudo"/> 9 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"/> 10 </head> 11 <body> 12 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 13 <section class="lang"><div xml:lang="zh" lang="ja"></div></section> 14 <section class="lang"><div id="ja" xml:lang="ja" lang="ja"></div></section> 15 <div><section class="lang" id="fr" lang="fr" style="-webkit-locale: 'en'"><div></div></section></div> 16 <div><section class="lang" id="es" xml:lang="es"><div></div></section></div> 17 <section class="lang"><div id="kr" xml:lang="kr" lang="en"></div></section> 18 <style> 19 body > *:not(p) { background: red; } 20 section, div { width: 100px; height: 20px; } 21 .lang:has(:lang(zh)) { background: green; } 22 .lang:has(:lang(ja)) { background: red; } 23 div:has(.lang:lang(fr)) { background: red; } 24 div:has(.lang:lang(en)) { background: green; } 25 div:has(#es:lang(es)) { background: red; } 26 div:has(#es:lang(en)) { background: green; } 27 .lang:has(#kr:lang(kr)) { background: red; } 28 .lang:has(#kr:lang(kr)) { background: green; } 29 div:has(.lang > :lang(pt)) { background: red; } 30 </style> 31 <script> 32 requestAnimationFrame(() => { 33 setTimeout(() => { 34 document.getElementById('ja').setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', 'zh'); 35 document.getElementById('fr').setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', 'en'); 36 document.getElementById('es').setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', 'en'); 37 document.getElementById('kr').removeAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang'); 38 document.documentElement.className = ''; 39 }, 0); 40 }); 41 </script> 42 </body> 43 </html>