Bug Tracker

Modify

Ticket #10161 (closed bug: cantfix)

Opened 21 months ago

Last modified 21 months ago

CSS modifications not reset on unload

Reported by: dam@… Owned by:
Priority: low Milestone: None
Component: event Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

Consider  http://jsfiddle.net/PDwpP/40/

To observe the issue, the Results iframe should be opened in a separate window. Only tried with Firefox 6.

After pressing the button, the 'Progress...' div is colored in red and the page is navigated away (in this example, to a non-existing URL). Pressing 'Back' returns to the original page and the div is still red (bad behaviour).

Try changing the version (in the HTML part) to 1.3.2, update and repeat the above steps. After pressing 'Back' the div is black (wanted behaviour).

The problem is present in any version after 1.3.2. After bisecting, it appears that the commit that introduces the problem is f3474c00cd6d9e5fd61b6ef1562003e9986ad67d

Change History

comment:1 Changed 21 months ago by timmywil

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to event

comment:2 Changed 21 months ago by timmywil

  • Version changed from 1.4 to 1.6.2

comment:3 follow-up: ↓ 4 Changed 21 months ago by dmethvin

It's not likely to be a jQuery bug, since it happens without jQuery being included:

 http://jsfiddle.net/dmethvin/PDwpP/42/

comment:4 in reply to: ↑ 3 Changed 21 months ago by dam@…

Replying to dmethvin:

It's not likely to be a jQuery bug, since it happens without jQuery being included:  http://jsfiddle.net/dmethvin/PDwpP/42/

Confirmed with Firefox 6.

Still, jQuery 1.3.2 seems to have worked around this. The workaround seems like a side effect of something else, but maybe still a good idea?

The use case I am fighting with is a page overlay that is shown upon form submit, covering the whole window as an indication that the request is being processed. Still showing that when pressing 'Back' is a major pain.

comment:5 Changed 21 months ago by dmethvin

  • Status changed from open to closed
  • Resolution set to cantfix

Given your bisect result I am pretty sure this is a result of the Firefox bfcache feature. In 1.3.2 we attached to the unload event in all browsers which defeated the bfcache; that was fixed in 1.4 and we only attached to unload in IE to handle some memory leak issues.

So yes, jQuery used to defeat the bfcache which fixed this particular issue but destroyed performance for the other 95% of the time. So it isn't something we'd reinstate.

Google around for ways to defeat bfcache, for example you could bind to the pageshow event to undo the red text.

comment:6 Changed 21 months ago by dam@…

Thank you very much.

Indeed, binding to pageshow (instead of unload) works without breaking caching, which makes Back button work instantly and also without losing any other dynamic changes in the page (as long as the cache is hot, but there is the ready event for when the cache has expired anyway).

Thanks again!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.