querySelector('noscript') doesn't return noscript element in DOMParser

Confirmed Issue #12453464 • Assigned to Travis L.


Jun 23, 2017
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Parse <head></head><noscript>123</noscript> using DOMPurify.

We expect the returned body.querySelector('noscript') would return the <noscript> element.

But to our surprise, the <noscript> cannot be found by querySelector, despite it’s obviously there when we use firstChild.

Ridiculously, body.querySelector(':not(noscript)') will return the element.

See the screenshots. This is confirmed in both IE11 and Edge 15


Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “James M.”

    Changed Assigned To to “Travis L.”

    Changed Status to “Confirmed”

You need to sign in to your Microsoft account to add a comment.

Sign in