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
19def21d
Commit
19def21d
authored
Jan 16, 2013
by
Oleg
Committed by
Dave Methvin
Jan 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13232, fix jQuery.buildFragment for tables, close gh-1138.
parent
dbf4926e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
manipulation.js
src/manipulation.js
+5
-3
manipulation.js
test/unit/manipulation.js
+29
-0
No files found.
src/manipulation.js
View file @
19def21d
...
...
@@ -15,15 +15,17 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
// Support: IE 9
option
:
[
1
,
"<select multiple='multiple'>"
,
"</select>"
],
tr
:
[
1
,
"<table>"
,
"</table>"
],
td
:
[
3
,
"<table><tr>"
,
"</tr></table>"
],
thead
:
[
1
,
"<table>"
,
"</table>"
],
tr
:
[
2
,
"<table><tbody>"
,
"</tbody></table>"
],
td
:
[
3
,
"<table><tbody><tr>"
,
"</tr></tbody></table>"
],
_default
:
[
0
,
""
,
""
]
};
// Support: IE 9
wrapMap
.
optgroup
=
wrapMap
.
option
;
wrapMap
.
tbody
=
wrapMap
.
tfoot
=
wrapMap
.
colgroup
=
wrapMap
.
caption
=
wrapMap
.
thead
=
wrapMap
.
col
=
wrapMap
.
tr
;
wrapMap
.
tbody
=
wrapMap
.
tfoot
=
wrapMap
.
colgroup
=
wrapMap
.
caption
=
wrapMap
.
col
=
wrapMap
.
thead
;
wrapMap
.
th
=
wrapMap
.
td
;
jQuery
.
fn
.
extend
({
...
...
test/unit/manipulation.js
View file @
19def21d
...
...
@@ -2196,3 +2196,32 @@ test( "Make sure jQuery.fn.remove can work on elements in documentFragment", 1,
equal
(
fragment
.
childNodes
.
length
,
0
,
"div element was removed from documentFragment"
);
});
test
(
"Make sure specific elements with content created correctly (#13232)"
,
20
,
function
()
{
var
results
=
[],
args
=
[],
elems
=
{
thead
:
"<tr><td>thead</td></tr>"
,
tbody
:
"<tr><td>tbody</td></tr>"
,
tfoot
:
"<tr><td>tfoot</td></tr>"
,
colgroup
:
"<col span='5' />"
,
caption
:
"caption"
,
tr
:
"<td>tr</td>"
,
th
:
"th"
,
td
:
"<div>td</div>"
,
optgroup
:
"<option>optgroup</option>"
,
option
:
"option"
};
jQuery
.
each
(
elems
,
function
(
name
,
value
)
{
var
html
=
"<"
+
name
+
">"
+
value
+
"</"
+
name
+
">"
;
ok
(
jQuery
.
nodeName
(
jQuery
.
parseHTML
(
"<"
+
name
+
">"
+
value
+
"</"
+
name
+
">"
)[
0
],
name
),
name
+
" is created correctly"
);
results
.
push
(
name
);
args
.
push
(
html
);
});
jQuery
.
fn
.
append
.
apply
(
jQuery
(
"<div/>"
),
args
).
children
().
each
(
function
(
i
)
{
ok
(
jQuery
.
nodeName
(
this
,
results
[
i
]
)
);
});
});
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