Fix Range.createContextualFragment for non-HTMLElement contexts.

This implements the algorithm below for HTML, XHTML and SVG documents.
http://domparsing.spec.whatwg.org/#extensions-to-the-range-interface

BUG=311289,107982

Review URL: https://codereview.chromium.org/115693010

git-svn-id: svn://svn.chromium.org/blink/trunk@176569 bbb929c8-8fbe-4397-9dbb-9b2b20218538