[PERFORMANCE] Only highlight HTML when visible

Only highlight the HTML source when the view is visible. Otherwise
the highlighting is disabled.