Comment 38 for bug 187313

Revision history for this message
In , Enn (enndeakin) wrote :

Comment on attachment 316915
fix v2

>-nsMenuPopupFrame::InitializePopupAtScreen(PRInt32 aXPos, PRInt32 aYPos)
>+nsMenuPopupFrame::InitializePopupAtScreen(PRInt32 aXPos, PRInt32 aYPos,
>+ PRBool aIsContextMenu)
> {
> EnsureWidget();
>
> mPopupState = ePopupShowing;
> mAnchorContent = nsnull;
> mScreenXPos = aXPos;
> mScreenYPos = aYPos;
> mPopupAnchor = POPUPALIGNMENT_NONE;
> mPopupAlignment = POPUPALIGNMENT_NONE;
>+ mIsContextMenu = aIsContextMenu;
>+ mAdjustOffsetForContextMenu = aIsContextMenu;

mAdjustOffsetForContextMenu should be set to false for the other two InitializeX methods.

> screenViewLocY = nsPresContext::CSSPixelsToAppUnits(mScreenYPos) / factor;
>+ PRInt32 offsetForContextMenuCSS = mAdjustOffsetForContextMenu ? 2 : 0;
>+ PRInt32 offsetForContextMenuDev =
>+ nsPresContext::CSSPixelsToAppUnits(offsetForContextMenu) / factor;

You meant 'offsetForContextMenuCSS' here right?

I assume with this patch that the test for contextmenus (test_contextmenu_list.xul) works ok?

I'm not a superreviewer, so let's ask the other Neil.