Menu

#59 Slowdown in Safari 5.1

open
nobody
None
5
2011-10-26
2011-10-26
Anonymous
No

Safari 5.1 has a bug (they've apparently fixed it in nightly) where it can get very slow making edits. On large files, it can take tens of seconds.

The problem is that the main tag surrounding the syntax highlighting is a span, which triggers the Safari bug. The bug makes any DOM changes incredibly slow, including setting display:none, running removeChild, or running replaceChild.

I was able to reproduce without editarea by just fiddling in the web inspector on any website.

To fix change
<span class='\"+t.Å[\"syntax\"]+\"'>\"+hightlighted_text+\"</span>
to
<div class='\"+t.Å[\"syntax\"]+\"'>\"+hightlighted_text+\"</div>

(that's for the minified version, but a similar change would work in the non-minified version)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.