Bug 215774

Summary: REGRESSION (r258215): Title preview movie isn't displayed at www.thismmalife.com
Product: WebKit Reporter: Fernando <fdoxyz>
Component: ImagesAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, colin, eric.carlson, ews-watchlist, glenn, jer.noble, peng.liu6, philipj, sabouhallawa, sergio, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: iPhone / iPad   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=208827
Attachments:
Description Flags
Patch
eric.carlson: review+
Patch for landing
none
Patch for landing none

Description Fernando 2020-08-24 11:14:24 PDT
This was tested on iOS 14.0 (18A5351d) beta 5

Browsing a website that presents the following GIF we're not able to see anything other than the background color of the element

https://res.cloudinary.com/hkyugldxm/image/fetch/s--tWG33PgR--/c_imagga_scale,f_auto,fl_progressive,h_420,q_66,w_1000/https://thismmalife-images.s3.amazonaws.com/i/nzb6iyu6cpodsele1fqe.gif

The `img` is presented in HTML as:

<img src="https://res.cloudinary.com/hkyugldxm/image/fetch/s--tWG33PgR--/c_imagga_scale,f_auto,fl_progressive,h_420,q_66,w_1000/https://thismmalife-images.s3.amazonaws.com/i/nzb6iyu6cpodsele1fqe.gif" width="1000" height="420" style="background-color:#dddddd;" class="crayons-article__cover__image" alt="Cover image for BJ Penn deals with GSP's low kicks like they are nothing 🤷🏻">

This is not a problem in iOS 13.6.1 (17G80). Could this be a regression on GIF support?

The web page that has this GIF also contains another GIF that is presented correctly, which makes the problem a bit more odd. It can be seen here: 

https://www.thismmalife.com/taliashaw_962/a-rose-namajunas-flying-arm-bar-move-4pmo

Thank you in advance for the help.
Comment 1 Fernando 2020-08-24 11:19:36 PDT
I apologize, the correct URL for the article in the website that contains both the GIF that correctly renders and the one that doesn't render is the following:

https://www.thismmalife.com/leewynne/bj-penn-deals-with-gsp-s-low-kicks-like-they-are-nothing-42hc
Comment 2 Alexey Proskuryakov 2020-08-24 17:09:49 PDT
This is also a Safari 14 regression on macOS.

The one that doesn't play is above the title. It's not actually a .gif despite what the URL says - it's an mp4 in Safari, and a webp in Chrome, loaded via an <img>.
Comment 3 Radar WebKit Bug Importer 2020-08-24 17:10:01 PDT
<rdar://problem/67707957>
Comment 4 Jer Noble 2020-08-25 10:48:16 PDT
Looks like the .mp4 in question has an output PTS delta applied, which leads to us grabbing the wrong sample out of the SampleMap and causing a decode error. Simple fix; just need to ask for the `CMSampleBufferGetOutputPresentationTimeStamp()` rather than the `CMSampleBufferGetPresentationTimeStamp()` in `ImageDecoderAVFObjC::storeSampleBuffer()` and write a test.
Comment 5 Jer Noble 2020-08-26 13:10:11 PDT
Created attachment 407327 [details]
Patch
Comment 6 Peng Liu 2020-08-26 13:28:41 PDT
Comment on attachment 407327 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407327&action=review

> LayoutTests/media/video-as-img-output-pts-expected.txt:1
> +Tests that an  with a .mp4 source where that .mp4 has an edit list will correctly decode.

Something is missing here?
Comment 7 Eric Carlson 2020-08-26 13:41:21 PDT
Comment on attachment 407327 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407327&action=review

> LayoutTests/media/video-as-img-output-pts.html:8
> +        consoleWrite('Tests that an <img> with a .mp4 source where that .mp4 has an edit list will correctly decode.')

s/<img>/&lt;img&gt;/
Comment 8 Jer Noble 2020-08-26 13:59:47 PDT
Created attachment 407335 [details]
Patch for landing
Comment 9 Jer Noble 2020-08-26 14:50:55 PDT
Created attachment 407340 [details]
Patch for landing
Comment 10 EWS 2020-08-27 09:55:07 PDT
Committed r266239: <https://trac.webkit.org/changeset/266239>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407335 [details].
Comment 11 Fernando 2020-09-12 09:38:51 PDT
Hello again, was this patch shipped in the latest iOS beta release? 

I was still able to reproduce the problem but I haven't tested Safari preview release on macOS so I'm not sure if it's fixed there.
Comment 12 Alexey Proskuryakov 2020-09-12 10:17:17 PDT
(In reply to Fernando from comment #11)
> Hello again, was this patch shipped in the latest iOS beta release? 

It was not.

> I was still able to reproduce the problem but I haven't tested Safari preview release on macOS so I'm not sure if it's fixed there.

Latest Safari 14 beta and Safari Technology Preview do include this fix.
Comment 13 Alexey Proskuryakov 2020-09-14 18:28:57 PDT
> Latest Safari 14 beta and Safari Technology Preview do include this fix.

I was incorrect, they do not. STP 113 includes r265893, which is older, and beta 5 is older too.
Comment 14 Alexey Proskuryakov 2020-09-14 18:31:06 PDT
*** Bug 216088 has been marked as a duplicate of this bug. ***
Comment 15 Alexey Proskuryakov 2020-09-14 21:06:53 PDT
Further correction: latest Safari beta does have the fix, it’s STP that’s older.
Comment 16 Colin Bendell 2020-09-16 05:31:34 PDT
Can you confirm that this patch landed in ios14 GM? If it did then we still have a regression.
Comment 17 Fernando 2020-09-17 13:08:11 PDT
Same here, Safari in iOS 14.0 (18A373) still experiences the problem
Comment 18 Jer Noble 2020-09-18 10:03:05 PDT
(In reply to Colin Bendell from comment #16)
> Can you confirm that this patch landed in ios14 GM? If it did then we still
> have a regression.

No, this change missed the cutoff. I'll ping this bug when a fix is publicly testable.
Comment 19 Colin Bendell 2020-09-19 08:42:00 PDT
confirmed fixed in ios14.2 beta 1.

Aside: this is an example of why UA sniffing is still needed. While not ideal,  having browser version numbers in the UA allow service providers adapt content to work around bugs.
Comment 20 Ahmad Saleem 2022-10-10 13:55:24 PDT
Landed - https://github.com/WebKit/WebKit/commit/94ce1012431e0b2648520fdace3a4369422d4937

and didn't backed out.