peterflynn / svg-preview

Brackets extension to live preview SVG files inline as you edit them
46 stars 8 forks source link

Brackets may freeze during editing #9

Open thany opened 10 years ago

thany commented 10 years ago

I just had a moment where Brackets, or at least the code editor part, froze while eidting and having an svg preview visible. I was just editing the coordinates of a <path> element, which normally goes quite well, but this time it froze.

The menu in Brackets was still acessible, but nothing actually did anything anymore. I could not close Brackets, even though the close button seemed responsive. Maybe the code editor hung. Maybe webkit hung, maybe another part. But I do know that it happened during svg editing, and I have never had this happen in any other file before...

I'm using Windows 7 x64, Brackets 40, and SVG Preview 1.1.2.

thany commented 9 years ago

FYI, still happening on Brackets 1.0 from time to time.

AmeliaBR commented 9 years ago

I've been having the same effect, and I'm fairly confident that it is related to this extension (i.e., it only happens on SVG files, and only happens when this extension is installed; I uninstalled SVG code hints first to confirm it wasn't a problem with that). I am also on Win 7, Brackets 1.0, and the latest version of Preview. Haven't been able to figure out a specific trigger, just that it happens when typing.

I have one extra symptom to report: all the text in the code window and file list gets messed up as the first sign of a problem; (e.g., letter-spacing gets messed up so that letters overlap or text disappears altogether). Sometimes that can recover, other times it goes to complete shutdown -- except, as @thany said, the menus and other UI appear to work, but have no effect. My guess is an uncaught JavaScript error that bubbles up to break the core Brackets code. But once it happens, I can't turn on Brackets debugging!

AmeliaBR commented 9 years ago

I thought I'd follow up: Most freezing results are probably a symptom of the fact that the SVG file is inserted into the main editor window as inline SVG with no sandboxing. Styles, scripts, unclosed strings or CDATA sections, these can all cause havoc with the main Brackets window.

A complete refactoring of the code is required to make this extension secure.