Test case for #1413

(cherry picked from commit 1c198a6552b85efe91b6193938f7cc148c90336d)
Fix #1413

(cherry picked from commit b4938ea2eaaca3e8dad26874104e860a6dc7edbe)

Conflicts:
	ext/forms/element.c
	ext/tag.c
Merge pull request #1420 from sjinks/issue-1413

[1.3.0] Fix #1413