Fix near ancestor to prevent go out of editor bounds.

If you place the editor inside a list element the currentStyle method return the key isOnList as true. This is because dom.ancestor method is looking for a list through dom tree even when parent elements are outside of the editor.  I do not know if it's the best solution but I hope it helps.