Bug 676220 - Clear the popup blocker's list of popup items every time the menu is hidden. r=Neil

This commit is contained in:
Edmund Wong 2012-04-02 15:43:02 +08:00
Родитель 140329f87c
Коммит c5d6edb7af
4 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -162,7 +162,8 @@
<menupopup id="popupBlockerMenu"
oncommand="popupBlockerMenuCommand(event.target);"
onpopupshowing="return popupBlockerMenuShowing(event)"/>
onpopupshowing="return popupBlockerMenuShowing(event);"
onpopuphiding="RemovePopupsItems(this);"/>
<!-- Items are generated, see popupBlockerMenuShowing() -->
<menupopup id="popupNotificationMenu"/>
<menupopup id="networkProperties"/>

Просмотреть файл

@ -601,7 +601,8 @@
label="&cookiePopupManager.label;"
accesskey="&cookiePopupManager.accesskey;"
oncommand="popupBlockerMenuCommand(event.target);">
<menupopup onpopupshowing="CheckForVisibility(event);">
<menupopup onpopupshowing="CheckForVisibility(event);"
onpopuphiding="RemovePopupsItems(this);">
<menuitem id="AllowPopups"
label="&cookieAllowPopupsCmd.label;"
accesskey="&cookieAllowPopupsCmd.accesskey;"

Просмотреть файл

@ -1161,11 +1161,14 @@ function popupNotificationMenuShowing(event)
separator.hidden = !createShowPopupsMenu(event.target, notificationbox.activeBrowser);
}
function createShowPopupsMenu(parent, browser)
function RemovePopupsItems(parent)
{
while (parent.lastChild && ("popup" in parent.lastChild))
parent.removeChild(parent.lastChild);
}
function createShowPopupsMenu(parent, browser)
{
if (!browser)
return false;

Просмотреть файл

@ -465,7 +465,8 @@
<menupopup id="popupNotificationMenu"
oncommand="popupBlockerMenuCommand(event.target);"
onpopupshowing="return popupNotificationMenuShowing(event)">
onpopupshowing="return popupNotificationMenuShowing(event);"
onpopuphiding="RemovePopupsItems(this);">
<menuitem id="allowPopupsForSite" hidden="true" accesskey="&allowPopups.accesskey;"
oncommand="this.notificationbox.allowPopupsForSite(event);"/>
<menuitem id="showPopupManager" label="&showPopupManager.label;"