Bug 154594 - new Range().createContextualFragment() throws DOM Exception 9
Summary: new Range().createContextualFragment() throws DOM Exception 9
Status: RESOLVED DUPLICATE of bug 154627
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-23 10:26 PST by besworks
Modified: 2016-02-23 20:07 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description besworks 2016-02-23 10:26:15 PST
After creating a Range object using the constructor the createContextualFragment method throws DOM Exception 9 rather than returning a DocumentFragment object as expected.

If Range.setStart and Range.setEnd are called to set the Range's boundaries then createContextualFragment works as expected.

Looking at Range.cpp I can see that createContextualFragment checks if startContainer is an HTMLElement but the Range constructor sets startContainer as the global document object which is an HTMLDocument and therefore fails this check.
Comment 1 Chris Dumez 2016-02-23 20:07:55 PST
I am about to fix this via Bug 154627.

*** This bug has been marked as a duplicate of bug 154627 ***