view source on feeds preview shows contents of wrong page

VERIFIED FIXED

Status

()

--
critical
VERIFIED FIXED
12 years ago
12 years ago

People

(Reporter: darin.moz, Assigned: sayrer)

Tracking

({verified1.8.1.1})

Trunk
verified1.8.1.1
Points:
---
Bug Flags:
blocking1.8.1.1 +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
Using:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060808 BonEcho/2.0b1

Steps:
1- navigate to http://news.com.com/2547-1_3-0-20.xml
2- click on a link
3- click back button
4- do view source

Problem:
Source is shown for the link that you clicked on instead of for the feed you are viewing.
There must be another step involved somewhere, because with the same build and OS, I get the source for the feed when I go back, no matter which link I follow.
(Reporter)

Comment 2

12 years ago
Weird, I cannot reproduce it either.  I wonder what other step I did to be able to reproduce the problem so easily this morning :-(
(Assignee)

Comment 3

12 years ago
I can see it. OS 10.4 / Trunk 09/13/2006.

Comment 4

12 years ago
100% reproducible here. Easiest way to repro is hitting back then forward: you get the source of this page.

WinXP
(Assignee)

Comment 5

12 years ago
Yeah, I still have this.

Comment 6

12 years ago
I also have this happening.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

1) Visit an feed (checked an rss or atom). ie: http://googleblog.blogspot.com/atom.xml

2) View the source: displays the xml source for the feed.

3) Click on a link in side the feed. 

4) View the source: displays the (x)html source for the page.

5) Click back button.

6) View the source: displays the (x)html source of the page you were just at. It should be displaying the XML source from the feed.
Just so we're all on the same page, this is the code in question from viewSource.js:

var PageLoader = getBrowser().webNavigation.QueryInterface(pageLoaderIface);

try {
...
  // Load the page using the page descriptor rather than the URL.
  // This allows the content to be fetched from the cache (if
  // possible) rather than the network...
  PageLoader.loadPage(arg, pageLoaderIface.DISPLAY_AS_SOURCE);
...
}
catch (ex) {
  // Ignore the failure.  The content will be loaded via the URL
  // that was supplied in arg[0].
}

AFAIT LoadPage takes the right document here (which probably isn't cached considering the way feed preview works), but instead of throwing loads the document of the previous SHEntry.
Component: RSS Discovery and Preview → Embedding: Docshell
Product: Firefox → Core
QA Contact: rss.preview → docshell
Version: 2.0 Branch → Trunk
> AFAIT LoadPage takes the right document here 

Really?  I used the following steps:

1)  Start browser
2)  Load http://news.com.com/2547-1_3-0-20.xml
3)  Back
4)  Forward
5)  View source

In LoadPage, the URI of the incoming SHentry is <http://www.mozilla.org/projects/minefield/>.

Checking what GetCurrentDescriptor is returning, it looks like at the point when we call GetCurrentDescriptor the history entry of the docshell is the entry for the document in bfcache.

So what the _heck_ is RSS doing to cause this situation?  ;)  This should _so_ not be happening.  Like "code not designed to handle this" not happening.
Severity: normal → critical
Flags: blocking1.9?
Flags: blocking1.8.1.1?
OS: Windows XP → All
Hardware: PC → All
OK.  So when loading the RSS feed from history I first hit nsDocShell::EndPageLoad, called when the HTTP channel is removed from the loadgroup.  _Then_ I hit nsDocShell::Embed when the jar channel calls OnStartRequest.

That's backwards.  So we first null out mLSHE in EndPageLoad, then have nothing to set mOSHE to in Embed.
I didn't actually inpect the SHEntry, just the incoming content document...
  handleResult: function FC_handleResult(result) {

(in FeedConverter.js) never sets a loadgroup on the channel it opens.  That's the problem.
Back to where this bug came from.  This is so not a core Gecko issue.  ;)
Component: Embedding: Docshell → RSS Discovery and Preview
Flags: blocking1.9?
Product: Core → Firefox
QA Contact: docshell → rss.preview
Just to clarify my nomination, this code is putting the docshell in an inconsistent and unexpected state.  I can't guarantee that it doesn't crash, isn't exploitable, etc.
Flags: blocking-firefox3?
(Assignee)

Comment 14

12 years ago
Created attachment 245976 [details] [diff] [review]
set the loadGroup
(Assignee)

Updated

12 years ago
Attachment #245976 - Flags: review?(mano)
(Assignee)

Updated

12 years ago
Assignee: nobody → sayrer
Comment on attachment 245976 [details] [diff] [review]
set the loadGroup

interactive r=mano.
Attachment #245976 - Flags: review?(mano) → review+
(Assignee)

Comment 16

12 years ago
Checking in FeedConverter.js;
/cvsroot/mozilla/browser/components/feeds/src/FeedConverter.js,v  <--  FeedConverter.js
new revision: 1.22; previous revision: 1.21
done
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Land this on branch too?
(Assignee)

Updated

12 years ago
Attachment #245976 - Flags: approval1.8.1.1?
Flags: blocking1.8.1.1? → blocking1.8.1.1+
Comment on attachment 245976 [details] [diff] [review]
set the loadGroup

approved for 1.8 branch, a=dveditz for drivers
Attachment #245976 - Flags: approval1.8.1.1? → approval1.8.1.1+
Whiteboard: [checkin needed (1.8 branch)]
(Assignee)

Comment 19

12 years ago
Checking in FeedConverter.js;
/cvsroot/mozilla/browser/components/feeds/src/FeedConverter.js,v  <--  FeedConverter.js
new revision: 1.1.2.21; previous revision: 1.1.2.20
done
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
Keywords: fixed1.8.1 → fixed1.8.1.1

Comment 20

12 years ago
v.fixed on 1.8.1 branch and Trunk/1.9 with 
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1pre) Gecko/20061128 BonEcho/2.0.0.1pre
and
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a1) Gecko/20061128 Minefield/3.0a1

View->Page Source shows the proper source for feed xml page.
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1.1 → verified1.8.1.1

Updated

12 years ago
Depends on: 363740

Updated

12 years ago
Flags: blocking-firefox3?
You need to log in before you can comment on or make changes to this bug.