Page MenuHomePhabricator

Hovercards: thumbnails do not display in Safari
Closed, ResolvedPublic

Description

The images for the thumbs do not work for me in Safari. The reason is the following:

TypeError: 'undefined' is not an object (evaluating '$box.removeClass( 'mwe-popups-no-image-tri' ).find( 'image' )[0].setAttribute')

The reason is that no <image> was added but a <img> instead. This is because some browsers (IE and safari) basically have a symbolic link from image to img in the HTML context.

And that leads us to the 2nd problem, these elements are created using jQuery, but jQuery doesn't support element namespaces explicitly and because the image element will be created in the 'current' document context, it will thus create an HTML img element. What you need instead is something like:

document.createElementNS('http://www.w3.org/2000/svg', 'image');


Version: master
Severity: major

Details

Reference
bz62985

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:55 AM
bzimport set Reference to bz62985.

Created attachment 14887
testcase

Attached:

Screen_Shot_2014-03-24_at_8.06.19_am.png (654×337 px, 35 KB)

  • Bug 63153 has been marked as a duplicate of this bug. ***

Change 122352 had a related patch set uploaded by Prtksxna:
Use document.createElementNS for svg image

https://gerrit.wikimedia.org/r/122352

Change 122352 merged by jenkins-bot:
Use document.createElementNS for svg:image

https://gerrit.wikimedia.org/r/122352

Confirmed fixed on beta labs.

Thanks for fixing, it's fixed here.

Prtksxna raised the priority of this task from High to Needs Triage.Dec 3 2014, 5:29 AM
Prtksxna moved this task from Backlog to Archive on the Page-Previews board.