diff --git a/source b/source index f97f80ec94..0910cf4601 100644 --- a/source +++ b/source @@ -3151,6 +3151,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
ProcessingInstruction
interfaceShadowRoot
interfaceText
interfaceRange
interfacecreateContextualFragment()
+ methodThe createContextualFragment()
method has a number
+ of outstanding issues in the DOM Parsing and Serialization issue tracker, documenting various problems
+ with its specification.
docFragment = range.createContextualFragment(string)
Returns a DocumentFragment
created from the markup string string using
+ range's start node as the context in
+ which fragment is parsed.
This method performs no sanitization to remove potentially-dangerous elements
+ and attributes like script
or event handler content attributes.
partial interface Range {
+ [CEReactions, NewObject] DocumentFragment
createContextualFragment(HTMLString string);
+};
+
+ Range
's createContextualFragment(string)
+ method steps are:
Let node be this's start + node.
Let element be null.
If node implements Element
, set element
+ to node.
Otherwise, if node implements Text
or
+ Comment
, set element to node's parent
+ element.
If element is null or all of the following are true:
+ +element's node document is an HTML document;
element's local name is
+ "html
"; and
element's namespace is the + HTML namespace,
then set element to the result of creating an
+ element given this's node document, body
, and the
+ HTML namespace.
Let fragment node be the result of invoking the fragment parsing + algorithm steps with element and string.
For each script of fragment node's
+ script
element descendants:
Set script's already started to false.
Set script's parser document to null.
Return fragment node.
The setTimeout()
and