diff --git a/source b/source index ec9157348bb..f8aa5389980 100644 --- a/source +++ b/source @@ -10579,6 +10579,8 @@ typedef (HTMLScriptElement or SVGScriptElement) LegacyOverrideBuiltIns] partial interface Document { + static Document parseHTMLUnsafe(DOMString html); + // resource metadata management [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location; attribute USVString domain; @@ -109055,6 +109057,8 @@ document.body.appendChild(frame) also live here? -->

DOM parsing

+

The DOMParser interface

+

The DOMParser interface allows authors to create new Document objects by parsing strings, as either HTML or XML.

@@ -109075,7 +109079,8 @@ document.body.appendChild(frame)

Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be - UTF-8.

+ UTF-8. The document's URL will be + inherited from parser's relevant global object.

Values other than the above for type will cause a TypeError exception to be thrown.

@@ -109083,9 +109088,10 @@ document.body.appendChild(frame)

The design of DOMParser, as a class that needs to be constructed and - then have its parseFromString() method called, - is an unfortunate historical artifact. If we were designing this functionality today it would be a - standalone function.

+ then have its parseFromString() method + called, is an unfortunate historical artifact. If we were designing this functionality today it + would be a standalone function. For parsing HTML, the modern alternative is Document.parseHTMLUnsafe().

[Exposed=Window]
 interface DOMParser {
@@ -109115,7 +109121,7 @@ enum DOMParserSupportedType {
    
  • Let document be a new Document, whose content type is type and url is this's relevant global object's URL is this's relevant global object's associated Document's URL.