Menu

#93 Support for IE style event handling (window.event)

closed
None
5
2012-10-21
2006-02-27
No

IE handles events differently from firefox. In IE, the
event is stored in window.event, where in firefox the
event is passed as a parameter to the handler. IE
passes a null in this parameter.

The window.event object is described in the MSDN as per
here
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_window.asp

Work involved would be to register each event generated
by clicks/keypresses and register it with a window. A
call to window.event would get the most recent
(current) event.

Discussion

  • Marc Guillemot

    Marc Guillemot - 2006-02-28

    Logged In: YES
    user_id=402164

    What is currently wrong in htmlunit? If I correctly
    understand your description, when simulating IE:
    - event should be placed as window.event
    - no parameter should used for event handler call

    Is it correct? Can you provide a unit test?

     
  • Bradley Murray

    Bradley Murray - 2006-02-28

    Logged In: YES
    user_id=1269316

    See here for a better description of the microsoft event
    handling way. http://www.quirksmode.org/js/events_access.html

    The event should be placed into window.event, and yes,
    internet passes a null as a parameter for an event handler.

    See patch for unit test.

     
  • Bradley Murray

    Bradley Murray - 2006-02-28

    better JUnit test for window.event handling behaviour

     
  • Bradley Murray

    Bradley Murray - 2006-02-28

    html for junit test, passes in IE

     
  • Marc Guillemot

    Marc Guillemot - 2006-03-23

    Logged In: YES
    user_id=402164

    I've adapted the unit test a bit and added it as
    notYetImplemented: EventTest.testEventTransmission. I
    couldn't fix it now because somehow the variable visibility
    was not exactly what I've expected. I have to take more time
    to check it.

     
  • Marc Guillemot

    Marc Guillemot - 2006-06-15

    Logged In: YES
    user_id=402164

    Now fixed in CVS

     

Log in to post a comment.