Bug 1251569 - It's not possible to hide the Blocked Popup menu by clicking its anchor button in urlbar. r=Dolske

MozReview-Commit-ID: 7L6JwLNJt5x

--HG--
extra : rebase_source : 97d9188694ecfeeb08fcea26797018cf5f38ccad
This commit is contained in:
Marco Bonardo 2016-09-28 13:52:44 +02:00
Родитель a4f3312d22
Коммит ab630e99be
2 изменённых файлов: 8 добавлений и 3 удалений

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

@ -398,9 +398,11 @@ function findChildShell(aDocument, aDocShell, aSoughtURI) {
var gPopupBlockerObserver = { var gPopupBlockerObserver = {
_reportButton: null, _reportButton: null,
onReportButtonClick: function (aEvent) onReportButtonMousedown: function (aEvent)
{ {
if (aEvent.button != 0 || aEvent.target != this._reportButton) // If this method is called on the same event tick as the popup gets
// hidden, do nothing to avoid re-opening the popup.
if (aEvent.button != 0 || aEvent.target != this._reportButton || this.isPopupHidingTick)
return; return;
document.getElementById("blockedPopupOptions") document.getElementById("blockedPopupOptions")
@ -598,6 +600,9 @@ var gPopupBlockerObserver = {
if (aEvent.target.anchorNode.id == "page-report-button") if (aEvent.target.anchorNode.id == "page-report-button")
aEvent.target.anchorNode.removeAttribute("open"); aEvent.target.anchorNode.removeAttribute("open");
this.isPopupHidingTick = true;
setTimeout(() => this.isPopupHidingTick = false, 0);
let item = aEvent.target.lastChild; let item = aEvent.target.lastChild;
while (item && item.getAttribute("observes") != "blockedPopupsSeparator") { while (item && item.getAttribute("observes") != "blockedPopupsSeparator") {
let next = item.previousSibling; let next = item.previousSibling;

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

@ -766,7 +766,7 @@
class="urlbar-icon" class="urlbar-icon"
hidden="true" hidden="true"
tooltiptext="&pageReportIcon.tooltip;" tooltiptext="&pageReportIcon.tooltip;"
onclick="gPopupBlockerObserver.onReportButtonClick(event);"/> onmousedown="gPopupBlockerObserver.onReportButtonMousedown(event);"/>
<image id="reader-mode-button" <image id="reader-mode-button"
class="urlbar-icon" class="urlbar-icon"
hidden="true" hidden="true"