blob: 861df726314c8c7b99570978639af5599baa21a2 (
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
|
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body onload="runTest()">
<div id="console"></div>
<input id="emptyOnFirstVisit" />
<form action="data:text/html,<script>history.back()</script>" name=f>
<input type="hidden" name="hidden" value="before" />
</form>
<script>
description("Bug 77391 - Hidden form elements do not save their state prior to form submission");
window.jsTestIsAsync = true;
function runTest() {
var state = document.getElementById("emptyOnFirstVisit");
if (!state.value) {
// First visit.
if (window.testRunner)
testRunner.waitUntilDone();
state.value = "visited";
document.f.hidden.value = "after";
// Submit form in a timeout to make sure that we create a new back/forward list item.
setTimeout(function() {document.f.submit();}, 0);
} else {
// Second visit.
shouldBeEqualToString("document.f.hidden.value", "after");
successfullyParsed = true;
finishJSTest();
}
}
</script>
</body>
|