Commit 1fb63eff authored by andersca's avatar andersca

2006-01-03 Anders Carlsson <andersca@mac.com>

        Reviewed by Darin.

        - Add tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=5177
        Javascript cloneNode(deep) does not clone form elements correctly

        * fast/dom/clone-node-form-elements-expected.txt: Added.
        * fast/dom/clone-node-form-elements.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c70d1c6a
2006-01-03 Anders Carlsson <andersca@mac.com>
Reviewed by Darin.
- Add tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=5177
Javascript cloneNode(deep) does not clone form elements correctly
* fast/dom/clone-node-form-elements-expected.txt: Added.
* fast/dom/clone-node-form-elements.html: Added.
2006-01-03 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Eric.
......
This tests that cloneNode and importNode copies the form element properties that aren't stored in values, such as 'value', and 'checked'. If this test is successful, the text SUCCESS should be shown below.
SUCCESS!
<html>
<head>
<script>
function debug(str) {
var c = document.getElementById('console')
c.innerHTML += (str + "<br>")
}
function runTests() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
var input1 = document.getElementById('input1');
input1.value = 'Test';
var input1clone = input1.cloneNode(true);
if (input1clone.value != input1.value) {
debug('FAILURE: input1clone.value was "' + input1clone.value + '", expected "' + input1.value + '"')
return;
}
var input1imported = document.importNode(input1, true);
if (input1imported.value != input1.value) {
debug('FAILURE: input1imported.value was "' + input1imported.value + '", expected "' + input1.value + '"')
return;
}
var input2 = document.getElementById('input2');
input2.checked = true;
var input2clone = input2.cloneNode(true);
if (input2clone.checked != input2.checked) {
debug('FAILURE: input2clone.checked was "' + input2clone.checked + '", expected "' + input2.checked + '"')
return;
}
var input2imported = document.importNode(input2, true);
if (input2imported.checked != input2.checked) {
debug('FAILURE: input2imported.checked was "' + input2imported.checked + '", expected "' + input2.checked + '"')
return;
}
debug('SUCCESS!')
}
</script>
</head>
<body onload="runTests();">
<input id="input1" type="text">
<input id="input2" type="checkbox">
<div>
This tests that cloneNode and importNode copies the form element properties that aren't stored in values, such as 'value', and 'checked'. If this test is successful, the text SUCCESS should be shown below.
</div>
<pre id="console"></pre>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment