Decide how the cached cross-origin function weakmap should interact with bfcache
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | affected |
People
(Reporter: bzbarsky, Assigned: mccr8)
Details
Attachments
(1 file)
3.28 KB,
patch
|
Details | Diff | Splinter Review |
Consider a testcase like so:
<script>
var win;
var func;
function openWin() {
win = window.open("some-cross-origin-url");
}
function saveFunc() {
func = win.close;
}
function checkFunc() {
alert(func == win.close);
}
</script>
<input type="button" onclick="openWin()" value="Open window">
<input type="button" onclick="saveFunc()" value="Save function">
<input type="button" onclick="checkFunc()" value="Check function">
where some-cross-origin-url looks like this:
<script>
var x = 5;
function setx() { x = 7; }
function alertx() { alert(x); }
</script>
<input type="button" onclick="setx()" value="Change value">
<input type="button" onclick="alertx()" value="Examine value">
<a href="other.html">Go to other page</a>
(so you can tell whether it's doing bfcache). If the "Open window" button is clicked, then "Save function", then the "Change value", then the link to "other.html", then the browser's back button, then the following should be true when bfache is in use:
- "Examine value" alerts 7.
- "Check function" alerts true.
In Gecko release, and with my changes to cross-origin stuff, #1 holds, but #2 alerts false. In release, because the Xray where caching state lives goes away during the various transplanting that happens during navigation. With my changes because the cached-function weakmap likewise goes away while transplanting.
This is not that hard to fix: store the weakmap in the windowstate. But I need to write a non-manual test, and I have other things to worry about right now.
Reporter | ||
Comment 1•5 years ago
|
||
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
Andrew, do you think you could take over driving this in?
Assignee | ||
Comment 3•4 years ago
|
||
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #2)
Andrew, do you think you could take over driving this in?
Sure. It looks straight forward enough. Is "my changes to cross-origin stuff" in comment 0 referring to bug 1363208?
Updated•2 years ago
|
Description
•