Skip to content

Commit d4def22

Browse files
SeanHendersonmgol
authored andcommitted
Manipulation: Switch rnoInnerhtml to a version more performant in IE
IE versions greater than 9 do not handle the old regular expression well with large html content. This is due to the use of a non-capturing group after a very common html character (<). Test suite: http://jsfiddle.net/Lwa0t5rp/3/ Microsoft bug: https://connect.microsoft.com/IE/feedback/details/1736512/ Fixes gh-2563 Closes gh-2574
1 parent 1b566d3 commit d4def22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/manipulation.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ define( [
2727

2828
var
2929
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
30-
rnoInnerhtml = /<(?:script|style|link)/i,
30+
31+
// Support: IE 10-11, Edge 10240+
32+
// In IE/Edge using regex groups here causes severe slowdowns.
33+
// See https://connect.microsoft.com/IE/feedback/details/1736512/
34+
rnoInnerhtml = /<script|<style|<link/i,
3135

3236
// checked="checked" or checked
3337
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,

0 commit comments

Comments
 (0)