Bug 42517 - Incorrect behaviour calling Range setStart or setEnd with boundary in different document
Summary: Incorrect behaviour calling Range setStart or setEnd with boundary in differe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords: EasyFix, HasReduction
Depends on: 45852
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-18 09:44 PDT by Tim Down
Modified: 2019-02-06 09:02 PST (History)
6 users (show)

See Also:


Attachments
Test case (1.06 KB, text/html)
2010-07-18 09:44 PDT, Tim Down
no flags Details
Patch (12.23 KB, patch)
2012-07-12 16:06 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

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