content/base/test/test_processing_instruction_update_stylesheet.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <?xml-stylesheet href="data:text/css;charset=UTF-8,p{color:red}" type="text/css"?>
     3 <!DOCTYPE html
     4 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     5 "DTD/xhtml1-strict.dtd">
     6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     7 <!--
     8 https://bugzilla.mozilla.org/show_bug.cgi?id=888864
     9 -->
    10 <head>
    11   <title>Test for Bug 888864</title>
    12   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    13   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    14   <script type="application/javascript">
    15   <![CDATA[
    17   /** Test for Bug 888864 **/
    18   SimpleTest.waitForExplicitFinish();
    20   function changeColorAndRun(callback) {
    21     var piNode = document.firstChild;
    22     piNode.data = 'href="data:text/css;charset=UTF-8,p{color:green}" type="text/css"';
    23     piNode.addEventListener("load", callback);
    24   }
    26   function runTest() {
    27     var previousColor = window.getComputedStyle(document.getElementById("display")).
    28                                getPropertyValue("color");
    29     changeColorAndRun(function() {
    30         var afterChange = window.getComputedStyle(document.getElementById("display")).
    31                                  getPropertyValue("color");
    32         isnot(previousColor, afterChange,
    33               "Color of the p element should change.");
    34         SimpleTest.finish();
    35     });
    36   }
    37   ]]>
    38 </script>
    39 </head>
    40 <body onload="runTest();">
    41 <p id="display">This changes color</p>
    42 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=888864">Mozilla Bug 888864</a>
    43 <pre id="test">
    44 </pre>
    45 </body>
    46 </html>

mercurial