Couple of problems - this.isHighlighted can't be relied on. First thing that I can think of is highlight a piece of text, then select an un-highlighted piece of text and it will try to highlight it 'transparent'.