Currently FireWatir's fire_event method relies on the old, deprecated event
style.
For example:
<input type="text" name="test1" id="test1"
onclick="alert('Hello!')" />
However, events are now more commonly added using the DOM, like this:
<input type="text" name="test2" id="test2" />
<script type="text/javascript">
document.getElementById('test2').addEventListener('click',
function(ev) {alert('Hello!')},
true
);
</script>
The current implementation of the fire_event method will fail to fire the
'onclick' event in 'test2'. The attached patch fixes this, so that events
are now triggered using the DOM rather than by looking for the old
'onevent' style invocations.
Additionally, the patch changes the behaviour of the 'set' method for
radios and checkboxes. The method now only sets (i.e. checks) the control,
rather than just toggling it. This is the correct behaviour as defined in
the original Watir API.
I've tested the patch against all of the unit tests and it looks like it works.
Original issue reported on code.google.com by matt.zuk...@gmail.com on 3 Oct 2007 at 7:51
Original issue reported on code.google.com by
matt.zuk...@gmail.com
on 3 Oct 2007 at 7:51Attachments: