document.body = "text" should throw a TypeError, not a HierarchyRequestError: https://html.spec.whatwg.org/multipage/dom.html#dom-document-body This is because "text" is a DOMString and it cannot be converted into an HTMLElement?. Therefore, the WebIDL specification says we should throw a TypeError in this case.
rdar://problem/22567157
Created attachment 260988 [details] Patch
Comment on attachment 260988 [details] Patch Clearing flags on attachment: 260988 Committed r189617: <http://trac.webkit.org/changeset/189617>
All reviewed patches have been landed. Closing bug.