Closed Bug 1047316 Opened 10 years ago Closed 10 years ago

Fix SharedFrame docshell swapping for SocialAPI (not Loop)

Categories

(Firefox Graveyard :: SocialAPI, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(firefox31 wontfix, firefox32+ verified, firefox33+ verified, firefox34+ verified)

VERIFIED FIXED
Firefox 34
Tracking Status
firefox31 --- wontfix
firefox32 + verified
firefox33 + verified
firefox34 + verified

People

(Reporter: FlorinMezei, Assigned: mixedpuppy)

References

Details

Attachments

(3 files, 2 obsolete files)

Reproducible with:
Firefox 32 Beta 3 - 20140731191115 - User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0

Environment: Windows 7 x64, Windows XP x86, Windows 8 x64

Steps to reproduce:
1. Open Firefox with new profile.
2. Go to http://mixedpuppy.github.io/socialapi-demo/ and choose to activate the Demo Social Service.
3. Click the "Sign in" button to automatically sign in.
4. Open a new tab, go to facebook.com, and click the flag (social marking) icon at the top right.
5. Open a new tab and go to facebook.com ---> the social marking icon at the top right will display the red flag as expected = OK
6. Ctrl+N to open a new window and go to facebook.com ---> the social marking icon at the top right will display the red flag as expected = OK
7. Click the social marking button in the new window ---> nothing happens (expected a panel to open) = NOT OK
8. Click the social marking button again in the new window ---> the buttons turns from the red flag icon to a mozilla firefox icon (expected a panel to open) = NOT OK
9. Close the new window, then click the social marking button in the two tabs (steps #4 & #5) ---> a panel opens as expected but the red flag icon also temporarily turns into the mozilla firefox icon = NOT OK (note than when doing this on Win 8 x64, the whole bar and content moves, which is another issue)

Issues summary:
a) the social marking icon does not open the panel when clicked in a new window
b) the social marking icon changes to mozilla Firefox icon when clicked for a second time in a new window
c) after a) & b) the mozilla Firefox icon will continue to appear for a second after clicking the social marking icon
d) on Windows 8 x64, at step c), the whole menu bar and content move whenever clicking the social marking icon

Notes:
- see "http://www.screencast.com/t/Lcm1Emx5N5" for a), b) and c) - Win 7
- see "http://www.screencast.com/t/ZPWIXnm1gsqY" for d) - Win 8
- this issue seems to also reproduce in Firefox 29
The issue also reproduces in the latest Firefox 33 Aurora and latest Firefox 34 Nightly.
Version: 32 Branch → Trunk
[Tracking Requested - why for this release]:
Flags: firefox-backlog?
console error:

JavaScript error: resource:///modules/SharedFrame.jsm, line 137: NS_ERROR_NOT_IMPLEMENTED:

This is failing in our SharedFrame code, which also affects Loop (I tested).  I'm pretty certain this has something to do with docshell swapping since back in the day we got these errors.
Summary: Incorrect behavior for social marking (flag) icon after opening a new window → SharedFrame docshell swapping is broken (Loop and SocialAPI affected)
Spoke with Shane, who said that this needs to be fixed. Marking as tracking+ and assigning to Shane.
Assignee: nobody → mixedpuppy
Shane - If this fix really needs to be in Firefox 32, we need a fix immediately as the final beta goes to build on Thu. Any progress?
Flags: needinfo?(mixedpuppy)
Flags: firefox-backlog? → firefox-backlog+
Attached patch fix social marks button (obsolete) — Splinter Review
This patch removes frame swapping from the social marks button. I'm opting to fix the marks button by not using docshell swapping.  The primary reason to swap is that the content is the same in every window, so we avoid the overhead of multiple iframes with the same content.  Since share and marks are loaded per-tab, and unloaded when closed, swapping doesn't help here anyway. (share already does not swap docshells). 

This does not fix the doscshell swap issue for the status button or for Loop.
Attachment #8475453 - Flags: review?(mhammond)
docshell wrapping requires that the iframe has been visible at least once (I'm assuming that some initialization happens at that time), and that we do not make it non-visible (e.g. style="display: none").  

In the first case, where the button (loop or socialapi) is in the toolbar, the first attempt at docshell swap fails.  I'm able to fix this by delaying the swap until popupshown has happened.

In the second case, where the button is in the menu-panel, the issue is a bit more severe.  The parent panelview gets its style set to display:none.  I've been able to show that I can make docshell swap work by setting display:block on the panelview then initiating the swap (this is done via browser console).  This makes a solution much more difficult.
Attached patch dont use menupanel (obsolete) — Splinter Review
Actually, this is a simple fix.  We just wont use panelview in the menu panel, instead our own panels appear after clicking on the buttons (this is what addons in general do).  

If Loop really wants that UI, there is a longer time frame to figure out how to address the problem.
Attachment #8475555 - Flags: review?(standard8)
Flags: needinfo?(mixedpuppy)
Comment on attachment 8475453 [details] [diff] [review]
fix social marks button

alternate reviewer
Attachment #8475453 - Flags: review?(jaws)
Comment on attachment 8475555 [details] [diff] [review]
dont use menupanel

alternate reviewer
Attachment #8475555 - Flags: review?(jaws)
Comment on attachment 8475555 [details] [diff] [review]
dont use menupanel

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

Tested it and it works fine. It's too bad we can't use a subview but given the time constraints this is reasonable.

::: browser/modules/PanelFrame.jsm
@@ +116,5 @@
>      let widgetGroup = CustomizableUI.getWidget(aToolbarButton.getAttribute("id"));
>      let widget = widgetGroup.forWindow(aWindow);
>      let anchorBtn = widget.anchor;
>  
>      // if we're a slice in the hamburger, use that panel instead

this comment seems out of date now (but i do like the "slice in the hamburger")
Attachment #8475555 - Flags: review?(standard8)
Attachment #8475555 - Flags: review?(jaws)
Attachment #8475555 - Flags: review+
Comment on attachment 8475453 [details] [diff] [review]
fix social marks button

>diff --git a/browser/base/content/socialmarks.xml b/browser/base/content/socialmarks.xml
>-              "origin": this.getAttribute("origin"),
>-              "src": "about:blank",
>-              "style": "width: " + width + "px; height: " + height + "px;",
>+          iframe.setAttribute("origin", provider.origin);
>+          iframe.setAttribute("style", "width: " + width + "px; height: " + height + "px;");

How come "src" isn't being set anymore?

>-        // Clear dimensions on all browsers so the panel size will
>-        // only use the selected browser.
>-        let frameIter = panel.firstElementChild;
>-        while (frameIter) {
>-          frameIter.collapsed = (frameIter != this.content);
>-          frameIter = frameIter.nextElementSibling;
>-        }

Why is this not needed anymore?
(In reply to Jared Wein [:jaws] (please needinfo? me) from comment #13)
> Comment on attachment 8475453 [details] [diff] [review]
> fix social marks button
> 
> >diff --git a/browser/base/content/socialmarks.xml b/browser/base/content/socialmarks.xml
> >-              "origin": this.getAttribute("origin"),
> >-              "src": "about:blank",
> >-              "style": "width: " + width + "px; height: " + height + "px;",
> >+          iframe.setAttribute("origin", provider.origin);
> >+          iframe.setAttribute("style", "width: " + width + "px; height: " + height + "px;");
> 
> How come "src" isn't being set anymore?

missed it, will add it.  it's actually not necessary since it is set upon use, but better to keep it the same for now.

> >-        // Clear dimensions on all browsers so the panel size will
> >-        // only use the selected browser.
> >-        let frameIter = panel.firstElementChild;
> >-        while (frameIter) {
> >-          frameIter.collapsed = (frameIter != this.content);
> >-          frameIter = frameIter.nextElementSibling;
> >-        }
> 
> Why is this not needed anymore?

That code handles panels that hold more than one iframe, which only happens if you're using SharedFrame.
Comment on attachment 8475453 [details] [diff] [review]
fix social marks button

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

r=me with src added back
Attachment #8475453 - Flags: review?(mhammond)
Attachment #8475453 - Flags: review?(jaws)
Attachment #8475453 - Flags: review+
updated from review comments.   note: beta patch will be slightly different, will post shortly
Attachment #8475453 - Attachment is obsolete: true
Attachment #8476182 - Flags: review+
comment updated
Attachment #8475555 - Attachment is obsolete: true
Attachment #8476184 - Flags: review+
beta-specific version of patch, depends on bug 1056415

try: https://tbpl.mozilla.org/?tree=Try&rev=17368a857389
Attachment #8476372 - Flags: review?(jaws)
Attachment #8476372 - Flags: review?(jaws) → review+
That last push was the patch that doesn't need beta uplift (just aurora), here's the one that beta needs:

https://hg.mozilla.org/integration/fx-team/rev/9dc1be8e11e2
Florin, this should be landing across branches and uplifting to Beta tonight for the 32.0b9. Please make sure this gets tested as part of your sign offs.
Flags: qe-verify+
Flags: needinfo?(florin.mezei)
https://hg.mozilla.org/mozilla-central/rev/ce160cc9a93f
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Comment on attachment 8476182 [details] [diff] [review]
fix social marks button

Approval Request Comment
[Feature/regressing bug #]: socialmarks
[User impact if declined]: will only work in first used window for multiple window users
[Describe test coverage new/current, TBPL]: manual testing
[Risks and why]: low
[String/UUID change made/needed]: none
Attachment #8476182 - Flags: approval-mozilla-aurora?
Comment on attachment 8476372 [details] [diff] [review]
fix social marks button (beta patch)

Approval Request Comment
[Feature/regressing bug #]: socialmarks
[User impact if declined]: will only work in first used window for multiple window users
[Describe test coverage new/current, TBPL]: manual testing
[Risks and why]: low
[String/UUID change made/needed]: none
Attachment #8476372 - Flags: approval-mozilla-beta?
Comment on attachment 8476184 [details] [diff] [review]
dont use menupanel

Approval Request Comment
[Feature/regressing bug #]: loop and social api status buttons
[User impact if declined]: will only work in first used window for multiple window users
[Describe test coverage new/current, TBPL]: manual testing
[Risks and why]: low
[String/UUID change made/needed]: none
Attachment #8476184 - Flags: approval-mozilla-aurora?
Attachment #8476182 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attachment #8476184 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 8476372 [details] [diff] [review]
fix social marks button (beta patch)

Thanks to Shane for verifying this fix on fx-team. beta+
Attachment #8476372 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: needinfo?(florin.mezei)
QA Contact: florin.mezei
Verified fixed on Windows 7 64bit, Windows 7 32bit, Windows 8 64bit, Windows XP 32bit using Firefox 32 Beta 9 (buildID: 20140822024446), latest Aurora 33.0a2 (buildID: 20140823004001) and latest Nightly 34.0a1 (buildID: 20140824030210).
Iteration: --- → 34.3
Summary: SharedFrame docshell swapping is broken (Loop and SocialAPI affected) → Fix SharedFrame docshell swapping for SocialAPI (not Loop)
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: