Bug 662855 - window.top.content is null (unable to view feed entries) f=jh r=neil a=Callek.
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 12 Jun 2011 18:56:57 +0100
changeset 7821 9ac9d52ebefff007a29363584479b15407ad15e3
parent 7820 e3aefa68c6462049d7b5cd7310a5ab4137b633d9
child 7822 4ce2cb0ba5c0af6d51bad5e6ea1e64c942ca8815
push id25
push userphilip.chee@gmail.com
push dateFri, 24 Jun 2011 10:27:33 +0000
treeherdercomm-beta@4ce2cb0ba5c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, Callek
bugs662855
Bug 662855 - window.top.content is null (unable to view feed entries) f=jh r=neil a=Callek.
suite/mailnews/mailWindowOverlay.js
--- a/suite/mailnews/mailWindowOverlay.js
+++ b/suite/mailnews/mailWindowOverlay.js
@@ -3080,22 +3080,22 @@ function FeedSetContentViewToggle()
 {
   gShowFeedSummaryToggle = true;
   FeedSetContentView(gShowFeedSummary ? 0 : 1);
 }
 
 // Check message format
 function FeedCheckContentFormat()
 {
-  var contentWindowDoc = window.top.content.document;
-
-  // Not an rss message
+  // Not an rss message. This also rules out no 3pane to get the browser of.
   if (!gFolderDisplay.selectedMessageIsFeed)
     return false;
 
+  var contentWindowDoc = getBrowser().contentDocument;
+
   // Thunderbird 2 rss messages with 'Show article summary' not selected,
   // ie message body constructed to show web page in an iframe, can't show
   // a summary - notify user.
   var rssIframe = contentWindowDoc.getElementById('_mailrssiframe');
   if (rssIframe) {
     if (gShowFeedSummaryToggle || pref.getIntPref("rss.show.summary") == 1)
       gShowFeedSummaryToggle = false;
     return false;
@@ -3109,17 +3109,17 @@ function FeedSetContentView(val)
 {
   // Check it..
   if (!FeedCheckContentFormat())
     return;
 
   var showSummary;
   var wintype = document.documentElement.getAttribute('windowtype');
   var contentBase = currentHeaderData["content-base"];
-  var contentWindowDoc = window.top.content.document;
+  var contentWindowDoc = getBrowser().contentDocument;
   var divHTML = new XPCNativeWrapper(contentWindowDoc,
                       "getElementsByClassName()")
                       .getElementsByClassName("moz-text-html")[0];
   var divPLAIN = new XPCNativeWrapper(contentWindowDoc,
                       "getElementsByClassName()")
                       .getElementsByClassName("moz-text-plain")[0];
 
   if (val == null)