Bug 693551 - Old tooltip appears when the SVG object that the mouse is over is removed. r=dao

This commit is contained in:
Robert Longson 2011-12-17 09:14:20 +00:00
parent 615cc68512
commit 9e5b0923d9

View File

@ -3011,9 +3011,10 @@ function getMarkupDocumentViewer()
function FillInHTMLTooltip(tipElement)
{
var retVal = false;
// Don't show the tooltip if the tooltip node is a XUL element or a document.
// Don't show the tooltip if the tooltip node is a XUL element, a document or is disconnected.
if (tipElement.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" ||
!tipElement.ownerDocument)
!tipElement.ownerDocument ||
tipElement.ownerDocument.compareDocumentPosition(tipElement) == document.DOCUMENT_POSITION_DISCONNECTED)
return retVal;
const XLinkNS = "http://www.w3.org/1999/xlink";
@ -3041,10 +3042,10 @@ function FillInHTMLTooltip(tipElement)
while (!titleText && !XLinkTitleText && !SVGTitleText && tipElement) {
if (tipElement.nodeType == Node.ELEMENT_NODE) {
titleText = tipElement.getAttribute("title");
if ((tipElement instanceof HTMLAnchorElement && tipElement.href) ||
(tipElement instanceof HTMLAreaElement && tipElement.href) ||
(tipElement instanceof HTMLLinkElement && tipElement.href) ||
(tipElement instanceof SVGAElement && tipElement.hasAttributeNS(XLinkNS, "href"))) {
if ((tipElement instanceof HTMLAnchorElement ||
tipElement instanceof HTMLAreaElement ||
tipElement instanceof HTMLLinkElement ||
tipElement instanceof SVGAElement) && tipElement.href) {
XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title");
}
if (lookingForSVGTitle &&