Previous implementation was using the element type (span or div) to determine if the element was a handle or caret. This is problematic if additional elements are placed inside the cursor node (as necessary for proper IME support)