Fix #1662 for 1.2.5

See #1662 when `setDocType(HTML5)` then `getDocType` not return.