Last Comment Bug 389677 - [FIX]flash video that uses <object> and incorrect content-type no longer works
: [FIX]flash video that uses <object> and incorrect content-type no longer works
: regression
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: Trunk
: All All
: P1 major (vote)
: mozilla1.9alpha8
Assigned To: Boris Zbarsky [:bz]
Depends on: 395533
Blocks: 1156 390891
  Show dependency treegraph
Reported: 2007-07-26 08:07 PDT by Deb Richardson [:dria] (plz NEEDINFO)
Modified: 2007-09-12 13:58 PDT (History)
13 users (show)
bzbarsky: in‑testsuite?
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Say like this (21.85 KB, patch)
2007-08-09 14:06 PDT, Boris Zbarsky [:bz]
cbiesinger: review+
cbiesinger: superreview+
jonas: approval1.9+
Details | Diff | Splinter Review

Description Deb Richardson [:dria] (plz NEEDINFO) 2007-07-26 08:07:59 PDT
Went to view the latest "Will it Blend?" but the video is not being displayed in Minefield (see URL).  Works OK in Fx2.0.0.5.  YouTube videos and such still work fine, as well.
Comment 1 Mike Beltzner [:beltzner, not reading bugmail] 2007-07-26 08:55:27 PDT
I can confirm this in Windows (through Parallels) as well, though it was working for me on a recent (like, two or three days old, 20070723 at oldest) OSX nightly that was being updated via the "nightly" channel. When I updated to the latest nightly, it broke.

What's odd, though, is that if I download an older nightly - like 20070720 - even when running with a fresh profile it remains broken.
Comment 2 Mike Beltzner [:beltzner, not reading bugmail] 2007-07-26 09:00:06 PDT
Seems highly localized to flash video served up from Video from Google Video, YouTube, metacafe, ifilm, TED, and pretty much any other flash-video site I could find still seems to work.
Comment 3 Adam Guthrie 2007-07-26 10:49:51 PDT
Had to use my wayback machine for this regression range, but it regressed between 2005-09-21-07 and 2005-09-22-08, making it a regression from bug 1156.
Comment 4 Christian :Biesinger (don't email me, ping me on IRC) 2007-07-26 11:20:25 PDT
This is working as designed... The site sends application/octet-stream as the content type for the flash <object>, and HTML specifies that the server-sent type takes precedence over a type attribute (if any). bug 1156 made us implement that part of HTML correctly.
Comment 5 Christian :Biesinger (don't email me, ping me on IRC) 2007-07-26 11:27:51 PDT
-> tech evang
Comment 6 Mike Beltzner [:beltzner, not reading bugmail] 2007-07-26 11:34:29 PDT
I'm absolutely positive that I had revver flash video displaying in a trunk build properly this morning at the same time that dria's was broken, but maybe I was getting to a different revver server that doesn't have the broken HTML?

Very strange, but possible, I guess.
Comment 7 Christian :Biesinger (don't email me, ping me on IRC) 2007-07-26 11:50:00 PDT
Is it possible that you had changed your user-agent not to include Gecko in the case where this worked for you by chance? (In such a case, the page uses a different codepath that still works).
Comment 8 Mike Beltzner [:beltzner, not reading bugmail] 2007-07-26 12:02:50 PDT
Not unless it changed during the update, and then didn't change back.
Comment 9 Mike Beltzner [:beltzner, not reading bugmail] 2007-08-03 21:55:26 PDT
Is there any way to nominate a tech evangelism bug for blocking status? While this might be us complying to a spec, we're currently the only browser that doesn't work with Revver video. :(
Comment 10 Bob Clary [:bc:] 2007-08-03 22:50:56 PDT
(In reply to comment #9)
> Is there any way to nominate a tech evangelism bug for blocking status? 

Nope. I suggest that an official contact from schrep or someone else with name-brand recognition such as yourself contact them. If you would rather, I can use my moco addy to contact them. Depending on their maintenance schedule it shouldn't be a problem to get this fixed before Firefox 3 releases... ;-)
Comment 11 Mike Beltzner [:beltzner, not reading bugmail] 2007-08-09 08:09:54 PDT
Another major site where Flash video isn't working is General Motors Canada:

Are we *sure* this is tech evangelism? It feels like something we need to be more forgiving of.

status --> blocker
Comment 12 :Gavin Sharp [email:] 2007-08-09 08:17:32 PDT
It looks like the flash file on the GM site is sent as text/plain. It seems fairly common for sites to send the wrong content type. I think we should reconsider the change that made us give up on unknown content types given the high-profile sites that are breaking because of it.
Comment 13 Boris Zbarsky [:bz] 2007-08-09 10:21:09 PDT
I could live with falling back on the "type" attribute if the channel type is application/octet-stream (and in fact I think this is a really good idea) or maybe even the sniffed binary type (to handle the GM mess-up), and we can stick our text-or-binary sniffer in there to sniff for binary.  Would that cover any "legitimate" cases of bogus types?  I think so...  I think it would also break non-ASCII text documents in <object> when served from Apache.  But given that we also break them in uriloader... maybe that's ok.  We'd need similar server checks here, of course.

Have I mentioned how much I hate the web lately?  ;)
Comment 14 Mike Beltzner [:beltzner, not reading bugmail] 2007-08-09 11:27:56 PDT
(To be clear, I think we should reach out to revver as well - I'm just thinking that the web, hateful place that it is, might not react well to us being suddenly strict here, especially where no-one else is.)
Comment 15 Boris Zbarsky [:bz] 2007-08-09 12:09:53 PDT
I'm actually surprised that anyone's doing this, since it doesn't work in IE... They must be doing some serious sniffing.  :(
Comment 16 Boris Zbarsky [:bz] 2007-08-09 14:06:33 PDT
Created attachment 276033 [details] [diff] [review]
Say like this

Basic idea:

* Change the text/plain sniffing to use an nsIContentSniffer
* Change <object> loads to call sniffers
* Use the original type hint if the channel type in OnStartRequest is either
  sniffed-binary or application/octet-stream.

I tested that the URI in bug still gets sniffed as binary.  I also tested that the feed sniffer now works for <object>.  Oh, and we still pass Acid2.

This fixes both of the testcases in this bug, and shouldn't break anything reasonable, I don't think....
Comment 17 Boris Zbarsky [:bz] 2007-08-09 14:08:31 PDT
It'd also be nice if we had testcases for all that stuff I tested... but we don't.
Comment 18 Christian :Biesinger (don't email me, ping me on IRC) 2007-08-13 14:08:07 PDT
Comment on attachment 276033 [details] [diff] [review]
Say like this
Comment 19 Boris Zbarsky [:bz] 2007-08-13 15:44:28 PDT
Comment on attachment 276033 [details] [diff] [review]
Say like this

Requesting approval.  This patch makes us sniff certain text/plain responses for <object> to see whether they might actually be binary (just like we do for <iframe>), and makes us treat binary-sniffed and application/octet-stream responses per the content-type attribute of the object, if any.  This should significantly improve web compat by covering the most common broken MIME type cases without breaking any legitimate content, I hope.
Comment 20 Boris Zbarsky [:bz] 2007-08-20 20:59:47 PDT
Checked in.  Need tests, though....  Help writing those would be great.  :(

Note You need to log in before you can comment on or make changes to this bug.