Closed Bug 1241550 Opened 8 years ago Closed 8 years ago

[e10s] Flash in iframe with "position:fixed" doesn't reappear after scroll

Categories

(Core Graveyard :: Plug-ins, defect, P2)

defect

Tracking

(e10s+, firefox46 unaffected, firefox47 unaffected, firefox48 wontfix, firefox49 verified, firefox50 verified, firefox51 verified)

VERIFIED FIXED
mozilla51
Tracking Status
e10s + ---
firefox46 --- unaffected
firefox47 --- unaffected
firefox48 --- wontfix
firefox49 --- verified
firefox50 --- verified
firefox51 --- verified

People

(Reporter: arni2033, Assigned: kats)

References

()

Details

(Keywords: regression, Whiteboard: regression from 1193055, then fixed in 1243413, then broken in 1192910 again)

Attachments

(2 files)

>>>   My Info:   Win7_64, Nightly 46, 32bit, ID 20160121030208
STR:
0. Set mouse option "When I rotate mouse wheel" to "scroll by 1 page"
   That's my default install.
1. Open the following "data:" url or click URL in the form above. Wait until flash loads.
>   data:text/html,<iframe src="https://www.youtube.com/v/60og9gwKh1o" height="344" width="425"></iframe><style>body{height:10000px;}iframe{position:fixed;}
2. Rotate mouse wheel down once.
3. If you still don't see the bug, then repeat Step 2.

Result:       
 Flash plug-in disappears when I scroll the page in Step 2 and doesn't reappear.
 I'll attach a screencast if nobody can reproduce it

Expectations: 
 Flash should be visible after Step 3.

This was caused by bug 1193055. Regression range:
> https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=b7a4595a79011dc47a6ac00eee59969586cccbe9&tochange=6b38c8223cc67a9e5c9167e276287e7e4fa8e890
Assignee: nobody → jmathies
tracking-e10s: --- → ?
Assignee: jmathies → nobody
Flags: needinfo?(twalker)
interesting.  I could reproduce this the other day on Win 7.  My build has since been updated to Nightly 47.0a1, Build ID 20160128030208. And I can no longer reproduce it.  When I have time later, I'll reinstall the older build in attempt to prove it's a WFM now or not. 

In the mean time, arni, can you check with the latest Nightly build?
Flags: needinfo?(arni2033)
Of course it's reproducible. 20160129030206
Flags: needinfo?(arni2033)
Depends on: 1243413
This only reproduces with apz.
(In reply to Jim Mathies [:jimm] from comment #3)
> This only reproduces with apz.

Yep, just realized I had turned apz off for some other testing and forgot to turn it back.
Flags: needinfo?(twalker)
Arni, could you test to see if you still see this bug in nightly?
Flags: needinfo?(arni2033)
I can't reproduce this on:   Win7_64, Nightly 46, 32bit, ID 20160208030244
Apparently fixed in bug 1243413
Flags: needinfo?(arni2033)
Thanks!
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Marking unaffected for 46 since e10s will not be enabled on 46 release.
>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160526082509
>>>   My Info:   Win7_64, Nightly 50, 32bit, ID 20160715063552 (2016-07-15)
I can still reproduce this
Blocks: 1192910
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Whiteboard: regression from 1193055, then fixed in 1243413, then broken in 1192910 again
Updated STR:
0. Set pref "plugins.rewrite_youtube_embeds" to "false"
1. Open URL
2. Rotate mouse wheel down once
3. Rotate mouse up down once

AR:  Flash not visible
ER:  Should be visible
Priority: -- → P2
I can reproduce this in Nightly using the STR in comment 10. Just a note though that in Nightly the flash content doesn't disappear, but I think it gets replaced with the screenshot and is non-interactive. The underlying bug is still present though.
Stepping through the code it looks like the nsGfxScrollFrame::HasPluginFrames() function is returning false, because the plugin frame is in the nsSubDocumentFrame, which is a direct child of the parent document's ViewportFrame. Therefore the plugin frame is not a descendant of the scrolling nsGfxScrollFrame, and doesn't trip the HasPluginFrames() check.
So this is fixable by removing the ancestor check at [1] and just setting the value to true unconditionally. That way plugins anywhere on the page will cause paint-skipping to be disabled, and we'll always send the layer updates on scroll. That code was originally added when the codepath was reused to also set the plugin visibility, but that stuff was removed in [2] and so I don't anticipate any other side-effects from doing this.

However looking around the code a bit more I also see that there's some new code at [3] which seems related, and setting gfx.e10s.hide-plugins-for-scroll to false (and restarting the browser) fixes the issue.

Bob, since you added that stuff, do you know what the long-term plan is with respect to the hide-plugins-for-scroll pref and if removing the ancestor check is an acceptable fix to this problem?

[1] http://searchfox.org/mozilla-central/rev/1112b7a5222b71a3b5b68bd531f50ded6bcbc770/layout/generic/nsGfxScrollFrame.cpp#2051
[2] https://hg.mozilla.org/mozilla-central/rev/b1c3f87e64f3#l12.68
[3] http://searchfox.org/mozilla-central/rev/1112b7a5222b71a3b5b68bd531f50ded6bcbc770/layout/generic/nsGfxScrollFrame.cpp#2771
Flags: needinfo?(bobowen.code)
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #11)
> Just a note though that in Nightly the flash content doesn't disappear, but I think it
> gets replaced with the screenshot and is non-interactive.
Flash content on Nightly disappears during scrolling (turns into _transparent_ area that doesn't respond to clicks), and doesn't reappear after scrolling is finished.

Why would you even say "replaced with the screenshot" ? If Firefox developers expect Flash to be replaced with something, then something is not according to the plan, because it's NOT replaced.
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #13)
> So this is fixable by removing the ancestor check at [1] and just setting
> the value to true unconditionally. That way plugins anywhere on the page
> will cause paint-skipping to be disabled, and we'll always send the layer
> updates on scroll.

Is this definitely plugins anywhere on the page and not just a less strict check for plugin frames within our scrolling frame?
If it is, then couldn't we just check rootPresContext->NeedToComputePluginGeometryUpdates() and remove HasPluginFrames altogether?

> Bob, since you added that stuff, do you know what the long-term plan is with
> respect to the hide-plugins-for-scroll pref and if removing the ancestor
> check is an acceptable fix to this problem?

When I was changing it to do the captures at the start of scroll, I realised that I could improve the plugin scrolling, so that maybe we don't need to hide at all.
It still isn't perfect though, so I think we need to check with product whether they think it is good enough.
jimm might know the current status on this?

I agree, that removing the ancestor check sounds safe, given that as I understand it, this is an optimisation that we will just do less often when plugins get caught in this check.
Flags: needinfo?(bobowen.code) → needinfo?(jmathies)
Assignee: nobody → bugmail
Attached patch Patch (deleted) — Splinter Review
So this does as Bob suggested in the previous comment, and just removes most of the machinery surrounding the ancestor check since if we're getting rid of the ancestor check we don't need to walk through each plugin.

Also now because HasPluginFrames() returns true if there's a plugin anywhere on the page, we should never enter the condition inside the gfxPrefs::HidePluginsForScroll branch, so that is effectively dead code and can be removed as well. The only concern I have there is we might have entered it if for non-windowed plugins (because of the various #ifdef/XRE_IsContentProcess checks in HasPluginFrames). If those are still relevant I can reinstate the gfxPrefs::HidePluginsForScroll block.
Attachment #8776960 - Flags: review?(jmathies)
Attachment #8776960 - Flags: feedback?(bobowen.code)
Comment on attachment 8776960 [details] [diff] [review]
Patch

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

If removing the ancestor check is equivalent to just checking for any registered plugins, this looks correct to me.
Attachment #8776960 - Flags: feedback?(bobowen.code) → feedback+
Comment on attachment 8776960 [details] [diff] [review]
Patch

This looks ok to me.
Flags: needinfo?(jmathies)
Attachment #8776960 - Flags: review?(jmathies) → review+
> When I was changing it to do the captures at the start of scroll, I realised
> that I could improve the plugin scrolling, so that maybe we don't need to
> hide at all.
> It still isn't perfect though, so I think we need to check with product
> whether they think it is good enough.
> jimm might know the current status on this?

Filed bug 1291441.
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e4303e24fceb
Don't do paint skipping if there are plugin frames anywhere on the page, instead of limiting it to the scrollframe's descendants. r=jimm
https://hg.mozilla.org/mozilla-central/rev/e4303e24fceb
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Hi :kats,
Since this bug is a regression and also affects 49/50, are you also considering to uplift this patch to 49/50?
Flags: needinfo?(bugmail)
Arni/Tracy, can you verify this is fixed on Nightly? If so I'll request uplift.
Flags: needinfo?(twalker)
Flags: needinfo?(bugmail)
Flags: needinfo?(arni2033)
Following STR's of comment 0, this looks good on Win 7 with latest Nightly 51.0a1, 20160815030201
Flags: needinfo?(twalker)
also fine with STR's of comment #10 (Set pref "plugins.rewrite_youtube_embeds" to "false") with latest Nightly.
https://hg.mozilla.org/mozilla-central/rev/e4303e24fceb - fixed
https://hg.mozilla.org/mozilla-central/rev/37e1f09cd54e - not fixed
Fix range:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=37e1f09cd54e&tochange=e4303e24fceb

By the way, now at last plugin doesn't blink. Still blinks on Firefox 48 and 49.
Flags: needinfo?(arni2033)
Comment on attachment 8776960 [details] [diff] [review]
Patch

Approval Request Comment
[Feature/regressing bug #]: bug 1192910 most recently
[User impact if declined]: windowed plugins can disappear or blink while scrolling
[Describe test coverage new/current, TreeHerder]: tested locally and verified in nightly
[Risks and why]: relatively low risk. the code has churned a bit recently so we should make sure the patches still apply and work properly on aurora/beta
[String/UUID change made/needed]: none
Attachment #8776960 - Flags: approval-mozilla-beta?
Attachment #8776960 - Flags: approval-mozilla-aurora?
Comment on attachment 8776960 [details] [diff] [review]
Patch

e10s and APZ related regression, verified on Nightly, Aurora50+, Beta49+
Attachment #8776960 - Flags: approval-mozilla-beta?
Attachment #8776960 - Flags: approval-mozilla-beta+
Attachment #8776960 - Flags: approval-mozilla-aurora?
Attachment #8776960 - Flags: approval-mozilla-aurora+
Needs rebasing for Beta.
Flags: needinfo?(bugmail)
I had to rebase around bug 1252877, which is a rather significant change. Try push with the rebased version (we should probably test it manually before landing) is at https://treeherder.mozilla.org/#/jobs?repo=try&revision=3fea2d365c51. Leaving ni on me for now.
The try push seems clean. However I'm having trouble testing it locally because even if I use the beta build that the try push was based on [1] I can't reproduce the original problem, I just get black inside the iframe instead of the youtube flash player. Is anybody else able to test the build at [2] to verify this bug is fixed in it?

[1] https://treeherder.mozilla.org/#/jobs?repo=mozilla-beta&revision=0339b0c18498
[2] https://treeherder.mozilla.org/#/jobs?repo=try&revision=3fea2d365c51&selectedJob=25817057
I ended up using these STR:
0. Set pref "plugins.rewrite_youtube_embeds" to "false"
1. Open URL
2. Right-click on the flash player and select "Settings..." to get the little settings dialog
3. Rotate mouse wheel down once
4. Rotate mouse up down once

The settings dialog blinks as you scroll, and stays hidden if the bug manifests. Unfortunately it looks like my rebased patch didn't fix the bug. I'm wondering if it's safer to just wontfix this for 49...
Attached patch Patch for beta (deleted) — Splinter Review
Ok, I did a local build and figured out the problem with my patch. The attached version works for me. Jim, do you mind giving this a once-over since it wasn't a trivial rebase? If you're good with this I'll uplift to beta.
Flags: needinfo?(bugmail)
Attachment #8782032 - Flags: review?(jmathies)
Attachment #8782032 - Flags: review?(jmathies) → review+
Flags: qe-verify+
Doesn't look very good in 49b8: http://screencast.com/t/sYOFuqM7
Thoughts?
Flags: needinfo?(bugmail)
The flickering during scroll is expected. This bug is about it getting stuck in the "hidden" state, and from your screencast that appears to not happen.
Flags: needinfo?(bugmail)
(In reply to Paul Silaghi, QA [:pauly] from comment #36)
> Doesn't look very good in 49b8: http://screencast.com/t/sYOFuqM7
> Thoughts?

Just in case, this is bug 1212813 and duplicates
Thank you.
Verified fixed FX 49b8, 50.0a2 (2016-09-01), 51.0a1 (2016-09-01).
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: