Skip to content

Commit a292d49

Browse files
committed
Bug 1842283 - make the image info collected in ContextMenuChild and PageInfoChild match better to have 'View Image Info' work more often, r=mconley.
Differential Revision: https://phabricator.services.mozilla.com/D186962
1 parent fccd8c0 commit a292d49

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

browser/actors/ContextMenuChild.sys.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,11 @@ export class ContextMenuChild extends JSWindowActorChild {
944944
currentSrc: context.target.currentSrc,
945945
width: context.target.width,
946946
height: context.target.height,
947-
imageText: context.target.title || context.target.alt,
947+
imageText: this.contentWindow.ImageDocument.isInstance(
948+
context.target.ownerDocument
949+
)
950+
? undefined
951+
: context.target.title || context.target.alt,
948952
};
949953
const { SVGAnimatedLength } = context.target.ownerGlobal;
950954
if (SVGAnimatedLength.isInstance(context.imageInfo.height)) {

browser/actors/PageInfoChild.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class PageInfoChild extends JSWindowActorChild {
181181
// One swi^H^H^Hif-else to rule them all.
182182
if (content.HTMLImageElement.isInstance(elem)) {
183183
addMedia(
184-
elem.src,
184+
elem.currentSrc,
185185
"img",
186186
elem.getAttribute("alt"),
187187
elem,

0 commit comments

Comments
 (0)