adobe/brackets — pull request #4658 by jasonsanjose (2013-08-05 22:10:38+00:00)
Title: Use DOM tree to debug browser against SimpleDOMBuilder

@dangoor @njx

Runtime console warnings when in-editor DOM does not match in-browser DOM.

If there the browser DOM, does not match the in-editor DOM, the diffs are logged to the console. For example, there happens to be an in-browser issue with comments after the `` tag get reparented to the `

` tag. This results in the following console output:

```
Browser delta for change: {"from":{"line":12,"ch":33},"to":{"line":12,"ch":34},"text":["BRACKETS"],"removed":["j"],"origin":"undo"} HTMLDocument.js:165
Object {type: "textInsert", tagID: "8", child: 52, content: "↵"} HTMLDocument.js:173
Object {parentID: "8", afterID: "42", type: "textReplace", content: "↵↵ ↵↵"}
```

If the structures match, nothing is logged.

This change adds a new remote function `getSimpleDOM()` that converts the actual DOM tree (the tree vs. `outerHTML` from my previous implementation) into a JSON structure matching the tree built by `SimpleDOMBuilder`.

We ignore some diffs including:

* the brackets live highlight `div`
* whitespace deletions inside the `html` element

Does not handle in-browser DOM modifications yet.