Closed Bug 1671389 Opened 4 years ago Closed 2 years ago

Images are not loaded and rendered correctly on news.sky.com

Categories

(Web Compatibility :: Site Reports, defect)

defect

Tracking

(firefox-esr78 wontfix, firefox81 wontfix, firefox82 wontfix, firefox83 wontfix, firefox84 wontfix, firefox85 fix-optional)

RESOLVED WORKSFORME
Tracking Status
firefox-esr78 --- wontfix
firefox81 --- wontfix
firefox82 --- wontfix
firefox83 --- wontfix
firefox84 --- wontfix
firefox85 --- fix-optional

People

(Reporter: ailea, Unassigned)

References

()

Details

(Keywords: regression, reproducible, webcompat:site-wait)

Attachments

(1 file)

Attached video image load issue.mp4

Affected versions:

Nightly 83.0a1, Beta 82, Release 81.0.2

Tested on:

Windows 10 x64
Windows 7 x64
Ubuntu 18.04

Steps:

  1. Launch Firefox and go to: https://news.sky.com/story/bts-members-of-hit-boy-band-land-a-huge-windfall-as-shares-in-management-label-surge-on-debut-12104392
  2. Scroll down until see only a half of the image.
  3. Refresh the page.

Actual result:

The image is loaded and rendered accordingly.

Expected result:

The image is not loaded.

Regression Range:

This is a regression from Fx71. Will provide a regression range asap.

Note:

The issue is not reproducible in Chrome. Please see the video attachment.

Severity suggestion: S4

Looking for a regression range.

I tried to find a regression range multiple times but I obtain the same result, mozregression is unable to find a bisection in this case.
My results are:
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=e1a65223d498aa0b8e3e4802d8267db2768073d9&tochange=e9783a644016aa9b317887076618425586730d73

Flags: needinfo?(alin.ilea)

The severity field is not set for this bug.
:aosmond, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(aosmond)
Severity: -- → S3
Flags: needinfo?(aosmond)
Priority: -- → P3

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=720c1e5a8dd3f5bda4ae32137d1c624a1ad55301&tochange=be9a6289486a6f366e431782b84a0c0633f8fec2

And I confirmed that un-resister service workers from about:serviceworkers and setting dom.serviceWorkers.enabled to false mitigates the issue on Nightly85.0a1.

Has Regression Range: --- → yes
Has STR: --- → yes
Component: ImageLib → DOM: Service Workers
Keywords: reproducible
Regressed by: 1456995

I'm moving this to web compat for now because this ends up being a site issue and it's my suspicion and hope that the web compat team is more familiar with the nuances of how lazy loading can go wrong between browsers than I am.

Quick Summary

The site appears to explicitly be using lazy loading logic that involves ServiceWorkers serving a 1x1 transparent data URL image initially until the page logic updates the URLS. Disabling ServiceWorkers makes the problem go away because this effectively disables the image lazy loading because requests will always go to the network in that case.

The problem seems to be that the image served by the ServiceWorker ends up with the <img> tag having a bounding client rect height of 18.4px instead of the size of the post-load image height, which results in the the image indeed being off screen. The logic appears to be assuming that it would be dealing with an element whose size would be explicitly forced, but there doesn't appear to be styling for this. The image does live in a container that seems to be aspect-ratio sized... presumably that's what they thought they'd be measuring?

It appears that this isn't a problem in Chrome because when I refresh the page in Chrome, the page ends up smooth scrolling down to the pre-refresh scrolling position. It doesn't seem to do this for other sites, so maybe sky news is doing the smooth scrolling itself? Or maybe that's a Chrome implemented mitigation for sites that are known to have broken lazy loading?

The relevant styling for the image is:

.sdc-article-image__item {
	position: absolute;
	width: 100%;
	left: 0;
	top: 0;
}

With that being contained in a div with this rule that is what gives us the placeholder on the page with the desired bounding rect height of 499.95:

.sdc-article-image__wrapper {
	position: relative;
	padding-bottom: 56.25%;
}

Investigation Details

Here's the image tag after scrolling down so only the bottom of the image is only partly visible and refreshing:

<img class="sdc-article-image__item" src="https://e3.365dm.com/20/12/768x432/skynews-brexit-billboard-time_5195520.jpg?20201205110204" srcset="https://e3.365dm.com/20/12/384x216/skynews-brexit-billboard-time_5195520.jpg?20201205110204 380w, https://e3.365dm.com/20/12/768x432/skynews-brexit-billboard-time_5195520.jpg?20201205110204 760w, https://e3.365dm.com/20/12/1600x900/skynews-brexit-billboard-time_5195520.jpg?20201205110204 1024w, https://e3.365dm.com/20/12/2048x1152/skynews-brexit-billboard-time_5195520.jpg?20201205110204 2048w" sizes="(min-width: 1024px) 1024px, 100vw" alt="An electronic billboard ">

And here's the image tag after scrolling back up so the image is visible:

<img class="sdc-article-image__item" src="https://e3.365dm.com/20/12/768x432/skynews-brexit-billboard-time_5195520.jpg?bypass-service-worker&amp;20201205110204" srcset="https://e3.365dm.com/20/12/384x216/skynews-brexit-billboard-time_5195520.jpg?bypass-service-worker&amp;20201205110204 380w, https://e3.365dm.com/20/12/768x432/skynews-brexit-billboard-time_5195520.jpg?bypass-service-worker&amp;20201205110204 760w, https://e3.365dm.com/20/12/1600x900/skynews-brexit-billboard-time_5195520.jpg?bypass-service-worker&amp;20201205110204 1024w, https://e3.365dm.com/20/12/2048x1152/skynews-brexit-billboard-time_5195520.jpg?bypass-service-worker&amp;20201205110204 2048w" sizes="(min-width: 1024px) 1024px, 100vw" alt="An electronic billboard " data-lazy-loaded="true">

And here are the relevant excerpts from the ServiceWorker at https://news.sky.com/lazy-images-service-worker.js:

    // if it has the bypass-service-worker parameter do not intercept
    if (url.match(/bypass-service-worker/)) {
        interceptRequest = false;
    }
    // if interceptRequest is still true return a blank gif instead of going to the network
    if (interceptRequest) {
        event.respondWith(fetch('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==').then(res => res));
    }

And this is the visibility checking logic from the page after beautification:

    isInViewPort: function(t) {
        var e = t.getBoundingClientRect();
        return 0 !== e.width && (!(e.bottom < 0) && (!((window.outerHeight || window.innerHeight) - e.top < 50) && (!(e.width + e.left < -50) && !((window.outerWidth || window.innerWidth) - e.left < -50))))
    },

As noted above, the visibility check is correctly determining things aren't visible because the e.bottom is appropriately negative.

No longer blocks: ServiceWorkers-e10s
Severity: S3 → --
Component: DOM: Service Workers → Desktop
Priority: P3 → --
Product: Core → Web Compatibility
No longer regressed by: 1456995

I tried but I can't reproduce.
Nightly 85.0a1 (2020-12-06) (64-bit) with macOs

Ciprian in the webcompat team can reproduce. And there's a NS_ERROR_MALFORMED_URI in the network log.
https://searchfox.org/mozilla-central/search?q=NS_ERROR_MALFORMED_URI&path=&case=false&regexp=false

Ah I was doing it wrong. I reproduced too.

Steps to reproduce:

  1. Go to https://news.sky.com/story/covid-19-office-christmas-party-dead-for-now-with-staff-opting-for-cash-instead-survey-finds-12150639
  2. Scroll until the main article image is half hidden on the top (aka just the bottom of the image is visible)
  3. Then reload.

Expected:
See the image

Actual
Image doesn't load.

https://github.com/skynews Nobody easy to contact on skynews Github.
but maybe Ed Conway could help https://github.com/edconway

Contacted Sky News about it.

Ed Conway passed the information to the tech team. Thanks!

I can't reproduce the issue on my side, all images load after each page refresh.
https://prnt.sc/IlqKWGWHHaqm

Tested with:
Browser / Version: Firefox Nightly 104.0a1 (2022-06-28)
Operating System: Windows 10 Pro

Alin can you still reproduce it?

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(alin.ilea)
Resolution: --- → WORKSFORME

Cannot reproduce the issue anymore using Windows 10 and the latest Nightly build 104.0a1.
Thanks.

Flags: needinfo?(alin.ilea)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: