Make HTML tooltips have the directionality of their parent element. Bug 91312, patch mostly by Ilya Konstantinov <mozilla-bugzilla@future.shiny.co.il>, r=Mano, sr=Neil

This commit is contained in:
smontagu%smontagu.org 2006-09-14 06:09:49 +00:00
Родитель 9ac579f595
Коммит 69723cceb9
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -251,17 +251,26 @@ function FillInHTMLTooltip(tipElement)
var titleText = null;
var XLinkTitleText = null;
var direction = tipElement.ownerDocument.dir;
while (!titleText && !XLinkTitleText && tipElement) {
if (tipElement.nodeType == Node.ELEMENT_NODE) {
titleText = tipElement.getAttribute("title");
XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title");
var defView = tipElement.ownerDocument.defaultView;
// XXX Work around bug 350679:
// "Tooltips can be fired in documents with no view".
if (!defView)
return retVal;
direction = defView.getComputedStyle(tipElement, "")
.getPropertyValue("direction");
}
tipElement = tipElement.parentNode;
}
var texts = [titleText, XLinkTitleText];
var tipNode = document.getElementById("aHTMLTooltip");
tipNode.style.direction = direction;
for (var i = 0; i < texts.length; ++i) {
var t = texts[i];