Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
ff7b7cfd
Commit
ff7b7cfd
authored
Aug 20, 2012
by
Nikita Govorov
Committed by
Dave Methvin
Aug 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12149. Avoid memory leak on oldIE change events. Close gh-878.
parent
9d07525a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
AUTHORS.txt
AUTHORS.txt
+1
-0
event.js
src/event.js
+1
-1
event.js
test/unit/event.js
+23
-0
No files found.
AUTHORS.txt
View file @
ff7b7cfd
...
@@ -130,3 +130,4 @@ Uri Gilad <antishok@gmail.com>
...
@@ -130,3 +130,4 @@ Uri Gilad <antishok@gmail.com>
Chris Faulkner <thefaulkner@gmail.com>
Chris Faulkner <thefaulkner@gmail.com>
Elijah Manor <elijah.manor@gmail.com>
Elijah Manor <elijah.manor@gmail.com>
Daniel Chatfield <chatfielddaniel@googlemail.com>
Daniel Chatfield <chatfielddaniel@googlemail.com>
Nikita Govorov <nikita.govorov@gmail.com>
\ No newline at end of file
src/event.js
View file @
ff7b7cfd
...
@@ -832,7 +832,7 @@ if ( !jQuery.support.changeBubbles ) {
...
@@ -832,7 +832,7 @@ if ( !jQuery.support.changeBubbles ) {
teardown
:
function
()
{
teardown
:
function
()
{
jQuery
.
event
.
remove
(
this
,
"._change"
);
jQuery
.
event
.
remove
(
this
,
"._change"
);
return
rformElems
.
test
(
this
.
nodeName
);
return
!
rformElems
.
test
(
this
.
nodeName
);
}
}
};
};
}
}
...
...
test/unit/event.js
View file @
ff7b7cfd
...
@@ -2985,6 +2985,29 @@ if ( hasPHP ) {
...
@@ -2985,6 +2985,29 @@ if ( hasPHP ) {
})();
})();
test
(
"change handler should be detached from element"
,
function
()
{
expect
(
2
);
var
$fixture
=
jQuery
(
"<input type='text' id='change-ie-leak' />"
).
appendTo
(
"body"
);
var
originRemoveEvent
=
jQuery
.
removeEvent
;
var
wrapperRemoveEvent
=
function
(
elem
,
type
,
handle
){
equal
(
"change"
,
type
,
"Event handler for 'change' event should be removed"
);
equal
(
"change-ie-leak"
,
jQuery
(
elem
).
attr
(
"id"
),
"Event handler for 'change' event should be removed from appropriate element"
);
originRemoveEvent
(
elem
,
type
,
handle
);
};
jQuery
.
removeEvent
=
wrapperRemoveEvent
;
$fixture
.
bind
(
"change"
,
function
(
event
)
{});
$fixture
.
unbind
(
"change"
);
$fixture
.
remove
();
jQuery
.
removeEvent
=
originRemoveEvent
;
});
asyncTest
(
"trigger click on checkbox, fires change event"
,
function
()
{
asyncTest
(
"trigger click on checkbox, fires change event"
,
function
()
{
expect
(
1
);
expect
(
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment