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
282c044d
Commit
282c044d
authored
Dec 07, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13013. Move jQuery.buildFragment() to compat plugin.
parent
747600b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
20 deletions
+6
-20
core.js
src/core.js
+2
-1
manipulation.js
src/manipulation.js
+4
-19
No files found.
src/core.js
View file @
282c044d
...
@@ -493,7 +493,8 @@ jQuery.extend({
...
@@ -493,7 +493,8 @@ jQuery.extend({
return
[
context
.
createElement
(
parsed
[
1
]
)
];
return
[
context
.
createElement
(
parsed
[
1
]
)
];
}
}
parsed
=
jQuery
.
buildFragment
(
[
data
],
context
,
scripts
);
parsed
=
context
.
createDocumentFragment
();
jQuery
.
clean
(
[
data
],
context
,
parsed
,
scripts
);
if
(
scripts
)
{
if
(
scripts
)
{
jQuery
(
scripts
).
remove
();
jQuery
(
scripts
).
remove
();
}
}
...
...
src/manipulation.js
View file @
282c044d
...
@@ -292,7 +292,7 @@ jQuery.fn.extend({
...
@@ -292,7 +292,7 @@ jQuery.fn.extend({
// Flatten any nested arrays
// Flatten any nested arrays
args
=
core_concat
.
apply
(
[],
args
);
args
=
core_concat
.
apply
(
[],
args
);
var
fragment
,
first
,
results
,
scripts
,
hasScripts
,
iNoClone
,
node
,
doc
,
var
fragment
,
first
,
scripts
,
hasScripts
,
iNoClone
,
node
,
doc
,
i
=
0
,
i
=
0
,
l
=
this
.
length
,
l
=
this
.
length
,
value
=
args
[
0
],
value
=
args
[
0
],
...
@@ -310,8 +310,9 @@ jQuery.fn.extend({
...
@@ -310,8 +310,9 @@ jQuery.fn.extend({
}
}
if
(
this
[
0
]
)
{
if
(
this
[
0
]
)
{
results
=
jQuery
.
buildFragment
(
args
,
this
);
doc
=
this
[
0
].
ownerDocument
;
fragment
=
results
;
fragment
=
doc
.
createDocumentFragment
();
jQuery
.
clean
(
args
,
doc
,
fragment
);
first
=
fragment
.
firstChild
;
first
=
fragment
.
firstChild
;
if
(
fragment
.
childNodes
.
length
===
1
)
{
if
(
fragment
.
childNodes
.
length
===
1
)
{
...
@@ -512,22 +513,6 @@ function cloneFixAttributes( src, dest ) {
...
@@ -512,22 +513,6 @@ function cloneFixAttributes( src, dest ) {
dest
.
removeAttribute
(
jQuery
.
expando
);
dest
.
removeAttribute
(
jQuery
.
expando
);
}
}
jQuery
.
buildFragment
=
function
(
args
,
context
,
scripts
)
{
var
fragment
;
// Set context from what may come in as undefined or a jQuery collection or a node
// Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
// also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
context
=
context
||
document
;
context
=
!
context
.
nodeType
&&
context
[
0
]
||
context
;
context
=
context
.
ownerDocument
||
context
;
fragment
=
context
.
createDocumentFragment
();
jQuery
.
clean
(
args
,
context
,
fragment
,
scripts
);
return
fragment
;
};
jQuery
.
each
({
jQuery
.
each
({
appendTo
:
"append"
,
appendTo
:
"append"
,
prependTo
:
"prepend"
,
prependTo
:
"prepend"
,
...
...
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