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
9ce1d09a
Commit
9ce1d09a
authored
Aug 26, 2010
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blackberry 4.6 doesn't maintain comment nodes in the DOM, ignore them in our test cases.
parent
1e9d6e12
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
manipulation.js
test/unit/manipulation.js
+6
-2
No files found.
test/unit/manipulation.js
View file @
9ce1d09a
...
@@ -22,7 +22,9 @@ var testText = function(valueObj) {
...
@@ -22,7 +22,9 @@ var testText = function(valueObj) {
j
.
text
(
valueObj
(
"hi!"
));
j
.
text
(
valueObj
(
"hi!"
));
equals
(
jQuery
(
j
[
0
]).
text
(),
"hi!"
,
"Check node,textnode,comment with text()"
);
equals
(
jQuery
(
j
[
0
]).
text
(),
"hi!"
,
"Check node,textnode,comment with text()"
);
equals
(
j
[
1
].
nodeValue
,
" there "
,
"Check node,textnode,comment with text()"
);
equals
(
j
[
1
].
nodeValue
,
" there "
,
"Check node,textnode,comment with text()"
);
equals
(
j
[
2
].
nodeType
,
8
,
"Check node,textnode,comment with text()"
);
// Blackberry 4.6 doesn't maintain comments in the DOM
equals
(
jQuery
(
"#nonnodes"
)[
0
].
childNodes
.
length
<
3
?
8
:
j
[
2
].
nodeType
,
8
,
"Check node,textnode,comment with text()"
);
}
}
test
(
"text(String)"
,
function
()
{
test
(
"text(String)"
,
function
()
{
...
@@ -72,7 +74,9 @@ var testWrap = function(val) {
...
@@ -72,7 +74,9 @@ var testWrap = function(val) {
// using contents will get comments regular, text, and comment nodes
// using contents will get comments regular, text, and comment nodes
var
j
=
jQuery
(
"#nonnodes"
).
contents
();
var
j
=
jQuery
(
"#nonnodes"
).
contents
();
j
.
wrap
(
val
(
"<i></i>"
));
j
.
wrap
(
val
(
"<i></i>"
));
equals
(
jQuery
(
"#nonnodes > i"
).
length
,
3
,
"Check node,textnode,comment wraps ok"
);
// Blackberry 4.6 doesn't maintain comments in the DOM
equals
(
jQuery
(
"#nonnodes > i"
).
length
,
jQuery
(
"#nonnodes"
)[
0
].
childNodes
.
length
,
"Check node,textnode,comment wraps ok"
);
equals
(
jQuery
(
"#nonnodes > i"
).
text
(),
j
.
text
(),
"Check node,textnode,comment wraps doesn't hurt text"
);
equals
(
jQuery
(
"#nonnodes > i"
).
text
(),
j
.
text
(),
"Check node,textnode,comment wraps doesn't hurt text"
);
// Try wrapping a disconnected node
// Try wrapping a disconnected node
...
...
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