3 <title>User Stylesheet Test</title>
4 <script type="text/javascript">
5 if (window.layoutTestController) {
6 layoutTestController.dumpAsText();
8 // This won't work outside of DRT!
9 if (window.location.hash == '') {
10 layoutTestController.waitUntilDone();
11 layoutTestController.setUserStyleSheetLocation("file:///tmp/LayoutTests/http/tests/security/resources/cssStyle.css");
12 layoutTestController.setUserStyleSheetEnabled(true);
17 function backgroundCheck() {
18 var result = document.getElementById("result");
19 var myBody = document.getElementById("myBody");
21 var style = document.defaultView.getComputedStyle(myBody, null);
22 var bgColor = style.getPropertyValue("background-color");
23 if (bgColor[4] == 2) {
24 result.innerHTML = "Test Passed: Local user stylesheet loaded.";
26 result.innerHTML = "Test Failed: Local user stylesheet not loaded into remote document.";
29 if (window.layoutTestController) {
30 layoutTestController.setUserStyleSheetEnabled(false);
31 layoutTestController.notifyDone();
37 <body id="myBody" onload="backgroundCheck()">
39 This test is to see if a remote file can include a local user stylesheet.
41 To run this test manually you must set your user style sheet in your Safari preferences
42 to LayoutTests/http/tests/security/resources/cssStyle.css
44 If the background is yellow then the user stylesheet was loaded.
48 Test not run correctly.