|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=450191 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 450191</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
10 </head> |
|
11 <body onload="run()"> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=450191">Mozilla Bug 450191</a> |
|
13 <iframe id="display" src="about:blank"></iframe> |
|
14 <pre id="test"> |
|
15 <script type="application/javascript"> |
|
16 |
|
17 /** Test for Bug 450191 **/ |
|
18 |
|
19 SimpleTest.waitForExplicitFinish(); |
|
20 |
|
21 function run() { |
|
22 var iframe = document.getElementById("display"); |
|
23 var subdoc = iframe.contentDocument; |
|
24 var subwin = iframe.contentWindow; |
|
25 |
|
26 var doctext = "<div style='font-size: 2em'>div text <table><tr><td id='t'>table text</td></tr></table></div>"; |
|
27 |
|
28 function subdoc_body_font() { |
|
29 return subwin.getComputedStyle(subdoc.body, "").fontSize; |
|
30 } |
|
31 |
|
32 function subdoc_cell_font() { |
|
33 return subwin.getComputedStyle(subdoc.getElementById("t"), "").fontSize; |
|
34 } |
|
35 |
|
36 subdoc.open(); |
|
37 subdoc.write(doctext); |
|
38 subdoc.close(); |
|
39 |
|
40 is(subdoc_cell_font(), subdoc_body_font(), |
|
41 "Quirks style sheet should be applied."); |
|
42 |
|
43 subdoc.open(); |
|
44 subdoc.write("<!DOCTYPE HTML>" + doctext); |
|
45 subdoc.close(); |
|
46 |
|
47 isnot(subdoc_cell_font(), subdoc_body_font(), |
|
48 "Quirks style sheet should NOT be applied."); |
|
49 |
|
50 subdoc.open(); |
|
51 subdoc.write(doctext); |
|
52 subdoc.close(); |
|
53 |
|
54 is(subdoc_cell_font(), subdoc_body_font(), |
|
55 "Quirks style sheet should be applied."); |
|
56 |
|
57 SimpleTest.finish(); |
|
58 } |
|
59 |
|
60 |
|
61 </script> |
|
62 </pre> |
|
63 </body> |
|
64 </html> |