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