lang-pseudo-class-empty-attribute.xhtml (1059B)
1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head> 3 <link rel="help" href="https://drafts.csswg.org/selectors/#lang-pseudo"/> 4 <style type="text/css"> 5 span {background: white;display:none} 6 span:lang(de) {background: red} 7 </style> 8 </head> 9 <body> 10 <p>Tests if empty language declarations are supported</p> 11 <p xml:lang="de"> 12 <span lang="" id="emptyLang"/> 13 <span xml:lang="" id="emptyXmlLang"/> 14 <span id="noLang"/> 15 </p> 16 <script src="/resources/testharness.js"></script> 17 <script src="/resources/testharnessreport.js"></script> 18 <script> 19 test(() => { 20 assert_equals(getComputedStyle(document.getElementById("emptyLang")).backgroundColor, "rgb(255, 255, 255)"); 21 assert_equals(getComputedStyle(document.getElementById("emptyXmlLang")).backgroundColor, "rgb(255, 255, 255)"); 22 assert_equals(getComputedStyle(document.getElementById("noLang")).backgroundColor, "rgb(255, 0, 0)"); 23 }, "Test if empty language attributes are supported"); 24 </script> 25 </body> 26 </html>