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
d3d8ed44
Commit
d3d8ed44
authored
Dec 28, 2012
by
Oleg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments for optgroup and option elements in wrapMap
Add tests for optgroup element
parent
f193acf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
manipulation.js
src/manipulation.js
+3
-0
manipulation.js
test/unit/manipulation.js
+5
-1
No files found.
src/manipulation.js
View file @
d3d8ed44
...
...
@@ -9,6 +9,8 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
rscriptTypeMasked
=
/^true
\/(
.*
)
/
,
rcleanScript
=
/^
\s
*<!
(?:\[
CDATA
\[
|--
)
|
(?:\]\]
|--
)
>
\s
*$/g
,
wrapMap
=
{
// Support: IE 9
option
:
[
1
,
"<select multiple='multiple'>"
],
legend
:
[
1
,
"<fieldset>"
],
param
:
[
1
,
"<object>"
],
...
...
@@ -19,6 +21,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
_default
:
[
0
,
""
]
};
// Support: IE 9
wrapMap
.
optgroup
=
wrapMap
.
option
;
wrapMap
.
tbody
=
wrapMap
.
tfoot
=
wrapMap
.
colgroup
=
wrapMap
.
caption
=
wrapMap
.
thead
;
wrapMap
.
th
=
wrapMap
.
td
;
...
...
test/unit/manipulation.js
View file @
d3d8ed44
...
...
@@ -395,7 +395,7 @@ var testAppendForObject = function( valueObj, isFragment ) {
var
testAppend
=
function
(
valueObj
)
{
expect
(
6
1
);
expect
(
6
3
);
testAppendForObject
(
valueObj
,
false
);
testAppendForObject
(
valueObj
,
true
);
...
...
@@ -454,6 +454,10 @@ var testAppend = function( valueObj ) {
jQuery
(
"#select1"
).
append
(
valueObj
(
"<OPTION>Test</OPTION>"
)
);
equal
(
jQuery
(
"#select1 option:last"
).
text
(),
"Test"
,
"Appending OPTION (all caps)"
);
jQuery
(
"#select1"
).
append
(
valueObj
(
"<optgroup label='optgroup'><option>optgroup</option></optgroup>"
)
);
equal
(
jQuery
(
"#select1 optgroup"
).
attr
(
"label"
),
"optgroup"
,
"Label attribute in newly inserted optgroup is correct"
);
equal
(
jQuery
(
"#select1 option:last"
).
text
(),
"optgroup"
,
"Appending optgroup"
);
jQuery
(
"#table"
).
append
(
valueObj
(
"<colgroup></colgroup>"
)
);
equal
(
jQuery
(
"#table colgroup"
).
length
,
1
,
"Append colgroup"
);
...
...
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