carefully allow more strings to use innerHTML
|Reported by:||cmcnulty||Owned by:||dmethvin|
Description (last modified by )
.html() uses rnocache to determine both if a snippet should be cached by buildFragment() and also whether or not html() should use append or innerHTMLto insert the snippet. The problem is that buildFragment requires more stringent rules than innerHTML does, and therefore fewer strings use innerHTML than otherwise could, and that hurts performance, particularly by stripping all snippets with an <option anywhere in the string.
I therefore suggest a new regex rule explicitly to determine if innerHTML or append method should be used. Not only will the improve performance, but it also makes the code cleaner, more readable and make more sense.
The new regex only excludes <style and <script for the following documented reasons:
<object and <embed
Have tests added to them, and cause no new failures in IE7, FF3.7 or Chrome 5.
I discussed these changes a while back in this topic:
Change History (27)
comment:2 Changed 6 years ago by
|Status:||new → open|
|Version:||1.4.2 → 1.4.4|
comment:24 Changed 6 years ago by
|Milestone:||1.next → 1.7|
|Priority:||high → blocker|