Bug 433340 bookmark dialog covers candidate window when using IMEr=enndeakin, sr=neil, a=mtschrep

This commit is contained in:
masayuki@d-toybox.com 2008-05-22 21:47:24 -07:00
parent 834ed0d2cf
commit ea12641ca1
3 changed files with 24 additions and 4 deletions

View File

@ -856,6 +856,7 @@ GK_ATOM(tooltip, "tooltip")
GK_ATOM(tooltiptext, "tooltiptext")
GK_ATOM(top, "top")
GK_ATOM(topmargin, "topmargin")
GK_ATOM(topmost, "topmost")
GK_ATOM(toppadding, "toppadding")
GK_ATOM(tr, "tr")
GK_ATOM(trailing, "trailing")

View File

@ -189,6 +189,21 @@ nsMenuPopupFrame::IsNoAutoHide()
nsGkAtoms::_true, eIgnoreCase));
}
PRBool
nsMenuPopupFrame::IsTopMost()
{
// If this popup is not a panel, this is always a topmost popup.
if (mPopupType != ePopupTypePanel)
return PR_TRUE;
// Web pages should not be able to create a topmost panel. If this panel is
// a noautohide panel, it should appear just above the parent window.
if (mInContentShell || IsNoAutoHide())
return PR_FALSE;
// Otherwise, check the topmost attribute.
return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::topmost,
nsGkAtoms::_true, eIgnoreCase);
}
void
nsMenuPopupFrame::EnsureWidget()
{
@ -218,11 +233,11 @@ nsMenuPopupFrame::CreateWidgetForView(nsIView* aView)
tag = parentContent->Tag();
widgetData.mDropShadow = !(viewHasTransparentContent || tag == nsGkAtoms::menulist);
// panels which don't auto-hide need a parent widget. This allows them
// to always appear in front of the parent window but behind other windows
// that should be in front of it.
// panels which are not topmost need a parent widget. This allows them to
// always appear in front of the parent window but behind other windows that
// should be in front of it.
nsCOMPtr<nsIWidget> parentWidget;
if (IsNoAutoHide()) {
if (!IsTopMost()) {
nsCOMPtr<nsISupports> cont = PresContext()->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(cont);
if (!dsti)

View File

@ -180,6 +180,10 @@ public:
// true. These panels do not roll up automatically.
PRBool IsNoAutoHide();
// returns true if the popup is a top-most window. Otherwise, the
// panel appears in front of the parent window.
PRBool IsTopMost();
void EnsureWidget();
virtual nsresult CreateWidgetForView(nsIView* aView);