1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<html>
3<head>
4<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
5<script src="../../fast/js/resources/js-test-pre.js"></script>
6<script src="../../fast/js/resources/js-test-post-function.js"></script>
7</head>
8<body onload="runTest()">
9<p id="description"></p>
10<div id="console"></div>
11<script>
12description("Test for the formtarget attribute in a button tag.");
13function runTest()
14{
15 if (window.layoutTestController) {
16 layoutTestController.setAllowUniversalAccessFromFileURLs(true);
17 layoutTestController.waitUntilDone();
18 }
19
20 // Not dumping as text since the DumpRenderTree does not dump the text content of child frames.
21 var button = document.getElementById('loadButton');
22 button.click();
23}
24
25function passingFrameLoaded()
26{
27 if (document.getElementById('passing').contentDocument.URL == "about:blank")
28 return;
29 testPassed("The formtarget attribute was successfully used.");
30 isSuccessfullyParsed();
31 if (window.layoutTestController)
32 layoutTestController.notifyDone();
33}
34
35function failingFrameLoaded()
36{
37 if (document.getElementById('failing').contentDocument.URL == "about:blank")
38 return;
39 testFailed("The formtarget attribute was not used.");
40 isSuccessfullyParsed();
41 if (window.layoutTestController)
42 layoutTestController.notifyDone();
43}
44var successfullyParsed = true;
45</script>
46<form action="resources/success.txt" method="GET" target="failingFrame">
47<button type="submit" value="form" id="loadButton" formtarget="passingFrame">
48</form>
49<iframe src="about:blank" id="passing" name="passingFrame" onload="passingFrameLoaded()"></iframe>
50<iframe src="about:blank" id="failing" name="failingFrame" onload="failingFrameLoaded()"></iframe>
51</body>
52</html>