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.
I am about to fix this via Bug 154627. *** This bug has been marked as a duplicate of bug 154627 ***