commit c24e0850b85b8f76c7145663d8c6a07855085457
parent 08fa533840dda2c1a7c9a107b34474bd61603328
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Mon, 15 Dec 2025 12:05:45 +0000
Bug 2005855 - Use natural image dimensions for the real width. r=tschuster
Not sure where to test it, feel free to take over the patch :)
Differential Revision: https://phabricator.services.mozilla.com/D276375
Diffstat:
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/browser/actors/PageInfoPreviewChild.sys.mjs b/browser/actors/PageInfoPreviewChild.sys.mjs
@@ -17,8 +17,8 @@ export class PageInfoPreviewChild extends JSWindowActorChild {
return undefined;
}
- const physWidth = img.width || 0;
- const physHeight = img.height || 0;
+ const naturalWidth = img.naturalWidth || 0;
+ const naturalHeight = img.naturalHeight || 0;
if (data.width !== undefined) {
img.width = data.width;
@@ -28,8 +28,8 @@ export class PageInfoPreviewChild extends JSWindowActorChild {
}
return {
- physWidth,
- physHeight,
+ naturalWidth,
+ naturalHeight,
width: img.width,
height: img.height,
};
diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js
@@ -1147,13 +1147,16 @@ function makePreview(row) {
return;
}
- if (data.width != data.physWidth || data.height != data.physHeight) {
+ if (
+ data.width != data.naturalWidth ||
+ data.height != data.naturalHeight
+ ) {
document.l10n.setAttributes(
document.getElementById("imagedimensiontext"),
"media-dimensions-scaled",
{
- dimx: formatNumber(data.physWidth),
- dimy: formatNumber(data.physHeight),
+ dimx: formatNumber(data.naturalWidth),
+ dimy: formatNumber(data.naturalHeight),
scaledx: formatNumber(data.width),
scaledy: formatNumber(data.height),
}
diff --git a/browser/base/content/test/pageinfo/browser.toml b/browser/base/content/test/pageinfo/browser.toml
@@ -4,9 +4,6 @@
support-files = ["iframes.html"]
["browser_pageinfo_image_info.js"]
-skip-if = [
- "true", # bug 1998143, 1997129, 1161699
-]
["browser_pageinfo_images.js"]
support-files = ["all_images.html"]