Bug 148692

Summary: Range API should throw a TypeError for null Node parameters
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
URL: https://dom.spec.whatwg.org/#range
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-09-01 16:15:33 PDT
Range API should throw a TypeError for null Node parameters. We currently throw a NotFoundError.

As per the DOM specification, the Node arguments are not optional nor nullable [1]:
https://dom.spec.whatwg.org/#range

Therefore, as per the Web IDL specification, we should throw a TypeError if the Node parameter is null or missing:
https://heycam.github.io/webidl/#es-interface (step 1).

[1] https://heycam.github.io/webidl/#es-nullable-type
Comment 1 Chris Dumez 2015-09-01 16:30:45 PDT
Created attachment 260390 [details]
Patch
Comment 2 WebKit Commit Bot 2015-09-01 18:38:23 PDT
Comment on attachment 260390 [details]
Patch

Clearing flags on attachment: 260390

Committed r189240: <http://trac.webkit.org/changeset/189240>
Comment 3 WebKit Commit Bot 2015-09-01 18:38:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Chris Dumez 2015-09-02 13:13:27 PDT
rdar://problem/22544221