adobe/brackets — pull request #3293 by gruehle (2013-03-29 22:54:55+00:00)
Title: Highlight HTML element in browser

This pull request extends the Live Highlight feature to highlight HTML elements. When an HTML file is opened and Live Preview is enabled, the element under the cursor is highlighted in the browser.

Highlighting remains accurate when editing the document, as long as the document remains in the foreground. If you switch to a different document and then back to the edited HTML doc, you will need to save changes to get correct highlighting. This will be fixed in a future user story.

There is a new `HTMLInstrumentation` module that handles the instrumentation of the HTML content. A `data-brackets-id` attribute is added to all tags, and the value of the attribute is guaranteed to be unique.

There are functions for marking up a text editor (`HTMLInstrumentation._markText()`) and getting the data-brackets-id attribute value at the current cursor position (`HTMLInstrumentation._getTagIDAtDocumentPos()`). These functions are marked "private" for now (initial underscore), since they are likely to change when we add support for HTML Live Development in the next couple sprints.