tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

parse-attribute.html (1304B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>CSS Selectors: Attribute selectors</title>
      4 <link rel="help" href="https://drafts.csswg.org/selectors-3/#attribute-selectors">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/css/support/parsing-testcommon.js"></script>
      8 <script>
      9  // Attribute presence and value selectors
     10  test_valid_selector('[att]');
     11  test_valid_selector('[att=val]', '[att="val"]');
     12  test_valid_selector('[att~=val]', '[att~="val"]');
     13  test_valid_selector('[att|=val]', '[att|="val"]');
     14  test_valid_selector('h1[title]');
     15  test_valid_selector("span[class='example']", 'span[class="example"]');
     16  test_valid_selector('a[hreflang=fr]', 'a[hreflang="fr"]');
     17  test_valid_selector("a[hreflang|='en']", 'a[hreflang|="en"]');
     18 
     19  // Substring matching attribute selectors
     20  test_valid_selector('[att^=val]', '[att^="val"]');
     21  test_valid_selector('[att$=val]', '[att$="val"]');
     22  test_valid_selector('[att*=val]', '[att*="val"]');
     23  test_valid_selector('object[type^="image/"]');
     24  test_valid_selector('a[href$=".html"]');
     25  test_valid_selector('p[title*="hello"]');
     26 
     27  // From Attribute selectors and namespaces examples in spec:
     28  test_valid_selector('[*|att]');
     29  test_valid_selector('[|att]', '[att]');
     30 </script>