teampoltergeist/poltergeist — pull request #494 by aprescott (2014-05-17 00:01:54+00:00)
Title: Don't alter focus with send_keys if we're already in the target element

If the click event is fired on the target element, then the caret position that was previously set by, e.g.,

```ruby
send_keys(:Left)
```

is lost. This addresses that by first checking if the target element already contains the current selection, meaning we have focus within the target element and don't need to first give it focus.

Fixes #493.