зеркало из https://github.com/mozilla/gecko-dev.git
Bug 614152, don't set popupNode when opening notification popup, otherwise page context menu won't appear, r=dao, a=blocking
This commit is contained in:
Родитель
92c34066a7
Коммит
7a2b126e4c
|
@ -10,6 +10,9 @@
|
|||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<notificationbox id="nb"/>
|
||||
<menupopup id="menupopup" onpopupshown="this.hidePopup()" onpopuphidden="checkPopupClosed()">
|
||||
<menuitem label="One"/>
|
||||
</menupopup>
|
||||
|
||||
<!-- test results are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
|
||||
|
@ -26,7 +29,7 @@ var testtag_notificationbox_buttons = [
|
|||
label: "Button 1",
|
||||
accesskey: "u",
|
||||
callback: testtag_notificationbox_buttonpressed,
|
||||
popup: null
|
||||
popup: "menupopup"
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -273,10 +276,14 @@ var appendPriorityTests = [
|
|||
return priority;
|
||||
},
|
||||
result: function(nb, priority) {
|
||||
if (priority == nb.PRIORITY_CRITICAL_BLOCK)
|
||||
SimpleTest.finish();
|
||||
else
|
||||
if (priority == nb.PRIORITY_CRITICAL_BLOCK) {
|
||||
let ntf = nb.appendNotification("Notification", "note", "happy.png",
|
||||
nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons);
|
||||
setTimeout(checkPopupTest, 50, nb, ntf);
|
||||
}
|
||||
else {
|
||||
runTimedTests(appendPriorityTests, -1, nb, ++priority);
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
@ -319,6 +326,23 @@ function testtag_notification_State(nb, ntf, testid, label, value, image, priori
|
|||
ise(ntf.type, type, testid + " notification.type");
|
||||
}
|
||||
|
||||
function checkPopupTest(nb, ntf)
|
||||
{
|
||||
if (nb._animating)
|
||||
setTimeout(checkPopupTest, ntf);
|
||||
else {
|
||||
var evt = { target: ntf, originalTarget: ntf, stopPropagation: function() { } };
|
||||
evt.target.buttonInfo = testtag_notificationbox_buttons[0];
|
||||
ntf._doButtonCommand(evt);
|
||||
}
|
||||
}
|
||||
|
||||
function checkPopupClosed()
|
||||
{
|
||||
is(document.popupNode, null, "popupNode null after popup is closed");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
/**
|
||||
* run one or more tests which perform a test operation, wait for a delay,
|
||||
* then perform a result operation.
|
||||
|
|
|
@ -714,8 +714,6 @@
|
|||
this.showCommentColumn = this.mInput.showCommentColumn;
|
||||
this.showImageColumn = this.mInput.showImageColumn;
|
||||
|
||||
document.popupNode = null;
|
||||
|
||||
var rect = aElement.getBoundingClientRect();
|
||||
var nav = aElement.ownerDocument.defaultView.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIWebNavigation);
|
||||
|
@ -809,7 +807,6 @@
|
|||
<![CDATA[
|
||||
if (this.mPopupOpen) {
|
||||
this.hidePopup();
|
||||
document.popupNode = null;
|
||||
this.removeAttribute("width");
|
||||
}
|
||||
]]>
|
||||
|
@ -963,7 +960,6 @@
|
|||
this.mInput = aInput;
|
||||
// clear any previous selection, see bugs 400671 and 488357
|
||||
this.selectedIndex = -1;
|
||||
document.popupNode = null;
|
||||
|
||||
var width = aElement.getBoundingClientRect().width;
|
||||
this.setAttribute("width", width > 100 ? width : 100);
|
||||
|
|
|
@ -865,7 +865,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
document.popupNode = null;
|
||||
this._autoScrollPopup.showPopup(document.documentElement,
|
||||
event.screenX,
|
||||
event.screenY,
|
||||
|
|
|
@ -399,9 +399,8 @@
|
|||
|
||||
var button = aEvent.target.buttonInfo;
|
||||
if (button.popup) {
|
||||
document.popupNode = aEvent.target;
|
||||
document.getElementById(button.popup).
|
||||
showPopup(aEvent.originalTarget, -1, -1, "popup", "bottomleft", "topleft");
|
||||
openPopup(aEvent.originalTarget, "after_start", 0, 0, false, false, aEvent);
|
||||
aEvent.stopPropagation();
|
||||
}
|
||||
else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче