aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/testinit.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-09-20 00:54:40 +0200
committerGitHub <noreply@github.com>2023-09-20 00:54:40 +0200
commit93ca49e6d1ac23fee33b3bc3b7f4d93dd1a25cb7 (patch)
tree26a2692a0e704e48348b45814e341777c4cbaed3 /test/data/testinit.js
parent46f6e3da796ee9d28c7c1428793b72d66bcbb0b7 (diff)
downloadjquery-93ca49e6d1ac23fee33b3bc3b7f4d93dd1a25cb7.tar.gz
jquery-93ca49e6d1ac23fee33b3bc3b7f4d93dd1a25cb7.zip
Core: Simplify code post browser support reduction
Summary of the changes: * Core: Simplify code post browser support reduction * Tests: Remove legacy jQuery.cache & oldIE leftovers * Tests: Reformat JavaScript in delegatetest.html * Docs: "jQuery Foundation Projects" -> "jQuery Projects" * Tests: Drop an unused localfile.html file (modern browsers don't support the `file:` protocol this way, there's no point in keeping the file around) * Effects: Remove a redundant `!fn` check (`fn || !fn && easing` is equivalent to `fn || easing`; simplify the code) * CSS: Explain the fallback to direct object access in curCSS better * Tests: Deduplicate `jQuery.parseHTML` test titles * Dimensions: Add a test for fractional values * Tests: Fix a buggy WebKit regex Closes gh-5296
Diffstat (limited to 'test/data/testinit.js')
-rw-r--r--test/data/testinit.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js
index baf758205..aafe2902c 100644
--- a/test/data/testinit.js
+++ b/test/data/testinit.js
@@ -144,16 +144,12 @@ this.createXMLFragment = function() {
return frag;
};
-window.fireNative = document.createEvent ?
- function( node, type ) {
- var event = document.createEvent( "HTMLEvents" );
-
- event.initEvent( type, true, true );
- node.dispatchEvent( event );
- } :
- function( node, type ) {
- node.fireEvent( "on" + type, document.createEventObject() );
- };
+window.fireNative = function( node, type ) {
+ var event = document.createEvent( "HTMLEvents" );
+
+ event.initEvent( type, true, true );
+ node.dispatchEvent( event );
+};
/**
* Add random number to url to stop caching