adobe/brackets — pull request #3281 by redmunds (2013-03-28 21:14:02+00:00)
Title: Fix Live Dev unit tests due to HTMLDocument refactoring

This was introduced with my recent refactoring of HTMLDocument. Not sure why this only broke on Mac. Until that change, HTMLDocument was only ever created when experimental code was on, and that code hasn't been exercised very much.

Not sure why, but CSSAgent includes containing HTMLDocument in list returned from getStyleSheetURLs(). This could be useful for collecting embedded style sheets, but we do not want to add HTMLDocument to _relatedDocuments list, so filter it out.

Actual crash was coming from HTMLDocument being created with undefined editor. I fixed that particular code path, but also added bullet-proffing to HTMLDocument in case that ever happens in some other code path.