Bug 1583623 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
> Why was it thrown here https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#1783 ?

[NS_ERROR_DOM_INVALID_STATE_ERR](https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#1783) was thrown because mType was still [NS_FORM_INPUT_TEXT](https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#6454). Why mType was not changed to NS_FORM_INPUT_DATETIME_LOCAL even after we setAttribute as 'a.setAttribute("type", "datetime-local");' in the attached test case? Didn't we call into [this line](https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#4498)?

John, maybe you can share some thoughts here, where our code went wrong?
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
> Why was it thrown here https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#1783 ?

[NS_ERROR_DOM_INVALID_STATE_ERR](https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#1783) was thrown because mType was still [NS_FORM_INPUT_TEXT](https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#6454). Why was mType not changed to NS_FORM_INPUT_DATETIME_LOCAL even after we setAttribute as 'a.setAttribute("type", "datetime-local");' in the attached test case? Didn't we call into [this line](https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#4498)?

John, maybe you can share some thoughts here, where our code went wrong?

Back to Bug 1583623 Comment 2