зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
9ac579f595
Коммит
69723cceb9
|
@ -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];
|
||||
|
|
Загрузка…
Ссылка в новой задаче