From 2fa25bdbf430936782c72293841b0f4497628bd9 Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Fri, 8 Feb 2002 22:30:17 +0000 Subject: [PATCH] 60245 - no tooltips for "title" attribute in sidebar. r=sgehani sr=hewitt --- xpfe/browser/resources/content/browser.js | 44 +++++++++++++++++ xpfe/browser/resources/content/navigator.js | 47 ------------------- .../sidebar/resources/sidebarOverlay.xul | 6 ++- 3 files changed, 49 insertions(+), 48 deletions(-) diff --git a/xpfe/browser/resources/content/browser.js b/xpfe/browser/resources/content/browser.js index 91af2e0b005..a21164edf17 100644 --- a/xpfe/browser/resources/content/browser.js +++ b/xpfe/browser/resources/content/browser.js @@ -199,3 +199,47 @@ function getMarkupDocumentViewer() { return getBrowser().markupDocumentViewer; } + +/** + * Content area tooltip. + * XXX - this must move into XBL binding/equiv! Do not want to pollute + * navigator.js with functionality that can be encapsulated into + * browser widget. TEMPORARY! + * + * NOTE: Any changes to this routine need to be mirrored in ChromeListener::FindTitleText() + * (located in mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp) + * which performs the same function, but for embedded clients that + * don't use a XUL/JS layer. It is important that the logic of + * these two routines be kept more or less in sync. + * (pinkerton) + **/ +function FillInHTMLTooltip(tipElement) +{ + const XLinkNS = "http://www.w3.org/1999/xlink"; + + var retVal = false; + + var titleText = null; + var XLinkTitleText = null; + + while (!titleText && !XLinkTitleText && tipElement) { + if (tipElement.nodeType == Node.ELEMENT_NODE) { + titleText = tipElement.getAttribute("title"); + XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); + } + tipElement = tipElement.parentNode; + } + + var texts = [titleText, XLinkTitleText]; + var tipNode = document.getElementById("aHTMLTooltip"); + + for (var i = 0; i < texts.length; ++i) { + var t = texts[i]; + if (t && t.search(/\S/) >= 0) { + tipNode.setAttribute("label", t); + retVal = true; + } + } + + return retVal; +} diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index 37ca4e9e99e..2dd259a4f6a 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -1179,53 +1179,6 @@ function checkForDirectoryListing() } } -/** - * Content area tooltip. - * XXX - this must move into XBL binding/equiv! Do not want to pollute - * navigator.js with functionality that can be encapsulated into - * browser widget. TEMPORARY! - * - * NOTE: Any changes to this routine need to be mirrored in ChromeListener::FindTitleText() - * (located in mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp) - * which performs the same function, but for embedded clients that - * don't use a XUL/JS layer. It is important that the logic of - * these two routines be kept more or less in sync. - * (pinkerton) - **/ -function FillInHTMLTooltip(tipElement) -{ - var retVal = false; - - if (tipElement.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") - return retVal; - - const XLinkNS = "http://www.w3.org/1999/xlink"; - - var titleText = null; - var XLinkTitleText = null; - - while (!titleText && !XLinkTitleText && tipElement) { - if (tipElement.nodeType == Node.ELEMENT_NODE) { - titleText = tipElement.getAttribute("title"); - XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); - } - tipElement = tipElement.parentNode; - } - - var texts = [titleText, XLinkTitleText]; - var tipNode = document.getElementById("aHTMLTooltip"); - - for (var i = 0; i < texts.length; ++i) { - var t = texts[i]; - if (t && t.search(/\S/) >= 0) { - tipNode.setAttribute("label", t); - retVal = true; - } - } - - return retVal; -} - /** * Use Stylesheet functions. * Written by Tim Hill (bug 6782) diff --git a/xpfe/components/sidebar/resources/sidebarOverlay.xul b/xpfe/components/sidebar/resources/sidebarOverlay.xul index c7257642123..70451113074 100644 --- a/xpfe/components/sidebar/resources/sidebarOverlay.xul +++ b/xpfe/components/sidebar/resources/sidebarOverlay.xul @@ -31,6 +31,8 @@ +