Adding the ability for popups to not install the keyboard navigation listener. Needed for autocomplete. R=hyatt

This commit is contained in:
saari%netscape.com 2000-05-01 22:27:16 +00:00
parent fa49948d4f
commit 7c3c972751
3 changed files with 12 additions and 0 deletions

View File

@ -85,6 +85,7 @@ XUL_ATOM(popup, "popup") // The popup for a context menu, popup menu, or tooltip
XUL_ATOM(menugenerated, "menugenerated") // Internal
XUL_ATOM(popupanchor, "popupanchor") // Anchor for popups
XUL_ATOM(popupalign, "popupalign") // Alignment for popups
XUL_ATOM(ignorekeys, "ignorekeys") // Alignment for popups
XUL_ATOM(key, "key") // A key element
XUL_ATOM(broadcaster, "broadcaster") // A broadcaster

View File

@ -551,8 +551,18 @@ nsPopupSetFrame::OpenPopup(PRBool aActivateFlag)
nsIFrame* activeChild = GetActiveChild();
nsCOMPtr<nsIMenuParent> childPopup = do_QueryInterface(activeChild);
UpdateDismissalListener(childPopup);
// First check and make sure this popup wants keyboard navigation
// popupsetframe::mElementFrame
nsCOMPtr<nsIContent> content;
mElementFrame->GetContent(getter_AddRefs(content));
nsAutoString property;
content->GetAttribute(kNameSpaceID_None, nsXULAtoms::ignorekeys, property);
if (! property.EqualsWithConversion("true")) {
childPopup->InstallKeyboardNavigator();
}
}
else {
if (!OnDestroy())
return;

View File

@ -85,6 +85,7 @@ XUL_ATOM(popup, "popup") // The popup for a context menu, popup menu, or tooltip
XUL_ATOM(menugenerated, "menugenerated") // Internal
XUL_ATOM(popupanchor, "popupanchor") // Anchor for popups
XUL_ATOM(popupalign, "popupalign") // Alignment for popups
XUL_ATOM(ignorekeys, "ignorekeys") // Alignment for popups
XUL_ATOM(key, "key") // A key element
XUL_ATOM(broadcaster, "broadcaster") // A broadcaster