Bug 721442 - [New Tab Page] Display the URL of the page on mouseover of thumbnails on about:newtab; r=dietrich
This commit is contained in:
@@ -119,10 +119,13 @@ Site.prototype = {
|
||||
* Renders the site's data (fills the HTML fragment).
|
||||
*/
|
||||
_render: function Site_render() {
|
||||
let title = this.title || this.url;
|
||||
let url = this.url;
|
||||
let title = this.title || url;
|
||||
let tooltip = (title == url ? title : title + "\n" + url);
|
||||
|
||||
let link = this._querySelector(".newtab-link");
|
||||
link.setAttribute("title", title);
|
||||
link.setAttribute("href", this.url);
|
||||
link.setAttribute("title", tooltip);
|
||||
link.setAttribute("href", url);
|
||||
this._querySelector(".newtab-title").textContent = title;
|
||||
|
||||
if (this.isPinned())
|
||||
|
||||
@@ -20,6 +20,7 @@ _BROWSER_FILES = \
|
||||
browser_newtab_reset.js \
|
||||
browser_newtab_tabsync.js \
|
||||
browser_newtab_unpin.js \
|
||||
browser_newtab_bug721442.js \
|
||||
browser_newtab_bug722273.js \
|
||||
browser_newtab_bug723102.js \
|
||||
browser_newtab_bug723121.js \
|
||||
|
||||
23
browser/base/content/test/newtab/browser_newtab_bug721442.js
Normal file
23
browser/base/content/test/newtab/browser_newtab_bug721442.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function runTests() {
|
||||
setLinks("0,1,2,3,4,5,6,7,8");
|
||||
NewTabUtils.pinnedLinks._links = [
|
||||
{url: "about:blank#7", title: ""},
|
||||
{url: "about:blank#8", title: "title"},
|
||||
{url: "about:blank#9", title: "about:blank#9"}
|
||||
];
|
||||
|
||||
yield addNewTabPageTab();
|
||||
checkGrid("7p,8p,9p,0,1,2,3,4,5");
|
||||
|
||||
checkTooltip(0, "about:blank#7", "1st tooltip is correct");
|
||||
checkTooltip(1, "title\nabout:blank#8", "2nd tooltip is correct");
|
||||
checkTooltip(2, "about:blank#9", "3rd tooltip is correct");
|
||||
}
|
||||
|
||||
function checkTooltip(aIndex, aExpected, aMessage) {
|
||||
let link = getCell(aIndex).node.querySelector(".newtab-link");
|
||||
is(link.getAttribute("title"), aExpected, aMessage);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ function addNewTabPageTab() {
|
||||
function checkGrid(aSitesPattern, aSites) {
|
||||
let length = aSitesPattern.split(",").length;
|
||||
let sites = (aSites || getGrid().sites).slice(0, length);
|
||||
let expected = sites.map(function (aSite) {
|
||||
let current = sites.map(function (aSite) {
|
||||
if (!aSite)
|
||||
return "";
|
||||
|
||||
@@ -208,7 +208,7 @@ function checkGrid(aSitesPattern, aSites) {
|
||||
return aSite.url.replace(/^about:blank#(\d+)$/, "$1") + (pinned ? "p" : "");
|
||||
});
|
||||
|
||||
is(aSitesPattern, expected, "grid status = " + aSitesPattern);
|
||||
is(current, aSitesPattern, "grid status = " + aSitesPattern);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user