Bug 1573881 - Port Bug 782623 "Add meta tag property attribute to pageInfo view" to SeaMonkey. r=frg a=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Fri, 23 Aug 2019 01:16:22 +0200
changeset 32283 75fdb3e8faeddcaee43ecf5a013d67b5bc7647fc
parent 32282 4c7254e896da4a576e86382325eb5e58f897ce00
child 32284 575c624a707ba1cecb92f5db5c70d9f10c21df61
push id211
push userfrgrahl@gmx.net
push dateThu, 22 Aug 2019 23:17:49 +0000
treeherdercomm-esr60@75fdb3e8faed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1573881, 782623
Bug 1573881 - Port Bug 782623 "Add meta tag property attribute to pageInfo view" to SeaMonkey. r=frg a=frg
suite/browser/pageinfo/pageInfo.js
--- a/suite/browser/pageinfo/pageInfo.js
+++ b/suite/browser/pageinfo/pageInfo.js
@@ -474,26 +474,36 @@ function makeGeneralTab()
   // get the document characterset
   var encoding = gDocument.characterSet;
   document.getElementById("encodingtext").value = encoding;
 
   // get the meta tags
   var metaNodes = gDocument.getElementsByTagName("meta");
   var length = metaNodes.length;
 
-  var metaTagsCaption = document.getElementById("metaTagsCaption");
-  if (length == 1)
-    metaTagsCaption.label = gBundle.getString("generalMetaTag");
-  else
-    metaTagsCaption.label = gBundle.getFormattedString("generalMetaTags", [length]);
-  var metaTree = document.getElementById("metatree");
-  metaTree.view = gMetaView;
+  var metaGroup = document.getElementById("metaTags");
+  if (!length) {
+    metaGroup.collapsed = true;
+  }
+  else {
+    var metaTagsCaption = document.getElementById("metaTagsCaption");
+    if (length == 1)
+      metaTagsCaption.label = gBundle.getString("generalMetaTag");
+    else
+      metaTagsCaption.label = gBundle.getFormattedString("generalMetaTags", [length]);
+    var metaTree = document.getElementById("metatree");
+    metaTree.view = gMetaView;
 
-  for (var i = 0; i < length; i++)
-    gMetaView.addRow([metaNodes[i].name || metaNodes[i].httpEquiv, metaNodes[i].content]);
+    for (var i = 0; i < length; i++)
+      gMetaView.addRow([metaNodes[i].name || metaNodes[i].httpEquiv ||
+                        metaNodes[i].getAttribute("property"),
+                        metaNodes[i].content]);
+
+    metaGroup.collapsed = false;
+  }
 
   // get the date of last modification
   var modifiedText = formatDate(gDocument.lastModified, gStrings.notSet);
   document.getElementById("modifiedtext").value = modifiedText;
 
   // get cache info
   var cacheKey = url.replace(/#.*$/, "");
   openCacheEntry(cacheKey, function(cacheEntry) {