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
e78cfb1a
Commit
e78cfb1a
authored
Nov 10, 2012
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12858: don't expose jQuery/Sizzle expandos
parent
517846aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
sizzle
src/sizzle
+1
-1
manipulation.js
test/unit/manipulation.js
+14
-5
No files found.
sizzle
@
7ea8b52e
Subproject commit
5e6ae330a9ccb33fd343a0bdc73ed2b821767f9c
Subproject commit
7ea8b52ed6f4e3026216037c00a24edd9fce4fff
test/unit/manipulation.js
View file @
e78cfb1a
...
@@ -1241,17 +1241,14 @@ test("jQuery.clone() (#8017)", function() {
...
@@ -1241,17 +1241,14 @@ test("jQuery.clone() (#8017)", function() {
equal
(
main
.
childNodes
.
length
,
clone
.
childNodes
.
length
,
"Simple child length to ensure a large dom tree copies correctly"
);
equal
(
main
.
childNodes
.
length
,
clone
.
childNodes
.
length
,
"Simple child length to ensure a large dom tree copies correctly"
);
});
});
test
(
"
clone()
(#8070)"
,
function
()
{
test
(
"
append to multiple elements
(#8070)"
,
function
()
{
expect
(
2
);
expect
(
2
);
jQuery
(
"<select class='test8070'></select><select class='test8070'></select>"
).
appendTo
(
"#qunit-fixture"
);
var
selects
=
jQuery
(
"<select class='test8070'></select><select class='test8070'></select>"
).
appendTo
(
"#qunit-fixture"
);
var
selects
=
jQuery
(
".test8070"
);
selects
.
append
(
"<OPTION>1</OPTION><OPTION>2</OPTION>"
);
selects
.
append
(
"<OPTION>1</OPTION><OPTION>2</OPTION>"
);
equal
(
selects
[
0
].
childNodes
.
length
,
2
,
"First select got two nodes"
);
equal
(
selects
[
0
].
childNodes
.
length
,
2
,
"First select got two nodes"
);
equal
(
selects
[
1
].
childNodes
.
length
,
2
,
"Second select got two nodes"
);
equal
(
selects
[
1
].
childNodes
.
length
,
2
,
"Second select got two nodes"
);
selects
.
remove
();
});
});
test
(
"clone()"
,
function
()
{
test
(
"clone()"
,
function
()
{
...
@@ -1614,6 +1611,18 @@ test("html(Function) with incoming value", function() {
...
@@ -1614,6 +1611,18 @@ test("html(Function) with incoming value", function() {
}).
html
().
replace
(
/>/g
,
">"
),
" "
+
insert
,
"Verify escaped insertion."
);
}).
html
().
replace
(
/>/g
,
">"
),
" "
+
insert
,
"Verify escaped insertion."
);
});
});
test
(
"clone()/html() don't expose jQuery/Sizzle expandos (#12858)"
,
function
()
{
expect
(
2
);
var
$content
=
jQuery
(
"<div><b><i>text</i></b></div>"
).
appendTo
(
"#qunit-fixture"
),
expected
=
/^<b><i>text<
\/
i><
\/
b>$/i
;
// Attach jQuery and Sizzle data (the latter by conducting a non-qSA search)
$content
.
find
(
":nth-child(1):lt(4)"
).
data
(
"test"
,
true
);
ok
(
expected
.
test
(
$content
.
clone
(
false
)[
0
].
innerHTML
),
"clone()"
);
ok
(
expected
.
test
(
$content
.
html
()
),
"html()"
);
});
var
testRemove
=
function
(
method
)
{
var
testRemove
=
function
(
method
)
{
var
first
=
jQuery
(
"#ap"
).
children
(
":first"
);
var
first
=
jQuery
(
"#ap"
).
children
(
":first"
);
...
...
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