jquery/test/unit
Michał Gołębiowski-Owczarek 924b515dd3
Manipulation: Don't remove HTML comments from scripts
When evaluating scripts, jQuery strips out the possible wrapping HTML comment
and a CDATA section. However, all supported browsers are already doing that
when loading JS via appending a script tag to the DOM which is how we've been
doing `jQuery.globalEval` since jQuery 3.0.0. jQuery logic was imperfect, e.g.
it just stripped the `<!--` and `-->` markers, respectively at the beginning or
the end of the script contents. However, browsers are also stripping everything
following those markers in the same line, treating them as single-line comments
delimiters; this is now also mandated by ECMAScript 2015 in Annex B. Instead
of fixing the jQuery logic, just let the browser do its thing.

We still need to strip CDATA sections for backwards compatibility. This
shouldn't be needed as in XML documents they're already not visible when
inspecting element contents and in HTML documents they have no meaning but
we're preserving that logic for backwards compatibility. This will be removed
completely in 4.0.

Fixes gh-4904
Closes gh-4905
Ref gh-4906
2021-07-19 19:15:27 +02:00
..
ajax.js Tests: Fix tests for not auto-executing scripts without dataType 2021-01-11 18:41:36 +01:00
animation.js Build: Update test code for compatibility with QUnit 2.x (#4297) 2019-02-18 19:03:26 +01:00
attributes.js Tests: Remove obsolete jQuery data tests 2020-05-18 18:51:34 +02:00
basic.js Manipulation: Make jQuery.htmlPrefilter an identity function 2020-03-16 21:59:49 +01:00
callbacks.js Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs 2020-01-27 18:54:47 +01:00
core.js Tests: Skip the jQuery.parseXML error reporting test in Legacy Edge 2020-12-08 14:27:05 +01:00
css.js Tests: Switch background image from online file to local 1x1.jpg 2021-05-24 18:30:54 +02:00
data.js Tests: Remove obsolete jQuery data tests 2020-05-18 18:51:34 +02:00
deferred.js Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs 2020-01-27 18:54:47 +01:00
deprecated.js Manipulation: Make jQuery.htmlPrefilter an identity function 2020-03-16 21:59:49 +01:00
dimensions.js Dimensions: Modify reliableTrDimensions support test to account for FF 2021-01-11 11:56:38 -05:00
effects.js Tests: Remove obsolete jQuery data tests 2020-05-18 18:51:34 +02:00
event.js Event: Don't break focus triggering after .on(focus).off(focus) 2021-05-10 19:13:25 +02:00
exports.js Build: Update test code for compatibility with QUnit 2.x (#4297) 2019-02-18 19:03:26 +01:00
manipulation.js Manipulation: Don't remove HTML comments from scripts 2021-07-19 19:15:27 +02:00
offset.js Build: Rename master to main across the repository 2021-02-05 23:21:21 +01:00
queue.js Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs 2020-01-27 18:54:47 +01:00
ready.js Tests: Pass a number of necessary done() calls to assert.async() 2020-03-02 22:18:10 +01:00
selector.js Manipulation: Make jQuery.htmlPrefilter an identity function 2020-03-16 21:59:49 +01:00
serialize.js Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs 2020-01-27 18:54:47 +01:00
support.js Dimensions: Modify reliableTrDimensions support test to account for FF 2021-01-11 11:56:38 -05:00
traversing.js Manipulation: Make jQuery.htmlPrefilter an identity function 2020-03-16 21:59:49 +01:00
tween.js Build: Update test code for compatibility with QUnit 2.x (#4297) 2019-02-18 19:03:26 +01:00
wrap.js Tests: Remove remaining obsolete jQuery.cache references 2020-05-18 18:53:26 +02:00