content/base/test/test_processing_instruction_update_stylesheet.xhtml

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

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

mercurial