зеркало из https://github.com/mozilla/gecko-dev.git
Bug 45375 Long web page tooltips should wrap instead of being cropped (multiline tooltips)
Bug 67127 Newline in (web page) tooltips should not be converted to black bars Bug 356900 Low-spam place to work on previous two bugs. This fix is primarily short-term / for 1.8 branch, and should be revisited when reflow branch lands on trunk. r+sr=neil
This commit is contained in:
Родитель
f183b6a702
Коммит
fcf69e879c
|
@ -269,14 +269,21 @@ function FillInHTMLTooltip(tipElement)
|
|||
}
|
||||
|
||||
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];
|
||||
if (t && t.search(/\S/) >= 0) {
|
||||
// XXX - Short-term fix to bug 67127: collapse whitespace here
|
||||
tipNode.setAttribute("label", t.replace(/\s+/g, " ") );
|
||||
var hbox = document.getElementById("aHTMLTooltip").firstChild;
|
||||
hbox.style.direction = direction;
|
||||
var label = hbox.firstChild;
|
||||
label.textContent = t;
|
||||
|
||||
// Work around reflow bugs
|
||||
hbox.width = "";
|
||||
hbox.height = "";
|
||||
hbox.width = label.boxObject.width;
|
||||
hbox.height = label.boxObject.height;
|
||||
|
||||
retVal = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
***** END LICENSE BLOCK ***** -->
|
||||
|
||||
|
||||
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
||||
|
||||
<?xul-overlay href="chrome://navigator/content/navigatorOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://navigator/content/mailNavigatorOverlay.xul"?>
|
||||
|
@ -127,7 +127,11 @@
|
|||
|
||||
<popup id="backMenu" position="after_start" onpopupshowing="return BrowserBackMenu(event);" oncommand="gotoHistoryIndex(event);"/>
|
||||
<popup id="forwardMenu" position="after_start" onpopupshowing="return BrowserForwardMenu(event);" oncommand="gotoHistoryIndex(event);"/>
|
||||
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
|
||||
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);">
|
||||
<hbox>
|
||||
<label flex="1" class="htmltooltip-label"/>
|
||||
</hbox>
|
||||
</tooltip>
|
||||
<popup id="sidebarPopup"/>
|
||||
|
||||
<popupset id="bookmarksPopupset"/>
|
||||
|
|
|
@ -366,3 +366,10 @@ toolbarbutton.chevron {
|
|||
toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* For multi-line tooltips, we need our own style */
|
||||
.htmltooltip-label {
|
||||
max-width: 40em;
|
||||
margin: 0;
|
||||
white-space: -moz-pre-wrap;
|
||||
}
|
||||
|
|
|
@ -589,3 +589,10 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
|||
list-style-image: url("chrome://navigator/skin/icons/about-popups.gif");
|
||||
margin: 6px 0px;
|
||||
}
|
||||
|
||||
/* For multi-line tooltips, we need our own style */
|
||||
.htmltooltip-label {
|
||||
max-width: 40em;
|
||||
margin: 0;
|
||||
white-space: -moz-pre-wrap;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче