Add check for non-Text children for document.title.(fixes #1742)

see #1742