summaryrefslogtreecommitdiff
path: root/dom/base/test/test_bug392511.html
blob: 13f9788f9b9cd99abe02b6590f1cf6dc3a7fc6f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=392511
-->
<head>
  <title>Test for Bug 392511</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=392511">Mozilla Bug 392511</a>
<p id="display"></p>
<div id="content" style="display: none">
  <div id="t1"><span onclick="&quot;&amp;"></span></div>  
  <div id="t2"><span foo="&quot;&amp;"></span></div>  
  <div id="t3"><span onclick='&apos;&amp;'></span></div>  
  <div id="t4"><span foo='&apos;&amp;'></span></div>  
  <div id="t5"><span onclick='"&apos;&amp;'></span></div>  
  <div id="t6"><span foo='"&apos;&amp;'></span></div>  
  <div id="t7"><span onclick="'&quot;&amp;"></span></div>  
  <div id="t8"><span foo="'&quot;&amp;"></span></div>  
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

/** Test for Bug 392511 **/

var results = [
 "\"&quot;&amp;\"",
 "\"&quot;&amp;\"",
 "\"'&amp;\"",
 "\"'&amp;\"",
 "\"&quot;'&amp;\"",
 "\"&quot;'&amp;\"",
 "\"'&quot;&amp;\"",
 "\"'&quot;&amp;\""
];
 
for (var i = 1; i <= 8; ++i) {
  var id = "t" + i;
  var str = $(id).innerHTML;
  var expect = "<span ";
  expect += (i % 2) ? "onclick" : "foo";
  expect += "=" + results[i-1] + "></span>";
  is (str, expect, "Wrong string for test " + id);
}

</script>
</pre>
</body>
</html>