content/base/test/test_processing_instruction_update_stylesheet.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_processing_instruction_update_stylesheet.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<?xml-stylesheet href="data:text/css;charset=UTF-8,p{color:red}" type="text/css"?>
     1.6 +<!DOCTYPE html
     1.7 +PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     1.8 +"DTD/xhtml1-strict.dtd">
     1.9 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    1.10 +<!--
    1.11 +https://bugzilla.mozilla.org/show_bug.cgi?id=888864
    1.12 +-->
    1.13 +<head>
    1.14 +  <title>Test for Bug 888864</title>
    1.15 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.16 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.17 +  <script type="application/javascript">
    1.18 +  <![CDATA[
    1.19 +
    1.20 +  /** Test for Bug 888864 **/
    1.21 +  SimpleTest.waitForExplicitFinish();
    1.22 +
    1.23 +  function changeColorAndRun(callback) {
    1.24 +    var piNode = document.firstChild;
    1.25 +    piNode.data = 'href="data:text/css;charset=UTF-8,p{color:green}" type="text/css"';
    1.26 +    piNode.addEventListener("load", callback);
    1.27 +  }
    1.28 +
    1.29 +  function runTest() {
    1.30 +    var previousColor = window.getComputedStyle(document.getElementById("display")).
    1.31 +                               getPropertyValue("color");
    1.32 +    changeColorAndRun(function() {
    1.33 +        var afterChange = window.getComputedStyle(document.getElementById("display")).
    1.34 +                                 getPropertyValue("color");
    1.35 +        isnot(previousColor, afterChange,
    1.36 +              "Color of the p element should change.");
    1.37 +        SimpleTest.finish();
    1.38 +    });
    1.39 +  }
    1.40 +  ]]>
    1.41 +</script>
    1.42 +</head>
    1.43 +<body onload="runTest();">
    1.44 +<p id="display">This changes color</p>
    1.45 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=888864">Mozilla Bug 888864</a>
    1.46 +<pre id="test">
    1.47 +</pre>
    1.48 +</body>
    1.49 +</html>

mercurial