title: Detect when scrollable div is "focused" in Firefox?
body: <p>Firefox has a behavior where, if you click on a scrollable <code>div</code>, then that div responds to all the mousewheel and the Page Up/Down keys, effectively making it "focused". However, the HTML5 spec dictates that <code>divs</code> <em>cannot</em> be "focused", technically. Therefore, even though the <code>div</code> receives keyboard and mouse events, it's not reported in <code>document.activeElement</code> or a <code>DOMActivate</code> event handler.</p>
  
  <p>So how can I detect when a scrollable <code>div</code> has scrolling focus in Firefox? Here's a <a href="http://dl.dropbox.com/u/6173284/testscroll.html" rel="noreferrer">test page</a>. Oddly, the <code>div</code> <em>is</em> reported in <code>document.activeElement</code> when you tab into it, but that's the only time that happens. A workaround might be to listen for <code>click</code> and <code>scroll</code> events instead, but I'm not sure if that's the best solution?</p>
  
  <p>EDIT: This is for a Firefox extension, so any chrome-level JS would be acceptable. This also means I can't edit or predict how certain pages are coded.</p>