Closed
Bug 1279050
Opened 10 years ago
Closed 10 years ago
Scroll position and/or history is not retained after loading a redirected page
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
RESOLVED
FIXED
| Tracking | Status | |
|---|---|---|
| firefox49 | --- | unaffected |
| firefox50 | + | fixed |
People
(Reporter: Fanolian+BMO, Assigned: dragana)
References
Details
(Keywords: regression, Whiteboard: btpp-active)
Attachments
(1 file, 1 obsolete file)
|
6.26 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20160608030219
Steps to reproduce:
1. Load https://www.mozilla.org/contact/ . It should redirect to one of the locales, e.g. https://www.mozilla.org/en-US/contact/
2. Do one of the following:
2a. Scroll down. Reload the page; or
2b. Scroll down. Left-click "I have questions about using Mozilla’s trademarks" so it opens in the same tab. Press Back; or
2c. Scroll down, then paste https://www.mozilla.org/en-US/foundation/trademarks/policy/ into URL bar and navigate to it. Press Back.
Actual results:
Scroll positions are not remembered for all cases. As for 2b and 2c, the history of last page is lost so I cannot press Forward.
From mozregression:
Last good Nightly: 2016-06-06
First bad Nightly: 2016-06-07
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=396b577b98e64fe95223cfce095f84fe0a67da01&tochange=7f7c7d24700eb80ce328b05fd260ec58e9725ca4
Further bisection:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=0ac2f7a4fc731929c4872c147ee98dd03e9acd0a&tochange=eb3278ed4eb3e3924c556ef92ef4763008a537f3
Suspect: Bug 968273
Comment 2•10 years ago
|
||
[Tracking Requested - why for this release]: Regression
Severity: normal → major
Status: UNCONFIRMED → NEW
status-firefox49:
--- → unaffected
status-firefox50:
--- → affected
tracking-firefox50:
--- → ?
Ever confirmed: true
Flags: needinfo?(dd.mozilla)
Keywords: regression
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → dd.mozilla
Status: NEW → ASSIGNED
Flags: needinfo?(dd.mozilla)
| Assignee | ||
Updated•10 years ago
|
Component: Networking: Cache → Document Navigation
| Assignee | ||
Comment 3•10 years ago
|
||
The code that needs to be change is here:
http://mxr.mozilla.org/mozilla-central/source/docshell/base/nsDocShell.cpp#7466
probably checking if redirect is to the uri we are reloading...
| Assignee | ||
Comment 4•10 years ago
|
||
| Assignee | ||
Comment 5•10 years ago
|
||
bz, you are the right person to review this. Sorry for needinfo you, when you have time can you take a look.
I am not 100% sure is the the right place. It fixes the problem, but I am not sure of side paths.
Thanks.
Flags: needinfo?(bzbarsky)
Comment 6•10 years ago
|
||
I'm not sure of the various side-effects either. This is the first time I've seen this code in OnRedirectStateChange, and I'm not entirely sure what it's trying to do.
Olli, do you know what this stuff is about?
Dragana, what is the general goal of the patch?
Are there no places between the redirect notification and STATE_STOP that examine mLoadType?
Flags: needinfo?(bzbarsky) → needinfo?(bugs)
Comment 7•10 years ago
|
||
I'll be away this evening. I'll try to remember to look at this tomorrow.
I vaguely recall looking at some of the redirect stuff while fixing session history couple of years ago.
| Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #6)
> I'm not sure of the various side-effects either. This is the first time
> I've seen this code in OnRedirectStateChange, and I'm not entirely sure what
> it's trying to do.
>
> Olli, do you know what this stuff is about?
>
> Dragana, what is the general goal of the patch?
>
On redirect if a load was a reload or history load, we use to change loadType to LOAD_NORMAL_REPLACE.
In bug 968273, I have changed to do the reload from originalURI. This will do a redirect again which triggers the changing loadType to LOAD_NORMAL_REPLACE but it should not.
I could do the check in nsDocShell::OnRedirectStateChange but there could be multiples redirects (except we save all of them)
> Are there no places between the redirect notification and STATE_STOP that
> examine mLoadType?
I figure out this is not a right place :(
I need notification when all redirects are done, probably when we get the first non-redirect response.
Any suggestions?
Thanks
Updated•10 years ago
|
Whiteboard: btpp-active
| Assignee | ||
Comment 9•10 years ago
|
||
Option 1 is to remember all the redirects and if the chain mismatch consider reload to be a new load.
Option 2 I have tried with OnStateChange/OnStatusChange but they are sent to late.
Option 3: The first nsDocShell function that is called when new content arrives (when redirects are finished) is CreateContentViewer. It is possible to do checks there but this is not covering all cases, e.g. when an error page is loaded.
So I do not like option 1, option 2 does not work. So option 3 - to find a common place for all code paths.
| Assignee | ||
Comment 10•10 years ago
|
||
I added a function that is called when OnStartRequest is called. If we get OnStartRequest to the new channel redirect is completed and we can compare URIs.
Attachment #8761583 -
Attachment is obsolete: true
Attachment #8764355 -
Flags: review?(bugs)
| Assignee | ||
Comment 11•10 years ago
|
||
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(bugs)
See Also: → 1282162
Comment 14•10 years ago
|
||
(sorry, reviewing this may take some time since reviewing this means that one needs to review also bug 968273)
Comment 15•10 years ago
|
||
and note to myself, need to look at bug 536466 too.
Comment 16•10 years ago
|
||
Dragana, could you perhaps answer to https://bugzilla.mozilla.org/show_bug.cgi?id=968273#c43 and explain how our behavior changed there and what other browsers do.
(location.reload takes an optional bool param, which affects the behavior too)
Flags: needinfo?(dd.mozilla)
Comment 17•10 years ago
|
||
Comment on attachment 8764355 [details] [diff] [review]
bug_1279050_v1.patch
I was testing the behavior a bit, and it is unclear to me why bug 968273 is a safe change.
Please explain, and ask review again for this patch, or
back out the patch for bug 968273 and then we'll need possibly different fix for that bug (something which doesn't affect to history API behavior).
Attachment #8764355 -
Flags: review?(bugs)
| Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(dd.mozilla)
| Assignee | ||
Comment 18•10 years ago
|
||
bug 968273 backed out.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 19•10 years ago
|
||
Based on the backout assuming the problem is fixed in 50, updating status flag to reflect that.
You need to log in
before you can comment on or make changes to this bug.
Description
•