Bug 1286844 - Add [title] for source location onto the inner ltr element;r=jsnajdr
MozReview-Commit-ID: 1TcAKapccsf
--- a/devtools/client/shared/components/frame.js
+++ b/devtools/client/shared/components/frame.js
@@ -205,36 +205,37 @@ module.exports = createClass({
attributes["data-column"] = column;
}
sourceElements.push(dom.span({ className: "frame-link-line" }, lineInfo));
}
// Inner el is useful for achieving ellipsis on the left and correct LTR/RTL
// ordering. See CSS styles for frame-link-source-[inner] and bug 1290056.
- let sourceInnerEl = dom.span({ className: "frame-link-source-inner" },
- sourceElements);
+ let sourceInnerEl = dom.span({
+ className: "frame-link-source-inner",
+ title: isLinkable ?
+ l10n.getFormatStr("frame.viewsourceindebugger", tooltip) : tooltip,
+ }, sourceElements);
// If source is not a URL (self-hosted, eval, etc.), don't make
// it an anchor link, as we can't link to it.
if (isLinkable) {
sourceEl = dom.a({
onClick: e => {
e.preventDefault();
onClick(this.getSource(frame));
},
href: source,
className: "frame-link-source",
draggable: false,
- title: l10n.getFormatStr("frame.viewsourceindebugger", tooltip)
}, sourceInnerEl);
} else {
sourceEl = dom.span({
className: "frame-link-source",
- title: tooltip,
}, sourceInnerEl);
}
elements.push(sourceEl);
if (showHost && host) {
elements.push(dom.span({ className: "frame-link-host" }, host));
}
--- a/devtools/client/shared/components/test/mochitest/head.js
+++ b/devtools/client/shared/components/test/mochitest/head.js
@@ -144,23 +144,24 @@ var TEST_TREE = {
* Frame
*/
function checkFrameString({ frame, file, line, column, source, functionName, shouldLink, tooltip }) {
let el = frame.getDOMNode();
let $ = selector => el.querySelector(selector);
let $func = $(".frame-link-function-display-name");
let $source = $(".frame-link-source");
+ let $sourceInner = $(".frame-link-source-inner");
let $filename = $(".frame-link-filename");
let $line = $(".frame-link-line");
is($filename.textContent, file, "Correct filename");
is(el.getAttribute("data-line"), line ? `${line}` : null, "Expected `data-line` found");
is(el.getAttribute("data-column"), column ? `${column}` : null, "Expected `data-column` found");
- is($source.getAttribute("title"), tooltip, "Correct tooltip");
+ is($sourceInner.getAttribute("title"), tooltip, "Correct tooltip");
is($source.tagName, shouldLink ? "A" : "SPAN", "Correct linkable status");
if (shouldLink) {
is($source.getAttribute("href"), source, "Correct source");
}
if (line != null) {
let lineText = `:${line}`;
if (column != null) {