test_attribute_selector_eof_behavior.html (722B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>Test for EOF behavior of attribute selectors in selectors API</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <div id="log"></div> 7 <script> 8 test(function() { 9 assert_equals(document.querySelector("[id"), 10 document.getElementById("log"), 11 "We only have one element with an id"); 12 }, "']' should be implied if EOF after attribute name"); 13 test(function() { 14 assert_equals(document.querySelector('[id="log"'), 15 document.getElementById("log"), 16 "We should find the element with id=log"); 17 }, "']' should be implied if EOF after attribute value"); 18 </script>