tophf / mpiv

A fully reworked fork of Mouseover Popup Image Viewer
MIT License
167 stars 21 forks source link

Commit "disable fade-in transition when flipping gallery" causes initial empty border/placeholder when flipping gallery #75

Closed darkred closed 3 years ago

darkred commented 3 years ago

I'm referring to commit https://github.com/tophf/mpiv/commit/1be7fd570f1621c0aa150b224c5dba535c473aa8 The previous commit is: https://github.com/tophf/mpiv/commit/d27df29bdf684c50a7033718abc6a7f3714a14a6

The above commit causes initial empty border/placeholder when flipping gallery.

Test gallery URL: http://www.twilightsite.com/fantasy/Old/Royo/Royo.html Test rule:

{"d": "twilightsite.com",
 "e": "td > a:first-child",
 "s": "gallery",
 "g": {
  "image": "td > a:first-child",
  "index": "return node.href"
 }
}

Screenshot comparison between the two commits (tested having cache disabled):

Before: ![](https://user-images.githubusercontent.com/723651/136999903-0e1246dd-58a3-4022-9db5-051e2b89dbd2.gif)
After: ![](https://user-images.githubusercontent.com/723651/136999888-ee4c4a23-66f4-4e17-bf24-8aa43ce8cb1b.gif)

Thank you

tophf commented 3 years ago

Indeed, it's that old Firefox bug again.

darkred commented 3 years ago

It occurs in Chrome too.

tophf commented 3 years ago

I can't reproduce it in Chrome. Maybe I don't understand what the problem is? Do you mean the white flashes? In Firefox I see the same behavior regardless of that commit if I check [x] Disable cache in devtools. The only difference is that animation takes some time so it may hide the bug.

darkred commented 3 years ago

I'm referring to this:

Firefox: ![2021-10-12_211011](https://user-images.githubusercontent.com/723651/137007478-593b9759-2d70-417c-9026-90648eedf465.jpg)
Chrome: ![2021-10-12_211036](https://user-images.githubusercontent.com/723651/137007488-4d86d9b9-ecae-4209-ae23-bdc0f94a110c.jpg)

In Firefox the issue is much more apparent, it occurs almost consistently, on every flip. In Chrome, yes, it seems like the animation (the way it works) almost hides the bug (I tried even with the "Preload on hover" setting disabled, and it's still not so apparent as in Chrome) .

tophf commented 3 years ago

Still can't reproduce in Chrome, it shows the transparent background while loading here and it always did. Maybe it depends on GPU/driver. As for Firefox, there's nothing I can do about the problem but I can add an option to restore the animation in galleries.

darkred commented 3 years ago

Could you please try having, apart from cache disabled, also throttle it as most preferably "Slow 3G"? 2021-10-12_213849 It will now occur consistently for sure. Here, both from Chrome:

With that commit: (notice that the 1st image loads ok, but all next initially have white background) ![12345~~3](https://user-images.githubusercontent.com/723651/137011141-0a6c657c-4691-4429-9bd1-8985604be413.gif)
With the previous commit: (no images have white background, as always) ![12345~~4](https://user-images.githubusercontent.com/723651/137011712-ee9362e1-f766-4eee-8f39-1d0f224c8e37.gif)
tophf commented 3 years ago

Still can't reproduce in Chrome and I don't understand how that commit may cause this white background, AFAICT it's simply impossible. Maybe it's a bug in Chrome or you have something else interfering. Anyway, try the master branch, it has an option to restore transitions in galleries which is enabled by default.

darkred commented 3 years ago

With your latest commit the issue no longer occurs with Chrome, thank you.

But, with Firefox, it occurs consistently, on every flip (I tested in in a fresh Firefox 93 profile, with only latest TM/VM beta installed, and the script in its default settings, and the rule of the OP).

tophf commented 3 years ago

If you enabled the option in Firefox, it fully reverses the change so whatever happens is unrelated and must be a bug in Firefox.

darkred commented 3 years ago

Yes, I have it enabled, and the issue occurs consistently even in a fresh Firefox profile. I even tried latest Firefox Nightly 95 and it also occurs consistently.

Should I make an issue in bugzilla.mozilla.org about this? Could you show me please what to report? How to describe this bug?

darkred commented 3 years ago

Correction: this issue is a regression between the two commits in the OP ONLY in Chrome.

In Firefox the issue is NOT a regression: it's indeed unrelated, a Firefox bug, and it occurs in ALL script versions all the way up to commit https://github.com/tophf/mpiv/commit/076602582eb3759d6e23417c9cd9119c24cddadd (Feb 28 2020) that I tested, where gallery mode last works.

And I found the relevant Bugzilla bug: 1556156 White background during image loading dated from 2019, introduced in Firefox 67.

Thanks for your help and your time.

tophf commented 3 years ago

Ah, good. Thanks for the investigation.