surrogate problem due to possible bfcache bug

Bug reports and enhancement requests
Post Reply
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

surrogate problem due to possible bfcache bug

Post by al_9x »

NS 2.1.8, Fx 8.0b5, new profile

test surrogate:

Code: Select all

user_pref("noscript.surrogate.google_preview.sources", "@^https?://www\.google\.com/search\?(?!(?:.*&)?tbm=[^&]+)");
user_pref("noscript.surrogate.google_preview.replacement", "console.log('@ surrogate: ' + document.URL); addEventListener('DOMContentLoaded', function(e) {console.log(e.type + ' : ' + e.target.location);}, true); addEventListener('load', function(e) {console.log(e.type + ' : ' + e.target.location); document.body.insertBefore(document.createElement('IMG'), document.body.firstChild).src = 'http://www.google.com/images/nav_logo91.png';}, false); addEventListener('pageshow', function(e) console.log(e.type + (e.persisted ? ' : cached : ' : ' : uncached : ') + e.target.location), false);");
  1. open web console, turn off net and css logging
  2. load http://www.google.com/search?q=whatever
  3. click on maps
  4. go back, the first time only "pageshow : cached" is logged, everything is fine

    Code: Select all

    pageshow : cached : http://www.google.com/search?q=whatever
    
  5. go forward
  6. back again (quickly, as soon as the maps page appears loaded, before the secondary load restarts the spinner)
    when the maps page loads, the progress spinner stops, then briefly restarts again as the map iframe (or whatever) seems to refresh. If you let the maps page do it's full load/paint the problem does not manifest.
    1. now the following is logged:

      Code: Select all

      load : http://www.google.com/search?q=whatever
      pageshow : uncached : http://www.google.com/search?q=whatever
      
    2. another "load" inserted image is added
    Since another image is inserted, it's clear that the DOM is bfcached (also neither the surrogate nor DOMContentLoaded fire, as one would expect for bfcached pages), but then another load should not fire either, and "persisted" should be true in "pageshow"
Is this purely a gecko bug? Or is NS contributing?
Last edited by al_9x on Sun Oct 30, 2011 6:40 pm, edited 3 times in total.
Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: surrogate problem due to possible bfcache bug

Post by al_9x »

on further testing, it seems that what causes the problem is hitting back before the maps page does its secondary load/update.

when the maps page loads, the progress spinner stops, then briefly restarts again as the map iframe (or whatever) seems to refresh.

To repro this issue, hit back quickly, as soon as the maps page appears loaded, before the secondary load restarts the spinner
Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: surrogate problem due to possible bfcache bug

Post by al_9x »

I've taken NS out of the equation with this error console snippet:

Code: Select all

var tb = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('navigator:browser').gBrowser; tb.addEventListener('DOMContentLoaded', function(e) {var url = e.target.location.href; if (url !== 'http://www.google.com/search?q=whatever') return; Components.utils.reportError(e.type);}, true); tb.addEventListener('load', function(e) {var url = e.target.location.href; if (url !== 'http://www.google.com/search?q=whatever') return; Components.utils.reportError(e.type); var doc = e.target; doc.body.insertBefore(doc.createElement('IMG'), doc.body.firstChild).src = 'http://www.google.com/images/nav_logo91.png';}, true); tb.addEventListener('pageshow', function(e) {var url = e.target.location.href; if (url !== 'http://www.google.com/search?q=whatever') return; Components.utils.reportError(e.type + (e.persisted ? ' : cached' : ' : uncached'));}, true);
Giorgio, before I file a bug, what are your thoughts on this?
Last edited by al_9x on Tue Nov 01, 2011 3:42 am, edited 1 time in total.
Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: surrogate problem due to possible bfcache bug

Post by al_9x »

The image I'm inserting in onload does not show in Fx10 but does in Fx8

corrected
Last edited by al_9x on Tue Nov 01, 2011 3:45 am, edited 1 time in total.
Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: surrogate problem due to possible bfcache bug

Post by Giorgio Maone »

I'm looking into it.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: surrogate problem due to possible bfcache bug

Post by al_9x »

Giorgio Maone wrote:I'm looking into it.
Thanks, I filed a bug
Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: surrogate problem due to possible bfcache bug

Post by al_9x »

There was a problem in my load handler
https://bugzilla.mozilla.org/show_bug.cgi?id=698360#c1

I updated it here as well.
Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0
Post Reply