test_parse_eof.html (2066B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset=utf-8> 5 <title>Test parsing behaviour of backslash just before EOF</title> 6 <link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au"> 7 <meta name="flags" content=""> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 </head> 11 <body> 12 13 <style>#a::before { content: "ab\</style> 14 <style>#b { background-image: url("ab\</style> 15 <style>#c { background-image: url(ab\</style> 16 <style>#d { counter-reset: ab\</style> 17 18 <style> 19 #a-ref::before { content: "ab"; } 20 #b-ref { background-image: url("ab"); } 21 #c-ref { background-image: url(ab�); } 22 #d-ref { counter-reset: ab�; } 23 </style> 24 25 <div style="display: none"> 26 <div id="a"></div> 27 <div id="b"></div> 28 <div id="c"></div> 29 <div id="d"></div> 30 31 <div id="a-ref"></div> 32 <div id="b-ref"></div> 33 <div id="c-ref"></div> 34 <div id="d-ref"></div> 35 </div> 36 37 <script> 38 var a = document.getElementById("a"); 39 var b = document.getElementById("b"); 40 var c = document.getElementById("c"); 41 var d = document.getElementById("d"); 42 var a_ref = document.getElementById("a-ref"); 43 var b_ref = document.getElementById("b-ref"); 44 var c_ref = document.getElementById("c-ref"); 45 var d_ref = document.getElementById("d-ref"); 46 47 test(function() { 48 assert_equals(window.getComputedStyle(a, ":before").content, 49 window.getComputedStyle(a_ref, ":before").content); 50 }, "test backslash before EOF inside a string"); 51 52 test(function() { 53 assert_equals(window.getComputedStyle(b).backgroundImage, 54 window.getComputedStyle(b_ref).backgroundImage); 55 }, "test backslash before EOF inside a url(\"\")"); 56 57 test(function() { 58 assert_equals(window.getComputedStyle(c).backgroundImage, 59 window.getComputedStyle(c_ref).backgroundImage); 60 }, "test backslash before EOF inside a url()"); 61 62 test(function() { 63 assert_equals(window.getComputedStyle(d).counterReset, 64 window.getComputedStyle(d_ref).counterReset); 65 }, "test backslash before EOF outside a string"); 66 </script> 67 68 </body> 69 </html>