Bug 42517

Summary: Incorrect behaviour calling Range setStart or setEnd with boundary in different document
Product: WebKit Reporter: Tim Down <timdown>
Component: DOMAssignee: Eric Seidel (no email) <eric>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, cdumez, eric, jparent, ojan, webkit.review.bot
Priority: P2 Keywords: EasyFix, HasReduction
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 45852    
Bug Blocks:    
Attachments:
Description Flags
Test case
none
Patch none

Description Tim Down 2010-07-18 09:44:59 PDT
Created attachment 61903 [details]
Test case

According to the DOM Range spec, setting a Range boundary to a position within a document other than the one in which the Range currently exists should collapse the Range to the new boundary (in the new document). This works correctly in Firefox. In WebKit, we get a WRONG_DOCUMENT_ERR.

This may also affect other Range methods that move the range's boundaries, such as selectNode and selectNodeContents.
Comment 1 Eric Seidel (no email) 2012-07-12 16:06:56 PDT
Created attachment 152086 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-07-12 16:10:30 PDT
I only removed the set* ones.  If you'd like others removed, we should file a separate bug for that.
Comment 3 Ojan Vafai 2012-07-12 16:19:47 PDT
Comment on attachment 152086 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=152086&action=review

> LayoutTests/fast/dom/Range/set-wrong-document-err.html:25
> +// http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Changing
> +// http://www.w3.org/TR/dom/#interface-range

We should link to the new spec: http://www.w3.org/TR/dom/#interface-range
Comment 4 Eric Seidel (no email) 2012-07-12 17:01:08 PDT
Comment on attachment 152086 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=152086&action=review

>> LayoutTests/fast/dom/Range/set-wrong-document-err.html:25
>> +// http://www.w3.org/TR/dom/#interface-range
> 
> We should link to the new spec: http://www.w3.org/TR/dom/#interface-range

I linked to both. :)
Comment 5 Eric Seidel (no email) 2012-07-12 17:11:16 PDT
Thanks for the bug and review!
Comment 6 WebKit Review Bot 2012-07-12 19:12:37 PDT
Comment on attachment 152086 [details]
Patch

Clearing flags on attachment: 152086

Committed r122537: <http://trac.webkit.org/changeset/122537>
Comment 7 WebKit Review Bot 2012-07-12 19:12:42 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Lucas Forschler 2019-02-06 09:02:34 PST
Mass moving XML DOM bugs to the "DOM" Component.