Version: 56 canary.
OS: All
What steps will reproduce the problem?
(1) Load the following HTML
<!DOCTYPE html>
<input type=hidden value="value1">
<script>
var i = document.querySelector('input');
i.type = "text";
i.defaultValue = "value2";
alert('Should be "value2": ' + i.value);
</script>
What is the expected output?
A dialog says 'Should be "value2": value2'
What do you see instead?
A dialog says 'Should be "value2": value1'
Please use labels and text to provide additional information.
Firefox works as expected.
Specification:
https://html.spec.whatwg.org/multipage/forms.html#input-type-change
> Otherwise, if the previous state of the element's type attribute put the value IDL attribute in any mode other than the value mode, and the new state of the element's type attribute puts the value IDL attribute in the value mode, then set the value of the element to the value of the value content attribute, if there is one, or the empty string otherwise, and then set the control's dirty value flag to false.
Comment 1 by bugdroid1@chromium.org
, Oct 13 2016