From 81b3c4bcbbd10bea562ff35f3a05de70cb2c7b4b Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Wed, 6 Oct 2010 15:05:50 -0700 Subject: [PATCH] Bug 567652: Long names of add-ons should wrap/crop in the UI. r=Unfocused, a=blocks-final --- .../mozapps/extensions/content/extensions.js | 2 +- .../mozapps/extensions/content/extensions.xml | 164 +++++++++--------- .../mozapps/extensions/content/extensions.xul | 5 +- .../test/browser/browser_details.js | 16 +- .../test/browser/browser_searching.js | 2 +- 5 files changed, 99 insertions(+), 90 deletions(-) diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 94e6964f9546..6eb2fb18a93d 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -1855,7 +1855,7 @@ var gDetailView = { this.node.setAttribute("type", aAddon.type); - document.getElementById("detail-name").value = aAddon.name; + document.getElementById("detail-name").textContent = aAddon.name; var icon = aAddon.icon64URL ? aAddon.icon64URL : aAddon.iconURL; document.getElementById("detail-icon").src = icon ? icon : null; document.getElementById("detail-creator").setCreator(aAddon.creator, aAddon.homepageURL); diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml index a2a84a98580e..9fece4ffca16 100644 --- a/toolkit/mozapps/extensions/content/extensions.xml +++ b/toolkit/mozapps/extensions/content/extensions.xml @@ -743,91 +743,99 @@ oncommand="document.getBindingParent(this).undo();"/> - - - - - + + + + - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - diff --git a/toolkit/mozapps/extensions/content/extensions.xul b/toolkit/mozapps/extensions/content/extensions.xul index 7ef3a4f0b332..058c6f1b995a 100644 --- a/toolkit/mozapps/extensions/content/extensions.xul +++ b/toolkit/mozapps/extensions/content/extensions.xul @@ -442,11 +442,12 @@ - - diff --git a/toolkit/mozapps/extensions/test/browser/browser_details.js b/toolkit/mozapps/extensions/test/browser/browser_details.js index 9acb907eefdb..c5bd94950675 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_details.js +++ b/toolkit/mozapps/extensions/test/browser/browser_details.js @@ -141,7 +141,7 @@ function end_test() { // Opens and tests the details view for add-on 1 add_test(function() { open_details("addon1@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 1", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 1", "Name should be correct"); is_element_visible(get("detail-version"), "Version should not be hidden"); is(get("detail-version").value, "2.1", "Version should be correct"); is(get("detail-icon").src, "chrome://foo/skin/icon64.png", "Icon should be correct"); @@ -239,7 +239,7 @@ add_test(function() { // Opens and tests the details view for add-on 2 add_test(function() { open_details("addon2@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 2", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 2", "Name should be correct"); is_element_visible(get("detail-version"), "Version should not be hidden"); is(get("detail-version").value, "2.2", "Version should be correct"); is(get("detail-icon").src, "chrome://foo/skin/icon.png", "Icon should be correct"); @@ -287,7 +287,7 @@ add_test(function() { // Opens and tests the details view for add-on 3 add_test(function() { open_details("addon3@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 3", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 3", "Name should be correct"); is_element_hidden(get("detail-version"), "Version should be hidden"); is(get("detail-icon").src, "", "Icon should be correct"); @@ -362,7 +362,7 @@ add_test(function() { // Opens and tests the details view for add-on 4 add_test(function() { open_details("addon4@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 4", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 4", "Name should be correct"); is_element_hidden(get("detail-prefs"), "Preferences button should be hidden"); is_element_visible(get("detail-enable"), "Enable button should be visible"); @@ -430,7 +430,7 @@ add_test(function() { // Opens and tests the details view for add-on 5 add_test(function() { open_details("addon5@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 5", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 5", "Name should be correct"); is_element_hidden(get("detail-prefs"), "Preferences button should be hidden"); is_element_hidden(get("detail-enable"), "Enable button should be hidden"); @@ -453,7 +453,7 @@ add_test(function() { // Opens and tests the details view for add-on 6 add_test(function() { open_details("addon6@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 6", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 6", "Name should be correct"); is_element_hidden(get("detail-prefs"), "Preferences button should be hidden"); is_element_hidden(get("detail-enable"), "Enable button should be hidden"); @@ -513,7 +513,7 @@ add_test(function() { // Opens and tests the details view for add-on 7 add_test(function() { open_details("addon7@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 7", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 7", "Name should be correct"); is_element_hidden(get("detail-prefs"), "Preferences button should be hidden"); is_element_visible(get("detail-enable"), "Enable button should be visible"); @@ -575,7 +575,7 @@ add_test(function() { // Opens and tests the details view for add-on 8 add_test(function() { open_details("addon8@tests.mozilla.org", "extension", function() { - is(get("detail-name").value, "Test add-on 8", "Name should be correct"); + is(get("detail-name").textContent, "Test add-on 8", "Name should be correct"); is_element_hidden(get("detail-prefs"), "Preferences button should be hidden"); is_element_hidden(get("detail-enable"), "Enable button should be hidden"); diff --git a/toolkit/mozapps/extensions/test/browser/browser_searching.js b/toolkit/mozapps/extensions/test/browser/browser_searching.js index 2b43e4a5a137..57d8eda1514c 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_searching.js +++ b/toolkit/mozapps/extensions/test/browser/browser_searching.js @@ -433,7 +433,7 @@ add_test(function() { list.ensureElementIsVisible(item); EventUtils.synthesizeMouse(item, 2, 2, { clickCount: 2 }, gManagerWindow); wait_for_view_load(gManagerWindow, function() { - var name = gManagerWindow.document.getElementById("detail-name").value; + var name = gManagerWindow.document.getElementById("detail-name").textContent; is(name, item.mAddon.name, "Name in detail view should be correct"); var version = gManagerWindow.document.getElementById("detail-version").value; is(version, item.mAddon.version, "Version in detail view should be correct");