Bug 148692 - Range API should throw a TypeError for null Node parameters
Summary: Range API should throw a TypeError for null Node parameters
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://dom.spec.whatwg.org/#range
Keywords: InRadar, WebExposed
Depends on:
Blocks:
 
Reported: 2015-09-01 16:15 PDT by Chris Dumez
Modified: 2015-09-02 13:13 PDT (History)
3 users (show)

See Also:


Attachments
Patch (39.38 KB, patch)
2015-09-01 16:30 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-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