Bug 1443635 - Remove the custom XUL <update> tag r=Paolo draft
authorTimothy Guan-tin Chien <timdream@gmail.com>
Tue, 06 Mar 2018 14:05:03 -0800
changeset 764489 4d13ea216a88bb4a0272ac756dba2d50216fca35
parent 763903 c7543a3e938d5ec408a7d0c93dc71b40607e7d5b
push id101769
push usertimdream@gmail.com
push dateWed, 07 Mar 2018 21:00:32 +0000
reviewersPaolo
bugs1443635
milestone60.0a1
Bug 1443635 - Remove the custom XUL <update> tag r=Paolo Restore it to be <richlistitem>s so that nsAccessibilityService can produce correct accessibles. MozReview-Commit-ID: 1QiGyKPNifZ
browser/components/preferences/in-content/tests/browser_advanced_update.js
toolkit/mozapps/update/content/history.js
toolkit/mozapps/update/content/updates.css
--- a/browser/components/preferences/in-content/tests/browser_advanced_update.js
+++ b/browser/components/preferences/in-content/tests/browser_advanced_update.js
@@ -125,17 +125,17 @@ add_task(async function() {
   is(dialogOverlay.style.visibility, "", "The dialog should be invisible");
   let promiseSubDialogLoaded = promiseLoadSubDialog("chrome://mozapps/content/update/history.xul");
   showBtn.doCommand();
   await promiseSubDialogLoaded;
   is(dialogOverlay.style.visibility, "visible", "The dialog should be visible");
 
   let dialogFrame = dialogOverlay.querySelector(".dialogFrame");
   let frameDoc = dialogFrame.contentDocument;
-  let updates = frameDoc.querySelectorAll("update");
+  let updates = frameDoc.querySelectorAll("richlistitem.update");
 
   // Test the update history numbers are correct
   is(updates.length, mockUpdateManager.updateCount, "The update count is incorrect.");
 
   // Test the updates are displayed correctly
   let update = null;
   let updateData = null;
   for (let i = 0; i < updates.length; ++i) {
--- a/toolkit/mozapps/update/content/history.js
+++ b/toolkit/mozapps/update/content/history.js
@@ -21,25 +21,27 @@ var gUpdateHistory = {
     if (uc) {
       while (this._view.hasChildNodes())
         this._view.firstChild.remove();
 
       var bundle = document.getElementById("updateBundle");
 
       for (var i = 0; i < uc; ++i) {
         var update = um.getUpdateAt(i);
+
         if (!update || !update.name)
           continue;
 
         // Don't display updates that are downloading since they don't have
         // valid statusText for the UI (bug 485493).
         if (!update.statusText)
           continue;
 
-        var element = document.createElementNS(NS_XUL, "update");
+        var element = document.createElementNS(NS_XUL, "richlistitem");
+        element.className = "update";
         this._view.appendChild(element);
         element.name = bundle.getFormattedString("updateFullName",
           [update.name, update.buildID]);
         element.installDate = this._formatDate(update.installDate);
         if (update.detailsURL)
           element.detailsURL = update.detailsURL;
         else
           element.hideDetailsURL = true;
--- a/toolkit/mozapps/update/content/updates.css
+++ b/toolkit/mozapps/update/content/updates.css
@@ -1,15 +1,15 @@
 /* Stop animations on pages that aren't on the current page (bug 341749). */
 #updates:not([currentpageid="checking"]) #checkingProgress,
 #updates:not([currentpageid="downloading"]) #downloadProgress {
   display: none;
 }
 
-/* Hide the wizard's header so the size of the billboard can size the window 
+/* Hide the wizard's header so the size of the billboard can size the window
    on creation. A custom header will be used in its place when a header is
    needed. */
 .wizard-header {
   display: none;
 }
 
 /* Display the custom header */
 .update-header {
@@ -21,13 +21,13 @@
    have an updateheader on the billboard page. */
 updateheader {
   -moz-binding: url("chrome://mozapps/content/update/updates.xml#updateheader");
   display: -moz-box;
   -moz-box-orient: horizontal;
 }
 
 /* Update History Window */
-update {
+richlistitem.update {
   -moz-binding: url("chrome://mozapps/content/update/updates.xml#update");
   display: -moz-box;
   -moz-box-orient: vertical;
 }