Closed
Bug 790483
Opened 12 years ago
Closed 11 years ago
click-to-play plugins fail to show placeholder after resizing
Categories
(Core Graveyard :: Plug-ins, defect, P2)
Core Graveyard
Plug-ins
Tracking
(firefox26+ verified, firefox27 verified)
VERIFIED
FIXED
mozilla27
People
(Reporter: johns, Assigned: gfritzsche)
References
()
Details
(Whiteboard: [CtPDefault:P2])
Attachments
(3 files, 4 obsolete files)
777 bytes,
text/html
|
Details | |
12.14 KB,
patch
|
jaws
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
953 bytes,
patch
|
surkov
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
When a plugin tag is created as click-to-play, we'll hide the placeholder UI if the frame is too small, but fail to show it when the frame is later resized. This breaks sites like:
http://news.yahoo.com/blogs/trending-now/long-lost-renoir-masterpiece-found-among-junk-flea-170238665.html
Reporter | ||
Comment 1•12 years ago
|
||
Testcase - this should show a fallback frame with CTP
Assignee | ||
Updated•12 years ago
|
Whiteboard: [CtPDefault:P3]
Assignee | ||
Updated•12 years ago
|
Priority: -- → P3
Comment 2•11 years ago
|
||
This bug as filed is different from the issue being discussed on firefox-dev: in that case, the plugin shows up as completely black. In this case it shows up with the "small plugin UI".
I don't think it's critical to fix the small plugin UI resize to large UI issue.
I do think it's critical to fix the black rectangle issue.
gfritzsche can you investigate the differences (perhaps get a testcase from Richard) and fix at least the first part?
Assignee: nobody → georg.fritzsche
Priority: P3 → P2
Whiteboard: [CtPDefault:P3] → [CtPDefault:P2]
Should be able to just sign up for a free account on insight.gradecam.com to repro the issue.
Assignee | ||
Comment 4•11 years ago
|
||
Variation of the previous test-case with the plugin going from 1x1 px to a size big enough to hold the binding.
This is what GradeCam uses too (and what i suspected), the black background in [1] just being the background color.
The original test-case currently works, but probably just because it resizes before "PluginBindingAttached".
[1] http://cl.ly/image/0h343L0t221D
Assignee | ||
Comment 5•11 years ago
|
||
The best thing i can think of right now is
(1) firing a "resized" event when the plugins size didn't change for N ms or
(2) firing a "resized" event every M ms
Both would avoid continuously firing the event while an element gets animated etc., with (1) probably being sufficient.
johns, do you have a suggestion where we could hook into to track size changes?
Flags: needinfo?(jschoenick)
Reporter | ||
Comment 6•11 years ago
|
||
Can't we make use of CSS selectors here to just always render the overlay in a way the gracefully degrades (and shows nothing below a certain size)? It seems hacky to be using javascript to rewrite things based on their size.
If we absolutely need a resize hook, I'm guessing nsObjectFrame would need to fire a callback that fires an event, or something, but I'm not to familiar with the layout code -- there may be a cleaner way.
Flags: needinfo?(jschoenick)
Comment 7•11 years ago
|
||
You can do CSS selectors based on the viewport size, but I don't know of any CSS selectors that let you select based on the actual size of an element.
Assignee | ||
Comment 8•11 years ago
|
||
bz, do you have a suggestion on what the best option is for this?
We need to have the click-to-play binding UI for click-to-play elements hidden if they are too small to hold it. When the element gets resized to a sufficient size however, we need to show it.
Flags: needinfo?(bzbarsky)
Reporter | ||
Comment 9•11 years ago
|
||
(In reply to Benjamin Smedberg [:bsmedberg] from comment #7)
> You can do CSS selectors based on the viewport size, but I don't know of any
> CSS selectors that let you select based on the actual size of an element.
Right, but you can use CSS to have something degrade gracefully when it is small, e.g. pushing all content into overflow when it is below a certain size.
We could also maybe use overflow events to detect when the placeholder no longer fits:
https://developer.mozilla.org/en-US/docs/Web/Reference/Events/overflow
Reporter | ||
Comment 10•11 years ago
|
||
I think overflow events may be what we want here, and will let us run arbitrary script when needed:
http://jsfiddle.net/JKEhK/
Assignee | ||
Comment 12•11 years ago
|
||
Great, thanks John - that makes this much easier than i thought it would be.
Assignee | ||
Comment 13•11 years ago
|
||
Improved test-case.
Attachment #800295 -
Attachment is obsolete: true
Assignee | ||
Comment 14•11 years ago
|
||
This fixes the click-to-play overlay visibility via overflow/underflow event handlers and adds a test for this.
Attachment #806256 -
Flags: review?(jaws)
Assignee | ||
Comment 15•11 years ago
|
||
Bonus patch: Fixup the browser tests, similar to the fixups in bug 899080, utilizing the utility function added by the previous patch.
This fixes some stale/non-default enabledState and removes the need to explicitly reset it.
Attachment #806260 -
Flags: review?(jaws)
Assignee | ||
Comment 16•11 years ago
|
||
Assignee | ||
Comment 17•11 years ago
|
||
I accidentally stumbled over the fact that the "underflow" event fires even if only one dimension actually underflows.
Boris, do you know if this is intentional?
STR:
* http://jsfiddle.net/LbbJw/5/
* click "Shrink" -> overflow fired, #inner hidden
* click one of "Grow width" or "Grow height" -> underflow fired, #inner shown but actually still overflowing in the other dimension
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 18•11 years ago
|
||
(In reply to Georg Fritzsche [:gfritzsche] from comment #17)
> * http://jsfiddle.net/LbbJw/5/
Actually: http://jsfiddle.net/LbbJw/11/
Comment 20•11 years ago
|
||
(In reply to Georg Fritzsche [:gfritzsche] from comment #17)
> I accidentally stumbled over the fact that the "underflow" event fires even
> if only one dimension actually underflows.
> Boris, do you know if this is intentional?
>
> STR:
> * http://jsfiddle.net/LbbJw/5/
> * click "Shrink" -> overflow fired, #inner hidden
> * click one of "Grow width" or "Grow height" -> underflow fired, #inner
> shown but actually still overflowing in the other dimension
Upon getting the overflow or underflow event, you should be able to use scrollTopMax and scrollTopLeft to determine if the content is still overflowed in either direction. See bug 766937 for the implementation.
Assignee | ||
Comment 21•11 years ago
|
||
The patch already covers this using the existing gPluginHandler.isTooSmall() utility function.
The open question is just if i'm working around a bug or intentional behavior.
Assignee | ||
Comment 22•11 years ago
|
||
Comment on attachment 806260 [details] [diff] [review]
Bonus: fixup browser tests nsIPluginTag.enabledState usage
Try run says i missed something in this patch.
Attachment #806260 -
Flags: review?(jaws)
Assignee | ||
Comment 23•11 years ago
|
||
Comment on attachment 806260 [details] [diff] [review]
Bonus: fixup browser tests nsIPluginTag.enabledState usage
As it turns out we have a few tests that actually depended on the enabledState not being reset properly. I'll move this to a new bug.
Attachment #806260 -
Attachment is obsolete: true
Assignee | ||
Comment 24•11 years ago
|
||
The actual fix alone looks fine on try:
https://tbpl.mozilla.org/?tree=Try&rev=00b467f1006e
Given the current discussion on dev-firefox, the test should probably be renamed to browser_CTP_resize.js.
Assignee | ||
Comment 25•11 years ago
|
||
Updated to the recent test restructuring.
Attachment #806256 -
Attachment is obsolete: true
Attachment #806256 -
Flags: review?(jaws)
Attachment #808562 -
Flags: review?(jaws)
Comment 26•11 years ago
|
||
Nominating for tracking since this might affect the decision to turn CtP on by default in FF26.
tracking-firefox26:
--- → ?
Comment 27•11 years ago
|
||
Comment on attachment 808562 [details] [diff] [review]
Flip overlay visibility per overflow state and events, v2
Review of attachment 808562 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
::: toolkit/mozapps/plugins/content/pluginProblemBinding.css
@@ +25,5 @@
> object:-moz-handler-playpreview,
> object:-moz-handler-vulnerable-updatable,
> object:-moz-handler-vulnerable-no-update {
> display: inline-block;
> + visibility: hidden;
Please add a comment here to say: "Initialize the overlay with visibility:hidden to prevent flickering if the plugin is too small to show the overlay."
Attachment #808562 -
Flags: review?(jaws) → review+
Assignee | ||
Comment 28•11 years ago
|
||
Backed out in http://hg.mozilla.org/integration/mozilla-inbound/rev/46138d38c249 for a m-oth failure.
Updated•11 years ago
|
Assignee | ||
Comment 30•11 years ago
|
||
As try runs [1] and [2] show, the timeouts were just a problem with test_takeFocus depending on stale plugin enabledState.
[1] https://tbpl.mozilla.org/?tree=Try&rev=cdcf82a19b3e
[2] https://tbpl.mozilla.org/?tree=Try&rev=1b2672210709
Attachment #809222 -
Flags: review?(surkov.alexander)
Updated•11 years ago
|
Attachment #809222 -
Flags: review?(surkov.alexander) → review+
Assignee | ||
Comment 31•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/65f6618c1e64
https://hg.mozilla.org/mozilla-central/rev/a5d2f7581e27
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Comment 33•11 years ago
|
||
Comment on attachment 808562 [details] [diff] [review]
Flip overlay visibility per overflow state and events, v2
>+ overlay.style.visibility = "visible";
...
>@@ -21,12 +21,13 @@ applet:-moz-handler-vulnerable-no-update
> object:-moz-handler-disabled,
> object:-moz-handler-blocked,
> object:-moz-handler-crashed,
> object:-moz-handler-clicktoplay,
> object:-moz-handler-playpreview,
> object:-moz-handler-vulnerable-updatable,
> object:-moz-handler-vulnerable-no-update {
> display: inline-block;
>+ visibility: hidden;
> overflow: hidden;
> opacity: 1 !important;
> -moz-binding: url('chrome://mozapps/content/plugins/pluginProblem.xml#pluginProblem') !important;
> }
You're making the object itself hidden, and the overlay visible... did you mean to do that? (It seems to work, it just looks odd to code it this way.)
Comment 34•11 years ago
|
||
Comment on attachment 808562 [details] [diff] [review]
Flip overlay visibility per overflow state and events, v2
> // Hide the in-content UI if it's too big. The crashed plugin handler already did this.
This comment is out of date - you're now showing the in-content UI unless it's too big. But the crashed plugin handler doesn't do this...
Assignee | ||
Comment 35•11 years ago
|
||
Thanks for the catch Neil, apparently i only quickly checked the crashed overlay after CTP-activating the plugin ... :(
Will address in a follow-up today.
Assignee | ||
Updated•11 years ago
|
Updated•11 years ago
|
Attachment #660275 -
Attachment is obsolete: true
Comment 36•11 years ago
|
||
Verified fixed using the testcase on 27.0a1 (2013-09-25) Win 7, Ubuntu 13.04, Mac OS X 10.8.4
Status: RESOLVED → VERIFIED
Updated•11 years ago
|
Component: General → Plug-ins
Product: Firefox → Core
Target Milestone: Firefox 27 → ---
Updated•11 years ago
|
Target Milestone: --- → mozilla27
Assignee | ||
Comment 37•11 years ago
|
||
Comment on attachment 808562 [details] [diff] [review]
Flip overlay visibility per overflow state and events, v2
[Approval Request Comment]
Bug caused by (feature/regressing bug #): click-to-play redesign
User impact if declined: click-to-play overlay not visible in some scenarios.
Testing completed (on m-c, etc.): On m-c, follow-ups also there now.
Risk to taking this patch (and alternatives if risky): Low, worst-case is affecting visibility of plugin click-to-play overlay.
String or IDL/UUID changes made by this patch: None.
Note: this depends on the patches from bug 920927.
Attachment #808562 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 38•11 years ago
|
||
Comment on attachment 809222 [details] [diff] [review]
Fix test_takeFocus
[Approval Request Comment]
This is just test-fixup for the above patch.
Attachment #809222 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Attachment #808562 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•11 years ago
|
Attachment #809222 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 39•11 years ago
|
||
Comment 40•11 years ago
|
||
(In reply to Paul Silaghi, QA [:pauly] from comment #36)
> Verified fixed using the testcase on 27.0a1 (2013-09-25) Win 7, Ubuntu
> 13.04, Mac OS X 10.8.4
Verified fixed 26.0a2 (2013-10-20)
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•