Bug 1053629 - Reduce complexity of setTextContent

https://bugzilla.mozilla.org/show_bug.cgi?id=1053629