Bug 149490 - Range's setStartBefore() / setStartAfter() / setEndBefore() / setEndAfter() do not match the specification
Summary: Range's setStartBefore() / setStartAfter() / setEndBefore() / setEndAfter() d...
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
: 148767 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-22 20:51 PDT by Chris Dumez
Modified: 2015-09-28 11:41 PDT (History)
6 users (show)

See Also:


Attachments
Patch (26.91 KB, patch)
2015-09-22 20:58 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-22 20:51:57 PDT
Range's setStartBefore() / setStartAfter() / setEndBefore() / setEndAfter() do not match the specification:
- https://dom.spec.whatwg.org/#dom-range-setstartbefore
- https://dom.spec.whatwg.org/#dom-range-setstartafter
- https://dom.spec.whatwg.org/#dom-range-setendbefore
- https://dom.spec.whatwg.org/#dom-range-setendafter

In particular, instead of step 2:
"If parent is null, throw an InvalidNodeTypeError exception."

Our implementation does more checks and throws exceptions in cases that the specification does not say we should.

Firefox's behavior matches the specification.
Comment 1 Chris Dumez 2015-09-22 20:58:47 PDT
Created attachment 261792 [details]
Patch
Comment 2 Andreas Kling 2015-09-23 04:27:30 PDT
Comment on attachment 261792 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2015-09-23 09:21:54 PDT
Comment on attachment 261792 [details]
Patch

Clearing flags on attachment: 261792

Committed r190174: <http://trac.webkit.org/changeset/190174>
Comment 4 WebKit Commit Bot 2015-09-23 09:21:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Chris Dumez 2015-09-24 16:58:59 PDT
*** Bug 148767 has been marked as a duplicate of this bug. ***
Comment 6 Radar WebKit Bug Importer 2015-09-28 11:41:09 PDT
<rdar://problem/22882522>