Skip to content

Commit 29266e0

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/ (cherry-picked from d4def22) Fixes gh-2563 Closes gh-2574
1 parent 1b48eef commit 29266e0

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
@@ -31,7 +31,11 @@ define( [
3131
var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
3232
rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ),
3333
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
34-
rnoInnerhtml = /<(?:script|style|link)/i,
34+
35+
// Support: IE 10-11, Edge 10240+
36+
// In IE/Edge using regex groups here causes severe slowdowns.
37+
// See https://connect.microsoft.com/IE/feedback/details/1736512/
38+
rnoInnerhtml = /<script|<style|<link/i,
3539

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

0 commit comments

Comments
 (0)