diff --git a/source b/source index a6b93957fa3..439edb92726 100644 --- a/source +++ b/source @@ -4993,7 +4993,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
TrustedScriptdataTrustedScriptURLTrustedParserOptionsTrustedHTML or DOMString) html, optional ParseHTMLUnsafeOptions options = {});
+ static Document parseHTMLUnsafe((TrustedHTML or DOMString) html, optional (ParseHTMLUnsafeOptions or TrustedParserOptions) options = {});
static Document parseHTML(DOMString html, optional SetHTMLOptions options = {});
// resource metadata management
@@ -125447,7 +125449,7 @@ document.body.appendChild(frame)
partial interface Element {
[CEReactions] undefined setHTML(DOMString html, optional SetHTMLOptions options = {});
- [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html, optional SetHTMLUnsafeOptions options = {});
+ [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
DOMString getHTML(optional GetHTMLOptions options = {});
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
@@ -125457,7 +125459,7 @@ document.body.appendChild(frame)
partial interface ShadowRoot {
[CEReactions] undefined setHTML(DOMString html, optional SetHTMLOptions options = {});
- [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html, optional SetHTMLUnsafeOptions options = {});
+ [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html, optional (SetHTMLUnsafeOptions or TrustedParserOptions) options = {});
DOMString getHTML(optional GetHTMLOptions options = {});
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
@@ -125727,8 +125729,8 @@ enum DOMParserSupportedType {
Let target be this's template contents if
this is a template element; otherwise this.
Set and filter HTML given target, html, - options, and true.
Set and filter HTML given target, + html, and options.
Set and filter HTML given this, html, - options, and true.
Set and filter HTML given this, + html, and options.
Let compliantHTML be the result of invoking the get trusted type compliant string algorithm with Let (compliantHTML, compliantOptions) be the result of invoking the
+ get trusted type compliant input algorithm with TrustedHTML, this's relevant global
- object, html, "Element setHTMLUnsafe", and "script".
Element
+ setHTMLUnsafe".
Let target be this's template contents if
this is a template element; otherwise this.
Set and filter HTML given target, compliantHTML, - options, and false.
Set and filter HTML given target, + compliantHTML, compliantOptions, and Unsafe.
Let compliantHTML be the result of invoking the get trusted type compliant string algorithm with Let (compliantHTML, compliantOptions) be the result of invoking the
+ get trusted type compliant input algorithm with TrustedHTML, this's relevant global
- object, html, "ShadowRoot setHTMLUnsafe", and "script".
ShadowRoot
+ setHTMLUnsafe".
- Set and filter HTML given this, compliantHTML, - options, and false.
Set and filter HTML given this, + compliantHTML, compliantOptions, and Unsafe.
Let compliantHTML be the result of invoking the get trusted type compliant string algorithm with Let (compliantHTML, compliantOptions) be the result of invoking the
+ get trusted type compliant input algorithm with TrustedHTML, this's relevant global
- object, html, "Document parseHTMLUnsafe", and "script".
Document
+ parseHTMLUnsafe".
Let document be a new Document, whose DOMParserSupportedType {
compliantHTML.
Let sanitizer be the result of calling get a sanitizer instance from - options with options and false.
Call sanitize on document with sanitizer and false.
A fragment parser mode is one of the following:
+ +To set and filter HTML, given an Element or
+ DocumentFragment target, a string html, a dictionary or TrustedParserOptions object options, and an
+ optional fragment parser mode mode (default Normal):
Let fragment be the result of invoking the fragment parsing algorithm + steps given target, html, options, and + mode.
If fragment is non-null, then replace + all with fragment within target.
The fragment parsing algorithm steps, given an Element or
- DocumentFragment target, a string markup, and an optional
- parser scripting mode scriptingMode (default Inert), are:
DocumentFragment target, a string markup, a dictionary or TrustedParserOptions object options, and a
+ fragment parser mode mode, are:
Assert: scriptingMode is either Inert or Fragment. +
Let context be target if target is an
+ Element; otherwise target's host.
Assert: context is non-null.
If all of the following are true:
+script"; and then return null.
+Let safe be true if mode is Normal; otherwise false.
Let sanitizer be the result of calling getting a sanitizer from options given safe.
Let scriptingMode be Inert.
If options["runScripts"]
+ is true:
Assert: mode is not Normal.
If target's node document is an XML
+ Set scriptingMode to Fragment.
Let allowDeclarativeShadowRoots be false if mode is Legacy; otherwise true.
If mode is Legacy and + target's node document is an XML document, then return the result of invoking the XML fragment parsing algorithm given target and markup.
Return the result of the HTML fragment parsing algorithm given - target, markup, false, and scriptingMode.
Let fragment be the result of the HTML fragment parsing algorithm + given target, markup, allowDeclarativeShadowRoots, and + scriptingMode.
Sanitize fragment given sanitizer and + safe.
Return fragment.
Let compliantString be the result of invoking the get trusted type compliant string algorithm with TrustedHTML, this's relevant global
- object, the given value, "Element innerHTML", and "script".
Let (compliantString, compliantOptions) be the result of invoking
+ the get trusted type compliant input algorithm with
+ TrustedHTML, this's relevant global
+ object, the given value, a new SetHTMLUnsafeOptions dictionary, and "Element innerHTML".
Let target be this.
If target is a template element, then set target to the
- template element's template contents (a
- DocumentFragment).
Setting innerHTML on a
- template element will replace all the nodes in its template contents
- rather than its children.
Let fragment be the result of invoking the fragment parsing algorithm - steps with target and compliantString.
Replace all with fragment - within target.
Set and filter HTML given this, + compliantString, compliantOptions, and Legacy.
Let compliantString be the result of invoking the get trusted type compliant string algorithm with TrustedHTML, this's relevant global
- object, the given value, "ShadowRoot innerHTML", and "script".
Let fragment be the result of invoking the fragment parsing algorithm - steps with this and compliantString.
Let (compliantString, compliantOptions) be the result of invoking
+ the get trusted type compliant input algorithm with
+ TrustedHTML, this's relevant global
+ object, the given value, a new SetHTMLUnsafeOptions dictionary, and "ShadowRoot innerHTML".
Replace all with fragment - within this.
Set and filter HTML given this, + compliantString, compliantOptions, and Legacy.
Let compliantString be the result of invoking the get trusted type compliant string algorithm with TrustedHTML, this's relevant global
- object, the given value, "Element outerHTML", and "script".
Let (compliantString, compliantOptions) be the result of invoking
+ the get trusted type compliant input algorithm with
+ TrustedHTML, this's relevant global
+ object, the given value, a new SetHTMLUnsafeOptions dictionary, and "Element outerHTML".
Let parent be this's parent.
Let parent be this's parent.
If parent is null, return. There would be no way to obtain a - reference to the nodes created even if the remaining steps were run.
If parent is null, return. There would be no way to obtain a reference to the + nodes created even if the remaining steps were run.
If parent is a Document, throw a
- "NoModificationAllowedError" DOMException.
If parent is a Document, throw a
+ "NoModificationAllowedError" DOMException.
If parent is a DocumentFragment, set parent to the
- result of creating an element given this's
- node document, "body", and the HTML
- namespace.
If parent is a DocumentFragment, set parent to the
+ result of creating an element given this's
+ node document, "body", and the HTML
+ namespace.
Let fragment be the result of invoking the fragment parsing algorithm - steps given parent and compliantString.
Let fragment be the result of invoking the fragment parsing algorithm + steps given parent, compliantString, compliantOptions, + and Legacy.
Replace this with - fragment within this's parent.
Replace this with + fragment within this's parent.
Let compliantString be the result of invoking the get trusted type compliant string algorithm with TrustedHTML, this's relevant global
- object, string, "Element insertAdjacentHTML", and "script".
Let (compliantString, compliantOptions) be the result of invoking
+ the get trusted type compliant input algorithm with
+ TrustedHTML, this's relevant global
+ object, the given value, a new SetHTMLUnsafeOptions dictionary, and "Element insertAdjacentHTML".
Let context be null.
Let fragment be the result of invoking the fragment parsing algorithm - steps with context and compliantString.
-Let fragment be the result of invoking the fragment parsing algorithm + steps given context, compliantString, compliantOptions, + and Legacy.
Let compliantString be the result of invoking the get
- trusted type compliant string algorithm with TrustedHTML, this's relevant global
- object, string, "Range createContextualFragment", and
- "script".
Let (compliantString, compliantOptions) be the result of invoking
+ the get trusted type compliant input algorithm with
+ TrustedHTML, this's relevant global
+ object, string, a new SetHTMLUnsafeOptions whose runScripts is true, and "Range createContextualFragment".
Let node be this's start node.
Return the result of invoking the fragment parsing algorithm steps with - element, compliantString, and Fragment.
Return the result of invoking the fragment parsing algorithm steps given + element, compliantString, compliantOptions, and Legacy.
To set and filter HTML, given an Element or
- DocumentFragment target, a string html, a
- dictionary options, and a boolean safe:
Let context be target if target is an
- Element; otherwise target's host.
Assert: context is non-null.
If all of the following are true:
- -safe;
context's local name is
- "script"; and
context's namespace is the - HTML namespace or the SVG namespace,
then return.
-Let sanitizer be the result of calling getting a sanitizer from options given safe.
Let scriptingMode be Inert.
If options["runScripts"]
- is true:
Assert: safe is false.
Set scriptingMode to Fragment.
-Let fragment be the result of invoking the HTML fragment parsing - algorithm given target, html, true, and - scriptingMode.
- -Scripts in fragment will only execute once inserted into - target.
-Sanitize fragment given sanitizer and - safe.
Replace all with fragment within - target.
To get a sanitizer instance from options from a dictionary options with a