Issue 1396 - Avoid infinite recursion when collapsing <input type="image"> elements

--HG--
extra : amend_source : 0efdf3cd3ef2764c4c8ccf01a87cc13dba06a3d6