Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/selectors/i18n/lang-pseudo-class-empty-attribute.xhtml - WPT Dashboard Interop Dashboard
 
 
  <head>
    <style type="text/css">
      span {background: white;display:none}
      span:lang(de) {background: red}
    </style>
  </head>
  <body>
    <p>Tests if empty language declarations are supported</p>
    <p xml:lang="de">
      <span lang="" id="emptyLang"/>
      <span xml:lang="" id="emptyXmlLang"/>
      <span id="noLang"/>
    </p>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script>
      test(() => {
        assert_equals(getComputedStyle(document.getElementById("emptyLang")).backgroundColor, "rgb(255, 255, 255)");
        assert_equals(getComputedStyle(document.getElementById("emptyXmlLang")).backgroundColor, "rgb(255, 255, 255)");
        assert_equals(getComputedStyle(document.getElementById("noLang")).backgroundColor, "rgb(255, 0, 0)");
      }, "Test if empty language attributes are supported");
    </script>
  </body>
</html>