IE and Edge getElementsByTagName and querySelector/All treats img and svg image tag as the same tag

Confirmed Issue #7163109 • Assigned to Kris K.

Details

Author
Tom B.
Created
Apr 10, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Reports
Reported by 3 people

Sign in to watch or report this issue.

Steps to reproduce

  1. Add an html <img> tag and an svg with an <image> tag in it to a document
  2. run document.getElementsByTagName(‘img’) or docuemnt.querySelectorAll(‘img’)
  3. the result will return an array with both images.
    this also applies to document.querySelector.
    Attached a unit test that passes on Chrome, Firefox and Sfari but fails on Edge and IE (link to codepen version of the test case http://codepen.io/tombigel/pen/YqYBmz)

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Travis L.”

    Changed Assigned To to “Travis L.”

    Changed Status to “Confirmed”

    Changed Assigned To from “Travis L.” to “Kris K.”

  • I had a very obscure bug where svg patterns with images didn’t display on Edge.

    It turns out it was because I had #container img { opacity: 0} in my css, and it affected the `` tag inside the pattern.

  • Apparently bug reports strip html tags even when inside markdown antiquotes… And I can’t edit my message either.

    Anyway what I meant to say was that the image svg tag was affected by the #container img { opacity: 0} css.

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

Sign in