0

It seems to me that Gecko has a bug involving ":active". To illustrate, put this into a file called test.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "hxxp://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >

 <head>
  <style type="text/css">
   .clickable {
     border: solid black 1px;
     padding: 2px;
     cursor: pointer;
     -moz-user-select: none;
   }

   .clickable:active {
     background-color: gray;
   }
  </style>
 </head>

 <body>
   <span class="clickable">blah</span>
 </body>
</html>

Now open it up in, say, FF3. The span should work a little like a button: if you mousedown on it, the background changes color. When you mouseup, it returns to normal.

Note that this even works if you mousedown inside the span, move the mouse outside the browser window, and release it there: during the part where the mouse is down, the background is gray. When released, the span returns to normal.

So far so good. But try wrapping it in a frame:

<html>
  <frameset cols="50%, 50%">
    <frame src="test.html" />
    <frame src="http://google.com" />
  </frameset>
</html>

Load that one up. Now when you mousedown inside the span, move the mouse anywhere outside the frame, and mouseup, the span stays gray forever -- i.e., CSS considers it ":active" forever.

This only seems to happen in a frame, and the problem doesn't show up in KHTML-based browsers.

Anyone got a workaround?

Knu
  • 14,806
  • 5
  • 56
  • 89
mike
  • 46,876
  • 44
  • 102
  • 112
  • Does this also happen (without frames) if you hold down the mouse button on the span, move the mouse outside the window, and release the mouse? – cmptrgeekken Apr 14 '09 at 22:19
  • Aren't you talking about the case I mention in the paragraph starting with the words "Note that this"? – mike Apr 14 '09 at 22:41
  • Yes, it seems to be a bug... although to be honest I'm more surprised that it does work in the non-frameset version! – bobince Apr 15 '09 at 00:56
  • Amusingly, if you put a test.html in each frame and sticky-grey one, you can un-sticky-grey it by mousing down in the other frame and releasing in the original frame. weird! – bobince Apr 15 '09 at 00:58

1 Answers1

0

You haven't got the right doctype to support frames. This might be the problem.

wheresrhys
  • 22,558
  • 19
  • 94
  • 162