Added auto-open events and HTML-related behaviour.