Closed Bug 1797798 Opened 3 years ago Closed 3 years ago

wrong display of a web page

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

Unspecified
Android
defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox106 --- wontfix
firefox107 --- verified
firefox108 --- verified

People

(Reporter: kbrosnan, Assigned: emilio)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(3 files)

From github: https://github.com/mozilla-mobile/fenix/issues/27565.

Hello, there is a problem viewing a web page in firefox for android.
The page is faccard.free.fr/newtab.html
I test it on firefox beta and also firefox nightly: it's the same problem: it shows a black page instead of a picture.

It works fine in Opera browser.
It works also fine in Firefox on my iPhone.

Thanks in advance
faccard@free.fr
My firefox version :
106.1.0 (Build #2015909131), 71ca6c1f7+
AC: 106.0.5, 5f06485fc3
GV: 106.0-20221010181815
AS: 94.2.1

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

I think this is invalid but would like someone with more knowledge to have a look the page has the following HTML.

<img id="img1" src="./desktopbg/cur_wallpaper.jpg" data-src="./desktopbg/cur_wallpaper.jpg" alt="" width="NaN" height="0">

From my quick look this is caused by setting height="0" which Chrome seems to ignore.

There is the html code of the page.
If anyone can help.

<html>
<head>
<meta charset="utf-8">
<title>Home page</title>
<style>
body {
background-color: #000000;
visibility:hidden;
</style>
</head>
<body id="m_body">
<div id="myDiv"><img id="img1" src="" data-src="./desktopbg/cur_wallpaper.jpg" alt="" /></div>
<script>
function addEvent(a,b,c,d){
d = !d && false;
(a.addEventListener)?a.addEventListener(b,c,d):a.attachEvent('on'+b,c);
}
imgToLoad = document.querySelector("img[data-src]");
dataImgCt = "";
srcTarget = "";
dataImgCt = imgToLoad.getAttribute("data-src");
srcTarget = dataImgCt;
function loadImages(){
imgTemp="";
imgTemp = document.createElement("img");
imgTemp.src = srcTarget;
imgTemp.onload = function(){
imgToLoad.src = srcTarget;//this.src;
m_height = imgToLoad.height;
m_width = imgToLoad.width;
redimimageac();
}
}
addEvent(window, 'load', loadImages, false);
window.onresize = redimimageac;

		function redimimageac() {
			if (document.getElementById('img1')) {
				l_coord=new Array(4);
				l_coord=redimimage(85);
				val_top=l_coord[2] + "px";
				val_gauche=l_coord[3] + "px";
				document.getElementById('img1').setAttribute("width",l_coord[0]);
				document.getElementById('img1').setAttribute("height",l_coord[1]);
				document.getElementById('myDiv').style.paddingTop = val_top;
				document.getElementById('myDiv').style.paddingLeft = val_gauche;
				document.getElementById('m_body').style.visibility = "visible";
			}
		}

		/* Redimensionnement d'une image
		 * pourcentc : la carré, dans lequel doit être contenue l'image, est calculé en pourcentage par rapport à la taille de la fenêtre
		 * l'image est agrandie ou rétrécie sans dépasser la taille ooriginale de l'image)).
		 */
		function redimimage(pourcentc) {
			largeurw=window.innerWidth; /*largeur de la zone*/
			hauteurw=window.innerHeight; /* hauteur de la zone*/
			largeurc=Math.min(window.innerWidth*pourcentc/100, m_width); /* largeur du carré devant contenir l'image*/
			hauteurc=Math.min(window.innerHeight*pourcentc/100, m_height);/* hauteur du carré devant contenir l'image*/
			coord=new Array(4); /* tableau qui contiendra largeur, hauteur , top, gauche*/
			ratio=m_height / m_width; /* proportion de l'image */
			hauteur=hauteurc; 
			largeur=hauteur / ratio ;
			if (largeurc<largeur) {
				largeur=largeurc;
				hauteur=largeur * ratio;
			} 
			letop=Math.floor((hauteurw - hauteur)/2);
			legauche=Math.floor((largeurw - largeur)/2);
			coord[0]=largeur;
			coord[1]=hauteur;
			coord[2]=letop;
			coord[3]=legauche;
			return(coord);
		}
	</script>
</body>

</html>

Just to say that i uninstall the latest version of firefox for android 106.1.0, and i install version 105.2.0 and it works fine with this old version.

This regressed by bug 1787072.

Assignee: nobody → emilio
Flags: needinfo?(emilio)
Regressed by: 1787072

Set release status flags based on info from the regressing bug 1787072

Attached file Reduced test-case.
Flags: needinfo?(emilio)

For information, the issue has been reported at https://github.com/webcompat/web-bugs/issues/112826

Otherwise the image frame doesn't get the image until the OnImageLoaded
notification arrives. See the test-case on why does this matter.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fff85ade9dd0 Make sync load of images when there's no existing image work too. r=tnikkel
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36724 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Upstream PR merged by moz-wptsync-bot

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox107 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

Comment on attachment 9300813 [details]
Bug 1797798 - Make sync load of images when there's no existing image work too. r=edgar,tnikkel

Beta/Release Uplift Approval Request

  • User impact if declined: Relatively simple change that restores previous behavior.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Visit the url mentioned in comment 0 or the test-case above.
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Fairly trivial fix to make loaded image updates sync to match other browsers.
  • String changes made/needed: none
  • Is Android affected?: Yes
Flags: needinfo?(emilio)
Attachment #9300813 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9300813 [details]
Bug 1797798 - Make sync load of images when there's no existing image work too. r=edgar,tnikkel

Approved for 107.0b8.

Attachment #9300813 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Verified as fixed on Nightly 108.0a1 from 07/11 and Firefox Beta 107.0b6 with Motorola Moto G9 Plus (Android 11). The picture from faccard.free.fr/newtab.html is displayed correctly.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: