LoadType not set on SessionHistoryInfo when handling `pushState`.
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
People
(Reporter: mconley, Unassigned)
Details
STR:
- Visit Google Calendar
- Click on any event such that the event popup bubble appears, and a new SHEntry is created (via pushState)
- Open the Browser Console
- Execute this:
let count = gBrowser.selectedBrowser.browsingContext.sessionHistory.count;
let entry = gBrowser.selectedBrowser.browsingContext.sessionHistory.getEntryAtIndex(count - 1);
entry.loadType
ER:
The emitted load type should be 8, since this history entry was created via pushState.
AR:
The emitted load type is 0.
| Reporter | ||
Comment 1•4 years ago
|
||
It seems that when we construct the SessionHistoryInfo for the pushState here: https://searchfox.org/mozilla-central/rev/679ebe4ffdc7312e42d55badb02ef89336af8223/docshell/base/nsDocShell.cpp#11881
the constructor that we're using doesn't take a loadType, so we fall back to the default of 0: https://searchfox.org/mozilla-central/rev/679ebe4ffdc7312e42d55badb02ef89336af8223/docshell/shistory/SessionHistoryEntry.h#162
Hey Peter, do we expect the load type to be passed up in this case? If so, do you think it should be accepted as part of the constructor being used at https://searchfox.org/mozilla-central/rev/679ebe4ffdc7312e42d55badb02ef89336af8223/docshell/shistory/SessionHistoryEntry.h#45, or should we add a SetLoadType method?
Comment 2•4 years ago
|
||
I don't think we've ever set it to anything but 0 or LOAD_HISTORY in the old implementation. Why do you need to know this?
Comment 3•4 years ago
|
||
Oh, and as smaug pointed out some of the LOAD_RELOAD* values.
Comment 4•4 years ago
|
||
And use of nsISHEntry.loadType can be quite surprising since it depends on the most recent load the entry was used for.
https://searchfox.org/mozilla-central/rev/be4604e4be8c71b3c1dbff2398a5b05f15411673/docshell/shistory/nsISHEntry.idl#133-137 kind of hints about that.
| Reporter | ||
Comment 6•4 years ago
•
|
||
Oh, I see... so the loadType on an nsISHEntry is not some kind of indication of what loadType was on the nsIDocShell when this nsISHEntry was last loaded?
If that's the case, then sure, I guess this is an INVALID bug... I guess I find loadType's meaning in the context of nsISHEntry kind of confusing then.
Updated•4 years ago
|
Comment 7•2 years ago
|
||
Going to close per comment 6. Please feel free to correct me if I got this wrong.
Description
•