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)

3.5 Branch
x86
macOS
defect

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)

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?
Regression range?
Flags: blocking-firefox3.1? → blocking-firefox3.1+
Priority: -- → P2
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.
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.
(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: nobody → ehsan.akhgari
Status: NEW → ASSIGNED
Attached patch Patch (v1) (obsolete) — Splinter Review
This should fix the problem. I submitted a try server build with the rtlcustomize tag for Henrik to test.
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.
Summary: Customize toolbar sheet is placed mostly outside of the browser → [RTL] Customize toolbar sheet is placed mostly outside of the browser
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.
Attached patch Patch (v2) (obsolete) — Splinter Review
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)
Attachment #361705 - Attachment is obsolete: true
I don't follow this calculation: + if (rtl) + startPhysicalXOffset = sheetWidth - startPhysicalXOffset; Can you explain what is trying to calculate?
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.
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
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?
Yes, I did. See the attachment for the behavior with the fa.xpi installed instead of using the force locale extension.
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.
That makes more sense, yes.
Attached patch Patch (v3) (obsolete) — Splinter Review
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)
(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?
(In reply to comment #20) > So direction: rtl doesn't apply to the popup? It was, that's why "after_start" position works, right?
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?
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).
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.
Sorry but with the latest tryserver build its even getting worth. It's shifted more to the right as it was before.
(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 on attachment 361836 [details] [diff] [review] Patch (v3) Henrik implies that this isn't right.
Attachment #361836 - Flags: review?(enndeakin) → review-
(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)
It is handled in nsMenuPopupFrame::AdjustPositionForAnchorAlign.
Attached patch Try to fix in core (obsolete) — Splinter Review
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)
Attached patch Try to fix in core (obsolete) — Splinter Review
Oops, wrong patch.
Attachment #362102 - Attachment is obsolete: true
Attachment #362103 - Flags: review?(enndeakin)
Attachment #362102 - Flags: review?(enndeakin)
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+
(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.
> I agree. Can we stick to attachment 362091 [details] [diff] [review] for 3.1? OK, let's do that for 3.1 then.
Comment on attachment 361836 [details] [diff] [review] Patch (v3) (for 3.1)
Attachment #361836 - Flags: review- → review?(enndeakin)
Attachment #361836 - Attachment is obsolete: false
Attachment #362091 - Flags: review+
Comment on attachment 361836 [details] [diff] [review] Patch (v3) You want the 'v1, corrected' patch
Attachment #361836 - Flags: review?(enndeakin)
Attached patch Core fixSplinter Review
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)
Attachment #362091 - Attachment description: Patch (v1, corrected) → Patch (v1, corrected) [landed on 1.9.1]
Attachment #362091 - Attachment is obsolete: false
Attachment #361836 - Attachment is obsolete: true
Keywords: fixed1.9.1
Attachment #362250 - Flags: superreview?(roc) → superreview+
Blocks: 478531
(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?
Blocks: 406780
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.
(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 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+
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
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.

Attachment

General

Created:
Updated:
Size: