return this.boxObject; width) width = accel.boxObject.width; } } } for (var i = 0; i < array.length; i++) array[i].width = width; ]]> 0 true null 0) { arrowbox.pack = "end"; } else { arrowbox.pack = "start"; } arrowbox.style.transform = "translate(0, " + -offset + "px)"; // The assigned side stays the same regardless of direction. var isRTL = (window.getComputedStyle(this).direction == "rtl"); if (position.indexOf("start_") == 0) { container.dir = "reverse"; this.setAttribute("side", isRTL ? "left" : "right"); } else { container.dir = ""; this.setAttribute("side", isRTL ? "right" : "left"); } } else if (position.indexOf("before_") == 0 || position.indexOf("after_") == 0) { container.orient = ""; arrowbox.orient = ""; if (position.indexOf("_end") > 0) { arrowbox.pack = "end"; } else { arrowbox.pack = "start"; } arrowbox.style.transform = "translate(" + -offset + "px, 0)"; if (position.indexOf("before_") == 0) { container.dir = "reverse"; this.setAttribute("side", "bottom"); } else { container.dir = ""; this.setAttribute("side", "top"); } } arrow.hidden = false; ]]> this.hidePopup(true), fadeDelay, this); } ]]> let animate = (this.getAttribute("animate") != "false"); if (this._fadeTimer) { clearTimeout(this._fadeTimer); if (animate) { this.setAttribute("animate", "fade"); } } else if (animate) { this.setAttribute("animate", "cancel"); } this.setAttribute("panelopen", "true"); this.removeAttribute("panelopen"); if (this.getAttribute("animate") != "false") { this.removeAttribute("animate"); } 0 false without a title, we should show // the current file selection. if (!titleText && tipElement instanceof HTMLInputElement && tipElement.type == 'file' && !tipElement.hasAttribute('title')) { let files = tipElement.files; try { var bundle = Components.classes['@mozilla.org/intl/stringbundle;1'] .getService(Components.interfaces.nsIStringBundleService) .createBundle("chrome://global/locale/layout/HtmlForm.properties"); if (files.length == 0) { if (tipElement.multiple) { titleText = bundle.GetStringFromName("NoFilesSelected"); } else { titleText = bundle.GetStringFromName("NoFileSelected"); } } else { titleText = files[0].name; // For UX and performance (jank) reasons we cap the number of // files that we list in the tooltip to 20 plus a "and xxx more" // line, or to 21 if exactly 21 files were picked. const TRUNCATED_FILE_COUNT = 20; let count = Math.min(files.length, TRUNCATED_FILE_COUNT); for (let i = 1; i < count; ++i) { titleText += "\n" + files[i].name; } if (files.length == TRUNCATED_FILE_COUNT + 1) { titleText += "\n" + files[TRUNCATED_FILE_COUNT].name; } else if (files.length > TRUNCATED_FILE_COUNT + 1) { let xmoreStr = bundle.GetStringFromName("AndNMoreFiles"); let xmoreNum = files.length - TRUNCATED_FILE_COUNT; let tmp = {}; Components.utils.import("resource://gre/modules/PluralForm.jsm", tmp); let andXMoreStr = tmp.PluralForm.get(xmoreNum, xmoreStr).replace("#1", xmoreNum); titleText += "\n" + andXMoreStr; } } } catch(e) {} } // Check texts against null so that title="" can be used to undefine a // title on a child element. while (tipElement && (titleText == null) && (XLinkTitleText == null) && (SVGTitleText == null) && (XULtooltiptextText == null)) { if (tipElement.nodeType == Node.ELEMENT_NODE) { if (tipElement.namespaceURI == XULNS) XULtooltiptextText = tipElement.getAttribute("tooltiptext"); else titleText = tipElement.getAttribute("title"); if ((tipElement instanceof HTMLAnchorElement || tipElement instanceof HTMLAreaElement || tipElement instanceof HTMLLinkElement || tipElement instanceof SVGAElement) && tipElement.href) { XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } if (lookingForSVGTitle && (!(tipElement instanceof SVGElement) || tipElement.parentNode.nodeType == Node.DOCUMENT_NODE)) { lookingForSVGTitle = false; } if (lookingForSVGTitle) { for (let childNode of tipElement.childNodes) { if (childNode instanceof SVGTitleElement) { SVGTitleText = childNode.textContent; break; } } } direction = defView.getComputedStyle(tipElement, "") .getPropertyValue("direction"); } tipElement = tipElement.parentNode; } this.style.direction = direction; return [titleText, XLinkTitleText, SVGTitleText, XULtooltiptextText].some(function (t) { if (t && /\S/.test(t)) { // Make CRLF and CR render one line break each. this.label = t.replace(/\r\n?/g, '\n'); return true; } return false; }, this); ]]> 1) this.hidePopup(); return; } // find out if the node we are entering is one of our anonymous children while (rel) { if (rel == this) break; rel = rel.parentNode; } // if the entered node is not a descendant of ours, hide the tooltip if (rel != this && this._isMouseOver) { this.hidePopup(); } ]]>