Bug 149057 - document.body = "text" should throw a TypeError, not a HierarchyRequestError
Summary: document.body = "text" should throw a TypeError, not a HierarchyRequestError
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar, WebExposed
Depends on:
Blocks:
 
Reported: 2015-09-10 21:35 PDT by Chris Dumez
Modified: 2015-09-11 07:50 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.54 KB, patch)
2015-09-10 22:03 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.