Last Comment Bug 749455 - Click to play brings up missing plugins warning
: Click to play brings up missing plugins warning
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: 15 Branch
: x86 Windows 7
: -- normal with 1 vote (vote)
: mozilla16
Assigned To: David Keeler [:keeler] (use needinfo?)
:
Mentors:
: 758968 775246 782121 (view as bug list)
Depends on:
Blocks: 743102
  Show dependency treegraph
 
Reported: 2012-04-26 16:56 PDT by mdew
Modified: 2012-10-23 06:54 PDT (History)
10 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix + testcase (4.59 KB, patch)
2012-04-27 17:08 PDT, David Keeler [:keeler] (use needinfo?)
no flags Details | Diff | Review
patch + test (4.59 KB, patch)
2012-05-09 13:26 PDT, David Keeler [:keeler] (use needinfo?)
no flags Details | Diff | Review
patch + test (4.58 KB, patch)
2012-05-09 15:22 PDT, David Keeler [:keeler] (use needinfo?)
jaas: review-
Details | Diff | Review
patch v2 + test (5.59 KB, patch)
2012-05-10 10:15 PDT, David Keeler [:keeler] (use needinfo?)
jaas: review+
Details | Diff | Review
patch v3 + test (5.91 KB, patch)
2012-05-18 12:09 PDT, David Keeler [:keeler] (use needinfo?)
no flags Details | Diff | Review
patch v4 + test (5.96 KB, patch)
2012-06-01 12:04 PDT, David Keeler [:keeler] (use needinfo?)
jaas: review+
Details | Diff | Review

Description mdew 2012-04-26 16:56:27 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120424 Firefox/15.0a1
Build ID: 20120424175522

Steps to reproduce:

enable click to play
Visit this site, 
http://arstechnica.com/business/news/2012/04/vmware-confirms-source-code-leak-lulzsec-affiliated-hacker-claims-credit.ars



Actual results:

Yellow bar (missing plugin) comes up


Expected results:

No missing plugins bar should show
Comment 1 Matthias Versen [:Matti] 2012-04-27 08:36:54 PDT
confirming with Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120427 Firefox/15.0a1 SeaMonkey/2.12a1
Comment 2 David Keeler [:keeler] (use needinfo?) 2012-04-27 17:08:47 PDT
Created attachment 619219 [details] [diff] [review]
fix + testcase

nsObjectLoadingContent::OnStartRequest was perhaps being a bit too strict in deciding when to use mContentType to load a plugin (rather than the type of file indicated in the http response).

The larger problem is that embed/object tags can lie about their content. That is, they can say they're "application/x-shockwave-flash" but serve up a "text/html" file. When this happens, should this be an error? Should there be a notification?
Comment 3 David Keeler [:keeler] (use needinfo?) 2012-04-30 11:42:09 PDT
Comment on attachment 619219 [details] [diff] [review]
fix + testcase

Canceling r? b/c there might be a more general way to fix these kinds of bugs.
Comment 4 David Keeler [:keeler] (use needinfo?) 2012-05-09 13:26:37 PDT
Created attachment 622485 [details] [diff] [review]
patch + test

Ok, I take that back. I think this is the best fix.
Re-uploaded for a rebase, and requesting a review for real this time.
Comment 5 David Keeler [:keeler] (use needinfo?) 2012-05-09 15:22:03 PDT
Created attachment 622536 [details] [diff] [review]
patch + test

Meant x-test instead of flash in the test.
Sorry for the bugspam.
Comment 6 Josh Aas 2012-05-09 21:46:52 PDT
Comment on attachment 622536 [details] [diff] [review]
patch + test

Review of attachment 622536 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsObjectLoadingContent.cpp
@@ +803,5 @@
>    // We want to use the channel type unless one of the following is true:
>    //
>    // 1) The channel type is application/octet-stream and we have a
>    //    type hint and the type hint is not a document type.
>    // 2) Our type hint is a type that we support with a plugin.

These comments need updating. I don't think they accurately reflect the modified form of this condition.

@@ +815,5 @@
>        // because otherwise the default plug-in's catch-all behavior would
>        // confuse things.
> +      ((NS_SUCCEEDED(pluginState) || 
> +        pluginState ==  NS_ERROR_PLUGIN_CLICKTOPLAY) &&
> +       (caps & eSupportPlugins))) {

This 'if' statement is a disaster. The logic is enough to make it hard to read, plus there is a comment in the middle of it now.

I don't want to make this worse. Please find a cleaner way to handle this logic instead of just piling on.
Comment 7 David Keeler [:keeler] (use needinfo?) 2012-05-10 10:15:48 PDT
Created attachment 622770 [details] [diff] [review]
patch v2 + test

Re-wrote comment and if statement per Josh's comments. Asking for review again.
Comment 8 Josh Aas 2012-05-10 20:34:36 PDT
Comment on attachment 622770 [details] [diff] [review]
patch v2 + test

Review of attachment 622770 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM. However, looking at this method raises a higher-level question: do we really want to let a stream load continue for a click-to-play plugin? Will it cancel the stream at some later point or are we just letting it load while the plugin is in the click-to-play state?
Comment 9 Josh Aas 2012-05-10 20:35:21 PDT
(In reply to Josh Aas (Mozilla Corporation) from comment #8)

> LGTM. However, looking at this method raises a higher-level question: do we
> really want to let a stream load continue for a click-to-play plugin? Will
> it cancel the stream at some later point or are we just letting it load
> while the plugin is in the click-to-play state?

If you don't know the answer to this, or the behavior isn't what we want, can you file a bug on this?
Comment 10 David Keeler [:keeler] (use needinfo?) 2012-05-11 09:47:55 PDT
This doesn't actually continue the stream for click-to-play plugins - it's just how we determine what (mime) type it is. Given that type, we use it in GetTypeOfContent. If the plugin happens to be click-to-play, GetTypeOfContent returns eType_Null, and the plugin doesn't load. The important part is, when we look up why the type is eType_Null, we know what mime type the content should be, and we make the right decision regarding click-to-play vs. missing plugin.
Comment 11 David Keeler [:keeler] (use needinfo?) 2012-05-11 10:29:31 PDT
Try run: https://tbpl.mozilla.org/?tree=Try&rev=531e938fbefc
Comment 12 Ryan VanderMeulen [:RyanVM] 2012-05-14 16:01:46 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/449229be3db1
Comment 13 Ryan VanderMeulen [:RyanVM] 2012-05-14 18:41:39 PDT
Backed out due to OS X reftest failures.
https://hg.mozilla.org/integration/mozilla-inbound/rev/eadef7d76892

https://tbpl.mozilla.org/php/getParsedLog.php?id=11741654&tree=Mozilla-Inbound
REFTEST TEST-START | http://localhost:4444/1337040818439/327/type-overridden-by-server-ref.html | 5024 / 7610 (66%)
REFTEST TEST-UNEXPECTED-FAIL | file:///Users/cltbld/talos-slave/test/build/reftest/tests/layout/reftests/object/type-overridden-by-server.html | image comparison (==)
REFTEST   IMAGE 1 (TEST): data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAPoCAYAAAAmy5qxAAAXc0lEQVR4nO3dP8iVZR/A8QsamwKHoK0gpKE/0NrSkLk0mEZDBYHQH4KkycIp0AcRIYKyKFobJAgKqkVBAh2jIGgpGkOICkKR7PdOPfDwxJuVfd98/XzgwDm/6zoX9z1+uTmcNQAAAJH1v74AAADg+iFAAACAjAABAAAyAgQAAMgIEAAAICNAAACAjAABAAAyAgQAAMgIEAAAICNAAACAjAABAAAyAgQAAMgIEAAAICNAAACAjAABAAAyAgQAAMgIEAAAIPOPBMj333//TxwLAABc4/4wQE6ePDl33HHHrLVm165d8+yzz84zzzwzTz755Nx5553z4IMPbtn/3Xffzb333vu7Z3388ceza9euWWvN7bffPm+88cZ88cUX8+ijj85aa26++eZ57bXX5vLly1fn7gAAgH+VK3oCcvTo0VlrzdmzZ7fMf/zxx9mzZ8+W2ZEjR2atNadPn/7ds86cOTNrrXn55Zc3Z998882stebpp5/+k5cPAABcS64oQF5//fVZa825c+e2zC9evDg//PDD5udffvll9u/fP3ffffe2MPnNZ599NmuteeWVVzZn58+fn7XWvPDCC3/lHgAAgGvEXw6Qy5cvz4EDB7bse//99+fkyZNz4sSJueGGG+bbb7/ddpYAAQCA69efCpCDBw/Om2++Oa+++uo8/PDDs2/fvi37Hnvssbl06dL89NNPc+ONN87Bgwe3nSVAAADg+vWnAuT48ePz4YcfznvvvTfPPffcPPLII5t7vvrqqy3BsX///tmxY8dcuHBhy1kCBAAArl9/6zcgL7744ub7AwcOzFNPPTUbGxuzsbExTzzxxKy15p133tnyHQECAADXr78VIL/5+eefZ/fu3XPmzJktr9tuu23uueeeLXsFCAAAXL+uSoC8/fbb89Zbb22bb2xszFprPv30083ZXwkQYQIAAP8frihAjh07Nmut+eCDD7at/frrr3PXXXfN+fPnt619/fXXs9aahx56aHP2ySefzFprXnrppc3Zl19+OWutef7557edcfjw4Tl06NAV3QwAAPDv9ocB8u67787OnTtnrTX33XffnDp1anPt4sWL8/jjj89aaw4fPjyXLl3aXLtw4cIcP3581lqz1pojR47MRx99NPfff/+stebWW2+dEydOzOeffz579uyZtdbcdNNNs2/fvtm7d+888MADc8stt/zXPzUEAACuLVf0BAQAAOBqECAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEBGgAAAABkBAgAAZAQIAACQESAAAEDmPyZ2wzhH+JvPAAAAAElFTkSuQmCC
REFTEST   IMAGE 2 (REFERENCE): data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAPoCAYAAAAmy5qxAAAX20lEQVR4nO3dT6jl8x/H8W9JNPshisXsFMafZiFlxigbs5ONUlaTkuymjGZB+beSyIIFC2piM6FmoZCaEHdjw5Vig5CQZgqT92+hbr9pxu93jevp9Ps9HnU23/P6frrbZ997zlkGAAAgsvzTfwAAAPD/Q4AAAAAZAQIAAGQECAAAkBEgAABARoAAAAAZAQIAAGQECAAAkBEgAABARoAAAAAZAQIAAGQECAAAkBEgAABARoAAAAAZAQIAAGQECAAAkBEgAABARoAAAAAZAQIAAGQECAAAkBEgAABARoAAAAAZAQIAAGQECAAAkBEgAABARoAAAAAZAQIAAGQECAAAkBEgAABARoAAAAAZAQIAAGQECAAAkBEgAABAJg+Qn3/+eY4fP/5fd59//vl8//33MzPzzTffnPUGAABYHX85QF577bXZuXPnLMsyN99889x+++2zd+/e2bdv37z55pun7Z955pl58MEH//C8V199dW699dY5ePDg3HHHHbN79+7ZuXPnn94AAACrZ0uegDz55JOzLMu88847MzPz22+/zb333jvnnHPOvP7666dsr7rqqrn44ovnl19+Oe2cH374YbZt2zYvvfTSxrUvvvhiduzYMSdPntz0BgAAWE1bEiDPP//8LMsy77777sa1jz/+eJZlmf37929cO3bs2Bw4cGCWZZnDhw+fds76+vosyzKHDh065fqzzz47X3755aY3AADAavrbAuStt96aZVnmgQce2Lh21113zU8//TQ33njjXH/99Wc869prr51lWebgwYN/+ERjMxsAAGD1/C0Bcvz48dmzZ89ccMEF89lnn83MzNdffz333HPPzMwcPnx4lmWZtbW1085aW1ubCy+8cJZlmV27ds2nn356VhsAAGD1bGmA7N69e/bs2TNXXnnl7N+//5QweOihh+aDDz6Ymd+/CWv79u1z5513nvG8r776avbt2zfLssz27dvnvffeO6sNAACwWv62f8H6dydPnpzLL798HnnkkY3X1VdfPeeff/58++23f3juU089Neeee+5s27Ztvvvuu7PeAAAAqyEJkCNHjsx99903b7/99sbrxRdfnGVZ5uGHH97YHTt27LR777///lmWZV544YVNbwAAgNW0JQHy3HPP/ccAueWWW874pOOaa66ZSy65ZOOD5AcOHJj333//lM3a2tosyzJPPPHEpjcAAMBq2pIAefTRR2dZlnnllVdOe++jjz6am2666Yz3PfbYY6c8uXj66afnuuuumx9//HFj8/jjj89555036+vrm94AAACr6S8HyJEjR+ayyy6bZVnmhhtumKNHj2689+GHH84VV1wxF1100Wk/SPjJJ5/MbbfdNsuyzKWXXjpvvPHGHD16dHbt2jV79+6dQ4cOzd133z07duyYl19+eeO+zWwAAIDVtCVPQLbKiRMn5sSJEzPz+7dcra+vz6+//vqnNwAAwGpaqQABAAD+twkQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyAgQAAAgI0AAAICMAAEAADICBAAAyPwLAYyTmCPRoLgAAAAASUVORK5CYII=
REFTEST number of differing pixels: 448 max difference: 255
Comment 14 David Keeler [:keeler] (use needinfo?) 2012-05-18 12:09:29 PDT
Created attachment 625188 [details] [diff] [review]
patch v3 + test

On OSX, a quicktime plugin was saying it could handle image types, and so the channel type got overridden (which it shouldn't have). Fixed this by specifically denying image types when checking for plugin support. Asking for review again to make sure this is what we want to do.
Comment 15 Josh Aas 2012-06-01 10:18:16 PDT
Comment on attachment 625188 [details] [diff] [review]
patch v3 + test

Review of attachment 625188 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsObjectLoadingContent.cpp
@@ +821,5 @@
> +                          pluginState == NS_ERROR_PLUGIN_CLICKTOPLAY);
> +  PRUint32 caps = GetCapabilities();
> +  bool caseTwo = (pluginSupported && 
> +                  (caps & eSupportPlugins) &&
> +                  typeOfContent != eType_Image);

The idea behind case two seems to be that if we're in a position to possibly load a plugin for the content type, then we want to stick with the content type unless it is also an image type. If the content type is also an image type then we prefer to load based on the channel type. The image-specific check seems arbitrary or incomplete to me, the rest of this comment discusses that.

In the case of the failing reftest in the last patch, the content type indicates a PNG image but the channel type is HTML, and we want the HTML document displayed. Adding 'typeOfContent != eType_Image' in your patch makes this work because it causes us to prefer the channel type over the content type.

The test passes without your patch because 'GetTypeOfContent(mContentType) == eType_Plugin' failed, causing us to prefer the channel type (HTML). It failed because 'GetTypeOfContent' starts off with this code:

1870   if ((caps & eSupportImages) && IsSupportedImage(aMIMEType)) {
1871     return eType_Image;
1872   }

The same method, 'GetTypeOfContent', also does this:

1874   bool isSVG = aMIMEType.LowerCaseEqualsLiteral("image/svg+xml");
1875   bool supportedSVG = isSVG && (caps & eSupportSVG);
1876   if (((caps & eSupportDocuments) || supportedSVG) &&
1877       IsSupportedDocument(aMIMEType)) {
1878     return eType_Document;
1879   }

The image type check in your patch keeps the test passing but like I said before--it seems a bit too arbitrary or incomplete. Without your patch the equivalent logic relates to whether or not the content type is a plugin type, which seems more reasonable. Images are not a plugin type but there are also other non-plugin types, I'm thinking of documents in particular. Perhaps you should also have a '!= eType_Document' check in there? Or perhaps you should flip this around to say '== eType_Plugin || == eType_Null', the latter added case covering your additional acceptance of click-to-play? The former option seems safer - I'd r+ a patch with an added check for '!= eType_Document', but perhaps you have another explanation.
Comment 16 David Keeler [:keeler] (use needinfo?) 2012-06-01 12:04:48 PDT
Created attachment 629286 [details] [diff] [review]
patch v4 + test

Ok - I went with adding a check for '!= eType_Document'.
I also started a try run: https://tbpl.mozilla.org/?tree=Try&rev=aaa07b76e73a
Comment 17 David Keeler [:keeler] (use needinfo?) 2012-06-06 15:06:16 PDT
*** Bug 758968 has been marked as a duplicate of this bug. ***
Comment 18 Ryan VanderMeulen [:RyanVM] 2012-06-09 09:26:58 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/62c03a248faa
Comment 19 Ryan VanderMeulen [:RyanVM] 2012-06-09 19:38:50 PDT
https://hg.mozilla.org/mozilla-central/rev/62c03a248faa
Comment 20 Loic 2012-07-24 17:15:37 PDT
*** Bug 775246 has been marked as a duplicate of this bug. ***
Comment 21 Paul Silaghi, QA [:pauly] 2012-08-25 00:23:17 PDT
*** Bug 782121 has been marked as a duplicate of this bug. ***
Comment 22 Paul Silaghi, QA [:pauly] 2012-08-25 00:44:52 PDT
How can silverlight prompt to install issue (bug 743102) to be fixed in FF 15b6 and java issue only in FF 16?

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