tenfourfox/dom/html/test/forms/test_experimental_forms_pref.html
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

44 lines
1.5 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=764481
-->
<head>
<title>Test for Bug 764481</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/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=764481">Mozilla Bug 764481</a>
<p id="display"></p>
<div id="content" style="display: none" >
</div>
<pre id="test">
<script type="application/javascript">
var input = document.createElement("input");
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", false]]}, function() {
input.type = "date";
is(input.type, "text", "input type shouldn't be date when the experimental forms are disabled");
is(input.getAttribute('type'), "date", "input 'type' attribute should not change");
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms",true]]}, function() {
// Change the type of input to text and then back to date,
// so that HTMLInputElement::ParseAttribute gets called with the pref enabled.
input.type = "text";
input.type = "date";
is(input.type, "date", "input type should be date when the experimental forms are enabled");
is(input.getAttribute('type'), "date", "input 'type' attribute should not change");
SimpleTest.finish();
});
});
</script>
</pre>
</body>
</html>