aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Henderson <seanh.za@gmail.com>2015-09-03 17:48:20 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2015-09-08 19:31:57 +0200
commitd4def22e4cd1c2eb2571f449e226b38384fb6d81 (patch)
treef1adc0ff106d0447c84b15e3cdad1b7a803d477f
parent1b566d37a2879af12364a03c633c235a76f49925 (diff)
downloadjquery-d4def22e4cd1c2eb2571f449e226b38384fb6d81.tar.gz
jquery-d4def22e4cd1c2eb2571f449e226b38384fb6d81.zip
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
-rw-r--r--src/manipulation.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 227d0ef9e..b85ef1824 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -27,7 +27,11 @@ define( [
var
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
- rnoInnerhtml = /<(?:script|style|link)/i,
+
+ // Support: IE 10-11, Edge 10240+
+ // In IE/Edge using regex groups here causes severe slowdowns.
+ // See https://connect.microsoft.com/IE/feedback/details/1736512/
+ rnoInnerhtml = /<script|<style|<link/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,