Last Comment Bug 796222 - Create panels with more appropriate default width to avoid mis-aligned anchor
: Create panels with more appropriate default width to avoid mis-aligned anchor
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: SocialAPI (show other bugs)
: unspecified
: All All
: -- normal (vote)
: Firefox 18
Assigned To: Mark Hammond [:markh]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-01 17:19 PDT by Mark Hammond [:markh]
Modified: 2012-10-05 07:37 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
fixed


Attachments
Set the width of the iframe on creation to the panel default width (1000 bytes, patch)
2012-10-03 23:10 PDT, Mark Hammond [:markh]
jaws: review+
gavin.sharp: approval‑mozilla‑aurora+
Details | Diff | Review

Description Mark Hammond [:markh] 2012-10-01 17:19:39 PDT
The panels we create seem to have a default width of around 100x100, before we then resize the panel to fit the content - but still use a fixed width of 330px.  This resize behaviour causes the panel anchor to be in the wrong position when first displayed (see bug 793057).

We can work around that issue by arranging for the panels to always be created with an initial width of 330px.
Comment 1 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2012-10-01 18:02:38 PDT
I think we should kill the max-width while we're at it, either that or make max-width = min(600, screen.width / 2);
Comment 2 Mark Hammond [:markh] 2012-10-01 18:23:42 PDT
Actually, we don't have a max-width at all - we have a totally fixed width.  The CSS from the amigo currently don't offer any clues we can use at all - if we try and use the offsetWidth, for example, we will end up with all panels being exactly 100px wide (as that is what the CSS says).  I'm hoping to chat with them today about this.
Comment 3 Mark Hammond [:markh] 2012-10-03 23:10:25 PDT
Created attachment 667818 [details] [diff] [review]
Set the width of the iframe on creation to the panel default width
Comment 4 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2012-10-04 18:01:04 PDT
Comment on attachment 667818 [details] [diff] [review]
Set the width of the iframe on creation to the panel default width

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

::: browser/base/content/browser-social.js
@@ +612,5 @@
>          notificationFrame.setAttribute("id", notificationFrameId);
>          notificationFrame.setAttribute("mozbrowser", "true");
> +        // work around bug 793057 - by making the panel roughly the final size
> +        // we are more likely to have the anchor in the correct position.
> +        notificationFrame.style.width = "330px";

Can we set this width in a CSS rule for .social-panel-frame ?
Comment 5 (Away 6/25-7/4) Jared Wein [:jaws] (reviews and needinfo disabled until back) 2012-10-04 20:48:56 PDT
Comment on attachment 667818 [details] [diff] [review]
Set the width of the iframe on creation to the panel default width

Discussed this on IRC and the solution of setting this value in external CSS will propagate a value among various files, removing the containment of a current workaround (the 330px seen elsewhere in browser-social.js).
Comment 6 Mark Hammond [:markh] 2012-10-04 21:02:40 PDT
As discussed on IRC with Jaws, we are keeping the code where it is, but using the constant PANEL_MIN_WIDTH introduced with bug 797716.

https://hg.mozilla.org/integration/mozilla-inbound/rev/5b5981c2106b
Comment 7 Ed Morley [:emorley] 2012-10-05 03:56:33 PDT
https://hg.mozilla.org/mozilla-central/rev/5b5981c2106b
Comment 8 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-10-05 07:37:12 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/52b3f1c7ca9a

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