1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/forms/test/test_bug477531.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=477531 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 477531</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 + 1.14 + <style type="text/css"> 1.15 + #s { 1.16 + margin-left: 10px; 1.17 + } 1.18 + 1.19 + #s:indeterminate { 1.20 + margin-left: 30px; 1.21 + } 1.22 + </style> 1.23 +</head> 1.24 +<body> 1.25 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=477531">Mozilla Bug 477531</a> 1.26 +<p id="display"></p> 1.27 +<div id="content"> 1.28 + 1.29 +<input type="checkbox" id="s" /> 1.30 + 1.31 +</div> 1.32 +<pre id="test"> 1.33 +<script class="testbody" type="text/javascript"> 1.34 + 1.35 +/** Test for Bug 477531 **/ 1.36 +is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"), 1.37 + "10px", 1.38 + "Non-indeterminate checkbox should have a margin of 10px"); 1.39 + 1.40 +$("s").indeterminate = true; 1.41 + 1.42 +is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"), 1.43 + "30px", 1.44 + "Indeterminate checkbox should have a margin of 30px"); 1.45 + 1.46 +$("s").setAttribute("type", "radio"); 1.47 + 1.48 +is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"), 1.49 + "10px", 1.50 + "Only checkboxes should have indeterminate styles applied to them"); 1.51 + 1.52 +$("s").setAttribute("type", "checkbox"); 1.53 + 1.54 +is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"), 1.55 + "30px", 1.56 + "Setting an indeterminate element to type checkbox should give it indeterminate styles"); 1.57 + 1.58 +$("s").indeterminate = false; 1.59 + 1.60 +is(document.defaultView.getComputedStyle($("s"), null).getPropertyValue("margin-left"), 1.61 + "10px", 1.62 + "Newly non-indeterminate checkbox should have a margin of 10px"); 1.63 + 1.64 +</script> 1.65 +</pre> 1.66 +</body> 1.67 +</html> 1.68 +