jquery/test
Michał Gołębiowski-Owczarek 9c98e4e86e
Manipulation: Avoid concatenating strings in buildFragment
Concatenating HTML strings in buildFragment is a possible security risk as it
creates an opportunity of escaping the concatenated wrapper. It also makes it
impossible to support secure HTML wrappers like
[trusted types](https://web.dev/trusted-types/). It's safer to create wrapper
elements using `document.createElement` & `appendChild`.

The previous way was needed in jQuery <4 because IE <10 doesn't accept table
parts set via `innerHTML`, even if the element which contents are set is
a proper table element, e.g.:
```js
tr.innerHTML = "<td></td>";
```
The whole structure needs to be passed in one HTML string. jQuery 4 drops
support for IE <11 so this is no longer an issue; in older version we'd have
to duplicate the code paths.

IE <10 needed to have `<option>` elements wrapped in
`<select multiple="multiple">` but we no longer need that on master which
makes the `document.createElement` way shorter as we don't have to call
`setAttribute`.

All these improvements, apart from making logic more secure, decrease the
gzipped size by 58 bytes.

Closes gh-4724
Ref gh-4409
Ref angular/angular.js#17028

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2020-06-10 16:13:22 +02:00
..
data Tests: Remove remaining obsolete jQuery.cache references 2020-05-18 18:43:01 +02:00
integration Event: Fix delegated radio events when arrow keys are used 2015-10-18 13:06:37 -04:00
node_smoke_tests Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test 2019-03-04 18:30:51 +01:00
promises_aplus_adapters Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test 2019-03-04 18:30:51 +01:00
unit Manipulation: Avoid concatenating strings in buildFragment 2020-06-10 16:13:22 +02:00
.eslintrc.json Build: Enable ESLint one-var rule for var declarations in browser code 2020-03-02 22:25:35 +01:00
delegatetest.html Tests: Change quotes according to style guidelines 2015-10-18 13:17:23 -04:00
hovertest.html Ref #13316: Sync all documents on full vs. minified source. Close gh-1147. 2013-02-07 15:16:28 -05:00
index.html Build: Make Karma work in ES modules mode 2019-12-16 19:33:49 +01:00
jquery.js Build: Make dev mode work in Karma again, serve source files from disk 2020-01-08 00:35:55 +01:00
karma.context.html Build: Make Karma work in ES modules mode 2019-12-16 19:33:49 +01:00
karma.debug.html Build: Make Karma work in ES modules mode 2019-12-16 19:33:49 +01:00
localfile.html Manipulation: Make jQuery.htmlPrefilter an identity function 2020-03-16 21:49:29 +01:00
middleware-mockserver.js Tests: Fix flakiness in the "jQuery.ajax() - JSONP - Same Domain" test 2020-04-27 20:22:39 +02:00
networkerror.html Docs: Updated links to https where they are supported. 2016-01-13 13:26:10 -05:00
xhtml.php Added a way to run the test suite as an XHTML page. 2009-01-19 18:14:51 +00:00