carefully allow more strings to use innerHTML
|Reported by:||cmcnulty||Owned by:||dmethvin|
Description (last modified by dmethvin)
.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 (25)
comment:2 Changed 6 years ago by snover
- Milestone set to 1.5
- Priority set to high
- Status changed from new to open
- Version changed from 1.4.2 to 1.4.4
comment:8 Changed 6 years ago by wookiehangover
- Owner set to wookiehangover
- Status changed from open to assigned
comment:24 Changed 6 years ago by dmethvin
- Description modified (diff)
- Milestone changed from 1.next to 1.7
- Priority changed from high to blocker