Bug 149057

Summary: document.body = "text" should throw a TypeError, not a HierarchyRequestError
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-09-10 21:35:32 PDT
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.
Comment 1 Chris Dumez 2015-09-10 21:36:21 PDT
rdar://problem/22567157
Comment 2 Chris Dumez 2015-09-10 22:03:31 PDT
Created attachment 260988 [details]
Patch
Comment 3 WebKit Commit Bot 2015-09-11 07:50:49 PDT
Comment on attachment 260988 [details]
Patch

Clearing flags on attachment: 260988

Committed r189617: <http://trac.webkit.org/changeset/189617>
Comment 4 WebKit Commit Bot 2015-09-11 07:50:53 PDT
All reviewed patches have been landed.  Closing bug.