enyo / opentip

Opentip is an open source javascript tooltip based on the protoype framework.
http://www.opentip.org
1.25k stars 401 forks source link

In Safari and Firefox, tooltip on a link fails to hide after after clicking link, then back button in #71

Open kcrwfrd opened 11 years ago

kcrwfrd commented 11 years ago

See https://dl.dropboxusercontent.com/u/27984093/tooltip.html

To reproduce:

  1. Hover over link, showing tooltip. Click the link.
  2. After landing on Google, press the browser's back button with a mouse. Keyboard shortcuts also work, but are slightly less consistent
  3. The tooltip now refuses to hide
enyo commented 10 years ago

Wow... that is weird... Apparently Safari and Firefox try to keep some kind of JS (and or HTML?) state. I'll try to figure out how to fix that... Seems like a very strange feature to me.

enyo commented 10 years ago

Thanks for the test page and the detailed bug report.

kcrwfrd commented 10 years ago

Yep, I noticed browsers starting to do that some time ago. A bit of googling turned up some interesting tidbits, this "frozen state" of the DOM and JS execution is called the "BFCache" (Back-forward cache):

http://stackoverflow.com/a/1195934/193494 https://developer.mozilla.org/en-US/docs/Working_with_BFCache