Repository: servo/servo
File: components/script/dom/document.rs (Rust)

Code before:
        Ok(Document::new_with_proto(
            window,
            proto,
            HasBrowsingContext::No,
            None,
            doc.origin().clone(),
            IsHTMLDocument::NonHTMLDocument,
            None,
            None,
            DocumentActivity::Inactive,
            DocumentSource::NotFromParser,
            docloader,
            None,
            None,
            Default::default(),
            false,
            doc.allow_declarative_shadow_roots(),
            Some(doc.insecure_requests_policy()),
            doc.has_trustworthy_ancestor_or_current_origin(),
            doc.custom_element_reaction_stack(),
            doc.active_sandboxing_flag_set.get(),
            can_gc,
        ))
    }

    /// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe
    fn ParseHTMLUnsafe(
        window: &Window,
        s: TrustedHTMLOrString,
        can_gc: CanGc,
    ) -> Fallible<DomRoot<Self>> {
        // Step 1. Let compliantHTML be the result of invoking the
        // Get Trusted Type compliant string algorithm with TrustedHTML, the current global object,
        // html, "Document parseHTMLUnsafe", and "script".
        let compliant_html = TrustedHTML::get_trusted_script_compliant_string(
            window.as_global_scope(),
            s,
            "Document parseHTMLUnsafe",
            can_gc,
        )?;

        let url = window.get_url();
        let doc = window.Document();
        let loader = DocumentLoader::new(&doc.loader());

        let content_type = "text/html"
            .parse()
            .expect("Supported type is not a MIME type");
        // Step 2. Let document be a new Document, whose content type is "text/html".
        // Step 3. Set document's allow declarative shadow roots to true.
        let document = Document::new(

Review comment (suggestion):
You can catch such warnings with `./mach test-tidy`
```suggestion
    /// <https://html.spec.whatwg.org/multipage/#dom-parsehtmlunsafe>
```

Code after:
        Ok(Document::new_with_proto(
            window,
            proto,
            HasBrowsingContext::No,
            None,
            doc.origin().clone(),
            IsHTMLDocument::NonHTMLDocument,
            None,
            None,
            DocumentActivity::Inactive,
            DocumentSource::NotFromParser,
            docloader,
            None,
            None,
            Default::default(),
            false,
            doc.allow_declarative_shadow_roots(),
            Some(doc.insecure_requests_policy()),
            doc.has_trustworthy_ancestor_or_current_origin(),
            doc.custom_element_reaction_stack(),
            doc.active_sandboxing_flag_set.get(),
            can_gc,
        ))
    }

    /// <https://html.spec.whatwg.org/multipage/#dom-parsehtmlunsafe>
    fn ParseHTMLUnsafe(
        window: &Window,
        s: TrustedHTMLOrString,
        can_gc: CanGc,
    ) -> Fallible<DomRoot<Self>> {
        // Step 1. Let compliantHTML be the result of invoking the
        // Get Trusted Type compliant string algorithm with TrustedHTML, the current global object,
        // html, "Document parseHTMLUnsafe", and "script".
        let compliant_html = TrustedHTML::get_trusted_script_compliant_string(
            window.as_global_scope(),
            s,
            "Document parseHTMLUnsafe",
            can_gc,
        )?;

        let url = window.get_url();
        let doc = window.Document();
        let loader = DocumentLoader::new(&doc.loader());

        let content_type = "text/html"
            .parse()
            .expect("Supported type is not a MIME type");
        // Step 2. Let document be a new Document, whose content type is "text/html".
        // Step 3. Set document's allow declarative shadow roots to true.
        let document = Document::new(