Closed
Bug 477754
Opened 17 years ago
Closed 17 years ago
[RTL] Customize toolbar sheet is placed mostly outside of the browser
Categories
(Firefox :: Toolbars and Customization, defect, P2)
Tracking
()
VERIFIED
FIXED
Firefox 3.6a1
People
(Reporter: whimboo, Assigned: ehsan.akhgari)
References
Details
(Keywords: regression, rtl, verified1.9.1)
Attachments
(4 files, 5 obsolete files)
|
92.04 KB,
image/jpeg
|
Details | |
|
65.09 KB,
image/jpeg
|
Details | |
|
1.94 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
|
3.75 KB,
patch
|
enndeakin
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; he; rv:1.9.1b3pre) Gecko/20090207 Shiretoko/3.1b3pre
Calling the customize toolbar sheet via the context menu of the toolbar, opens the sheet mostly outside of the current browser window. See the attached screenshot.
Steps:
1. Start Firefox
2. Open Context menu of the navigation toolbar
3. Click on Customize
No idea if this only happens on OS X. Someone should verify this topic on Windows or Linux too. I believe that is a regression, or?
Flags: blocking-firefox3.1?
Comment 1•17 years ago
|
||
Regression range?
Flags: blocking-firefox3.1? → blocking-firefox3.1+
Priority: -- → P2
Updated•17 years ago
|
Keywords: regressionwindow-wanted
| Reporter | ||
Comment 2•17 years ago
|
||
The regression range is somewhere before FF3.0b3. Means back in 2007. The latest build I was able to test is 08010104. Builds from 2007 don't work with the force locale extension. I don't have time right now to get an exact time frame for rtl locales.
| Reporter | ||
Comment 3•17 years ago
|
||
And as a side note. With Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 everything is fine.
| Assignee | ||
Comment 4•17 years ago
|
||
(In reply to comment #2)
> The regression range is somewhere before FF3.0b3. Means back in 2007. The
> latest build I was able to test is 08010104. Builds from 2007 don't work with
> the force locale extension. I don't have time right now to get an exact time
> frame for rtl locales.
I wonder how much a regression window that old will be of help. I think we can just fix it. I bet it's a problem with the position of the popup (like the one we had in bug 427739 for example), but I'll be sure when I take a closer look.
| Assignee | ||
Comment 5•17 years ago
|
||
This should fix the problem. I submitted a try server build with the rtlcustomize tag for Henrik to test.
Comment 6•17 years ago
|
||
That really really feels like a bug in .openPopup - according to the screenshot, it's giving an x offset from the logical start of the element, and then treating "after_start" as a physical "after" == "right". Either one of those could be justified, but both together aren't very reasonable.
Regression range should be pretty easy to find, since you would probably only need to look at two things: when Mano landed the popup panel for Mac, and when Enn landed the popup rewrite.
Updated•17 years ago
|
Keywords: regressionwindow-wanted
| Reporter | ||
Updated•17 years ago
|
Keywords: regressionwindow-wanted
Summary: Customize toolbar sheet is placed mostly outside of the browser → [RTL] Customize toolbar sheet is placed mostly outside of the browser
Updated•17 years ago
|
Keywords: regressionwindow-wanted
| Assignee | ||
Comment 7•17 years ago
|
||
Try server build from my patch: <https://build.mozilla.org/tryserver-builds/2009-02-10_20:16-ehsan.akhgari@gmail.com-rtlcustomize/>
Comment 8•17 years ago
|
||
The position "after_start" should already be handling right-to-left, assuming
that the popup has a computed style of 'direction: rtl'.
The x/y coordinates are not adjusted in this way though, but that has always
been the case and isn't a regression. I could see why that itself would be a
bug though.
Assuming that direction: rtl applies here, it would really be more correct to update the x/y rather than changing the position argument.
| Assignee | ||
Comment 9•17 years ago
|
||
| Assignee | ||
Comment 10•17 years ago
|
||
Comment on attachment 361776 [details] [diff] [review]
Patch (v2)
Please disregard the previous patch and its try server build (I had forgot to qrefresh). This new patch implements the behavior according to comment 8. I'll also submit a try server build right away.
Attachment #361776 -
Attachment description: Patch → Patch (v2)
Attachment #361776 -
Attachment is patch: true
Attachment #361776 -
Attachment mime type: application/octet-stream → text/plain
Attachment #361776 -
Flags: review?(enndeakin)
| Assignee | ||
Updated•17 years ago
|
Attachment #361705 -
Attachment is obsolete: true
Comment 11•17 years ago
|
||
I don't follow this calculation:
+ if (rtl)
+ startPhysicalXOffset = sheetWidth - startPhysicalXOffset;
Can you explain what is trying to calculate?
| Assignee | ||
Comment 12•17 years ago
|
||
In LTR, the logical x offset is calculated from the left side, whereas for RTL it's calculated from the right side. Since the offset is equal at both the left and right, |sheetWidth - startPhysicalXOffset| in RTL would be the logical x offset of the end (left-most) point of the popup, which is the physical x offset.
Updated•17 years ago
|
Keywords: regression,
regressionwindow-wanted
| Assignee | ||
Comment 13•17 years ago
|
||
Try server builds for the correct patch: <https://build.mozilla.org/tryserver-builds/2009-02-11_08:11-ehsan.akhgari@gmail.com-rtlcustomize/>
| Reporter | ||
Comment 14•17 years ago
|
||
Even when the panel was rewritten for FF3.0 it is a regression against FF2.0.0.x. Adding back the keyword.
Ehsan, I ran your tryserver build with the force rtl extension, but the problem isn't fixed. Submitted the wrong patch?
Keywords: regression
| Assignee | ||
Comment 15•17 years ago
|
||
Can you please try it with the fa langpack so that we can be sure it's not a deficiency in Force RTL getting in the way?
BTW, just to check, you tested with the second try server build, right? And did you observe anything different at all?
| Reporter | ||
Comment 16•17 years ago
|
||
Yes, I did. See the attachment for the behavior with the fa.xpi installed instead of using the force locale extension.
| Assignee | ||
Comment 17•17 years ago
|
||
Ah, Neil, shouldn't this:
+ startPhysicalXOffset = sheetWidth - startPhysicalXOffset;
be:
+ startPhysicalXOffset = window.innerWidth - startPhysicalXOffset;
? I think this is what I intended to do, but mistakenly used sheetWidth there. I have submitted a new try server build.
Comment 18•17 years ago
|
||
That makes more sense, yes.
| Assignee | ||
Comment 19•17 years ago
|
||
The patch with the fix mentioned in comment 17.
Attachment #361776 -
Attachment is obsolete: true
Attachment #361836 -
Flags: review?(enndeakin)
Attachment #361776 -
Flags: review?(enndeakin)
Comment 20•17 years ago
|
||
(In reply to comment #19)
> Created an attachment (id=361836) [details]
> Patch (v3)
>
> The patch with the fix mentioned in comment 17.
So direction: rtl doesn't apply to the popup?
| Assignee | ||
Comment 21•17 years ago
|
||
(In reply to comment #20)
> So direction: rtl doesn't apply to the popup?
It was, that's why "after_start" position works, right?
Comment 22•17 years ago
|
||
In rtl mode, after_start should be aligning the popup along the right edge of
gNavToolbox then adding the x offset. Maybe I'm not interpreting this right,
but it seems to me that
if (rtl)
startPhysicalXOffset = -startPhysicalXOffset;
is all that is needed.
Do you not have access to a Mac to test?
Comment 23•17 years ago
|
||
You *should* be able to test the sheet's behavior without a Mac, by just removing the ifneq/endif around http://mxr.mozilla.org/comm-central/source/mozilla/browser/base/Makefile.in#75 (though it's been a while since I last tried).
| Assignee | ||
Comment 24•17 years ago
|
||
Try server build available at: <https://build.mozilla.org/tryserver-builds/2009-02-11_12:48-ehsan.akhgari@gmail.com-rtlcustomize3/>. I don't have a Mac, but I'll try Phil's suggestion.
| Reporter | ||
Comment 25•17 years ago
|
||
Sorry but with the latest tryserver build its even getting worth. It's shifted more to the right as it was before.
| Reporter | ||
Comment 26•17 years ago
|
||
(In reply to comment #25)
> Sorry but with the latest tryserver build its even getting worth.
That should be called out worse! Hey, it as worth commenting on that.
Comment 27•17 years ago
|
||
Comment on attachment 361836 [details] [diff] [review]
Patch (v3)
Henrik implies that this isn't right.
Attachment #361836 -
Flags: review?(enndeakin) → review-
| Assignee | ||
Comment 28•17 years ago
|
||
(In reply to comment #8)
> The position "after_start" should already be handling right-to-left, assuming
> that the popup has a computed style of 'direction: rtl'.
I think this may not be correct. I don't see the source code handling RTL mode at all <http://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/nsMenuPopupFrame.cpp#451>. In other words, both the position and x-offset arguments are physical, so I think position should be adjusted. The reason my first patch didn't work was sending the wrong patch; I tested this one using the trick Phil suggested in comment 23.
Attachment #361836 -
Attachment is obsolete: true
Attachment #362091 -
Flags: review?(enndeakin)
Comment 29•17 years ago
|
||
It is handled in nsMenuPopupFrame::AdjustPositionForAnchorAlign.
| Assignee | ||
Comment 30•17 years ago
|
||
Oh, I see. Sorry for my mistake.
So, how would you like to fix this issue in core like this?
With this patch, the issue is solved, and I think all other popups work correctly.
Attachment #362091 -
Attachment is obsolete: true
Attachment #362102 -
Flags: review?(enndeakin)
Attachment #362091 -
Flags: review?(enndeakin)
| Assignee | ||
Comment 31•17 years ago
|
||
Oops, wrong patch.
Attachment #362102 -
Attachment is obsolete: true
Attachment #362103 -
Flags: review?(enndeakin)
Attachment #362102 -
Flags: review?(enndeakin)
Comment 32•17 years ago
|
||
Comment on attachment 362103 [details] [diff] [review]
Try to fix in core
Could cause some compatibility problems, but this is probably the right thing to do. Maybe not for 3.1 though.
Care to write a simple test?
Attachment #362103 -
Flags: review?(enndeakin) → review+
| Assignee | ||
Comment 33•17 years ago
|
||
(In reply to comment #32)
> (From update of attachment 362103 [details] [diff] [review])
> Could cause some compatibility problems, but this is probably the right thing
> to do. Maybe not for 3.1 though.
I agree. Can we stick to attachment 362091 [details] [diff] [review] for 3.1?
> Care to write a simple test?
Sure, I'm on it.
Comment 34•17 years ago
|
||
> I agree. Can we stick to attachment 362091 [details] [diff] [review] for 3.1?
OK, let's do that for 3.1 then.
| Assignee | ||
Comment 35•17 years ago
|
||
Comment on attachment 361836 [details] [diff] [review]
Patch (v3)
(for 3.1)
Attachment #361836 -
Flags: review- → review?(enndeakin)
| Assignee | ||
Updated•17 years ago
|
Attachment #361836 -
Attachment is obsolete: false
Updated•17 years ago
|
Attachment #362091 -
Flags: review+
Comment 36•17 years ago
|
||
Comment on attachment 361836 [details] [diff] [review]
Patch (v3)
You want the 'v1, corrected' patch
Attachment #361836 -
Flags: review?(enndeakin)
| Assignee | ||
Comment 37•17 years ago
|
||
Patch for 1.9.2. The code part is the same as attachment 362103 [details] [diff] [review]. I wrote a simple mochitest for this behavior as well.
Attachment #362103 -
Attachment is obsolete: true
Attachment #362250 -
Flags: superreview?(roc)
Attachment #362250 -
Flags: review?(enndeakin)
| Assignee | ||
Comment 38•17 years ago
|
||
Comment on attachment 362091 [details] [diff] [review]
Patch (v1, corrected) [landed on 1.9.1]
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/dc200d20b109
Attachment #362091 -
Attachment description: Patch (v1, corrected) → Patch (v1, corrected) [landed on 1.9.1]
Attachment #362091 -
Attachment is obsolete: false
| Assignee | ||
Updated•17 years ago
|
Attachment #361836 -
Attachment is obsolete: true
| Assignee | ||
Updated•17 years ago
|
Keywords: fixed1.9.1
Attachment #362250 -
Flags: superreview?(roc) → superreview+
Comment 39•17 years ago
|
||
(In reply to Comment #23 From Phil Ringnalda (:philor))
> You *should* be able to test the sheet's behavior without a Mac, by just
> removing the ifneq/endif around
In SeaMonkey you can just flip the pref |toolbar.customization.usesheet| to |true| no need to restart.
So attachment 362250 [details] [diff] [review] Isn't needed on 1.9.2 right? only 1.9.1?
| Reporter | ||
Comment 40•17 years ago
|
||
Verified fixed on 1.9.1 with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; fa; rv:1.9.1b3pre) Gecko/20090214 Shiretoko/3.1b3pre. Thanks Ehsan.
Keywords: fixed1.9.1 → verified1.9.1
| Assignee | ||
Comment 41•17 years ago
|
||
(In reply to comment #39)
> So attachment 362250 [details] [diff] [review] Isn't needed on 1.9.2 right? only 1.9.1?
No, attachment 362091 [details] [diff] [review] is for 1.9.1 (which is landed and verified to fix this bug). Attachment 362250 [details] [diff] fixes the core bug which causes this, and is intended for 1.9.2.
Comment 42•17 years ago
|
||
Comment on attachment 362250 [details] [diff] [review]
Core fix
This looks good, however the anchor label should appear closer to the middle of the window, for example:
<hbox pack="center">
<label id="anchor" value="Anchor"/>
</hbox>
This way the popup constraining to the window size wouldn't have a possible impact on the outcome.
>+ let containerWidth = 300;
>+ let windowWidth = window.innerWidth;
>+ let popupWidth = 200;
These three aren't used.
Attachment #362250 -
Flags: review?(enndeakin) → review+
| Assignee | ||
Comment 43•17 years ago
|
||
Landed with the requested changes: <http://hg.mozilla.org/mozilla-central/rev/2b893b177eca>
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.2a1
| Reporter | ||
Comment 44•17 years ago
|
||
Verified with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; fa; rv:1.9.2a1pre) Gecko/20090210 Minefield/3.2a1pre ID:20090210022740
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•