1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/test/test_bug387615.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=387615 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 387615</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.13 + <style type="text/css"> 1.14 + @namespace html url(http://www.w3.org/1999/xhtml); 1.15 + a { color: red; } 1.16 + a[rel="next"] { color: green; } 1.17 + a[html|rel="next"] { color: green; } 1.18 + </style> 1.19 +</head> 1.20 +<body> 1.21 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=387615">Mozilla Bug 387615</a> 1.22 +<p id="display"><a>link</a></p> 1.23 +<div id="content" style="display: none"> 1.24 + 1.25 +</div> 1.26 +<pre id="test"> 1.27 +<script class="testbody" type="text/javascript"> 1.28 + 1.29 +/** Test for Bug 387615 **/ 1.30 + 1.31 +var htmlns = "http://www.w3.org/1999/xhtml"; 1.32 + 1.33 +var a = document.getElementById("display").firstChild; 1.34 + 1.35 +function col(elt) { return getComputedStyle(elt, "").color; } 1.36 + 1.37 +var red_cs = col(a); 1.38 +a.setAttribute("rel", "next"); 1.39 +var green_cs = col(a); 1.40 +isnot(green_cs, red_cs, "computed values for red and green are different"); 1.41 + 1.42 +a.setAttribute("rel", "NEXT"); 1.43 +is(col(a), green_cs, "rel attribute should match case insensitively"); 1.44 + 1.45 +a.removeAttribute("rel"); 1.46 +a.setAttributeNS(htmlns, "html:rel", "next"); 1.47 +is(col(a), green_cs, "html:rel attribute should match case-sensitively"); 1.48 + 1.49 +a.setAttributeNS(htmlns, "html:rel", "NEXT"); 1.50 +is(col(a), red_cs, "html:rel attribute should not match case-insensitively"); 1.51 + 1.52 +</script> 1.53 +</pre> 1.54 +</body> 1.55 +</html> 1.56 +