1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/test/test_parse_eof.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 + <meta charset=utf-8> 1.8 + <title>Test parsing behaviour of backslash just before EOF</title> 1.9 + <link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au"> 1.10 + <meta name="flags" content=""> 1.11 + <script src="/resources/testharness.js"></script> 1.12 + <script src="/resources/testharnessreport.js"></script> 1.13 +</head> 1.14 +<body> 1.15 + 1.16 +<style>#a::before { content: "ab\</style> 1.17 +<style>#b { background-image: url("ab\</style> 1.18 +<style>#c { background-image: url(ab\</style> 1.19 +<style>#d { counter-reset: ab\</style> 1.20 + 1.21 +<style> 1.22 +#a-ref::before { content: "ab"; } 1.23 +#b-ref { background-image: url("ab"); } 1.24 +#c-ref { background-image: url(ab�); } 1.25 +#d-ref { counter-reset: ab�; } 1.26 +</style> 1.27 + 1.28 +<div style="display: none"> 1.29 + <div id="a"></div> 1.30 + <div id="b"></div> 1.31 + <div id="c"></div> 1.32 + <div id="d"></div> 1.33 + 1.34 + <div id="a-ref"></div> 1.35 + <div id="b-ref"></div> 1.36 + <div id="c-ref"></div> 1.37 + <div id="d-ref"></div> 1.38 +</div> 1.39 + 1.40 +<script> 1.41 +var a = document.getElementById("a"); 1.42 +var b = document.getElementById("b"); 1.43 +var c = document.getElementById("c"); 1.44 +var d = document.getElementById("d"); 1.45 +var a_ref = document.getElementById("a-ref"); 1.46 +var b_ref = document.getElementById("b-ref"); 1.47 +var c_ref = document.getElementById("c-ref"); 1.48 +var d_ref = document.getElementById("d-ref"); 1.49 + 1.50 +test(function() { 1.51 + assert_equals(window.getComputedStyle(a, ":before").content, 1.52 + window.getComputedStyle(a_ref, ":before").content); 1.53 +}, "test backslash before EOF inside a string"); 1.54 + 1.55 +test(function() { 1.56 + assert_equals(window.getComputedStyle(b, "").backgroundImage, 1.57 + window.getComputedStyle(b_ref, "").backgroundImage); 1.58 +}, "test backslash before EOF inside a url(\"\")"); 1.59 + 1.60 +test(function() { 1.61 + assert_equals(window.getComputedStyle(c, "").backgroundImage, 1.62 + window.getComputedStyle(c_ref, "").backgroundImage); 1.63 +}, "test backslash before EOF inside a url()"); 1.64 + 1.65 +test(function() { 1.66 + assert_equals(window.getComputedStyle(d, "").counterReset, 1.67 + window.getComputedStyle(d_ref, "").counterReset); 1.68 +}, "test backslash before EOF outside a string"); 1.69 +</script> 1.70 + 1.71 +</body> 1.72 +</html>