Skip to content

Commit

Permalink
MS tests on formaction
Browse files Browse the repository at this point in the history
  • Loading branch information
deniak committed Jan 20, 2014
1 parent 7d5180b commit 6c3dc69
Showing 1 changed file with 29 additions and 0 deletions.
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html><head>
<title>formaction on button element</title>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<meta content="formaction on button element" name="description">
<link href="http://www.w3.org/TR/html5/attributes-common-to-form-controls.html#dom-fs-formaction" rel="help">
</head>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<div id="log"></div>
<button formaction="http://www.example.com/" style="display: none" type="submit">Submit</button>
<input formaction="http://www.example.com/" style="display: none" type="submit" value="submit">
<input style="display: none" type="submit" value="submit">

<script type="text/javascript">
test(function() {assert_equals(document.getElementsByTagName("button")[0].formAction, "http://www.example.com/")}, "formAction on button support");
test(function() {assert_equals(document.getElementsByTagName("input")[0].formAction, "http://www.example.com/")}, "formAction on input support");

var testElem = document.getElementsByTagName("input")[0];
testElem.formAction = "http://www.example.com/page2.html";

test(function() {assert_equals(document.getElementsByTagName("input")[0].formAction, "http://www.example.com/page2.html")}, "formAction on input reflects correct value after being updated by the DOM");
test(function() {assert_equals(document.getElementsByTagName("input")[0].getAttribute("formaction"), "http://www.example.com/page2.html")}, "formAction value is correct using getAttribute");

test(function() {assert_equals(document.getElementsByTagName("input")[1].formAction, "")}, "formAction no specified on input returns an empty string");
</script>
</body></html>

0 comments on commit 6c3dc69

Please sign in to comment.