Bug 300808 - When content is removed from the document the corresponding tooltip should not appear, r=neil, sr=bzbarsky

This commit is contained in:
martijn.martijn%gmail.com 2006-06-21 03:10:01 +00:00
parent 8205c52d84
commit d3c534ab22
2 changed files with 40 additions and 0 deletions

View File

@ -3734,6 +3734,27 @@ nsBrowserStatusHandler.prototype =
onLocationChange : function(aWebProgress, aRequest, aLocation)
{
if (document.tooltipNode) {
// Optimise for the common case
if (aWebProgress.DOMWindow == content) {
document.getElementById("aHTMLTooltip").hidePopup();
document.tooltipNode = null;
}
else {
for (var tooltipWindow =
document.tooltipNode.target.ownerDocument.defaultView;
tooltipWindow != tooltipWindow.parent;
tooltipWindow = tooltipWindow.parent) {
if (tooltipWindow == aWebProgress.DOMWindow) {
document.getElementById("aHTMLTooltip").hidePopup();
document.tooltipNode = null;
break;
}
}
}
}
// This code here does not compare uris exactly when determining
// whether or not the message should be hidden since the message
// may be prematurely hidden when an install is invoked by a click

View File

@ -271,6 +271,25 @@ nsBrowserStatusHandler.prototype =
}
}
if (document.tooltipNode) {
// Optimise for the common case
if (aWebProgress.DOMWindow == content) {
document.getElementById("aHTMLTooltip").hidePopup();
document.tooltipNode = null;
} else {
for (var tooltipWindow =
document.tooltipNode.target.ownerDocument.defaultView;
tooltipWindow != tooltipWindow.parent;
tooltipWindow = tooltipWindow.parent) {
if (tooltipWindow == aWebProgress.DOMWindow) {
document.getElementById("aHTMLTooltip").hidePopup();
document.tooltipNode = null;
break;
}
}
}
}
// XXX temporary hack for bug 104532.
// Depends heavily on setOverLink implementation
if (!aRequest)