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
78756224
Commit
78756224
authored
May 05, 2014
by
Michał Gołębiowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajax, Manipulation: don't test cross-document manip in Android 2.3
parent
da148f15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
ajax.js
test/unit/ajax.js
+6
-0
manipulation.js
test/unit/manipulation.js
+17
-2
No files found.
test/unit/ajax.js
View file @
78756224
...
...
@@ -1470,6 +1470,12 @@ module( "ajax", {
var
parsedXML
=
jQuery
(
jQuery
.
parseXML
(
"<tab title=
\"
Added
\"
>blibli</tab>"
)
).
find
(
"tab"
);
ajaxXML
=
jQuery
(
ajaxXML
);
try
{
// Android 2.3 doesn't automatically adopt nodes from foreign documents.
// (see the comment in test/manipulation.js)
// Support: Android 2.3
if
(
/android 2
\.
3/i
.
test
(
navigator
.
userAgent
)
)
{
parsedXML
=
jQuery
(
ajaxXML
[
0
].
adoptNode
(
parsedXML
[
0
]
)
);
}
ajaxXML
.
find
(
"infowindowtab"
).
append
(
parsedXML
);
}
catch
(
e
)
{
strictEqual
(
e
,
undefined
,
"error"
);
...
...
test/unit/manipulation.js
View file @
78756224
...
...
@@ -409,7 +409,7 @@ test( "XML DOM manipulation (#9960)", function() {
expect
(
5
);
var
var
scxml1Adopted
,
xmlDoc1
=
jQuery
.
parseXML
(
"<scxml xmlns='http://www.w3.org/2005/07/scxml' version='1.0'><state x='100' y='100' initial='actions' id='provisioning'></state><state x='100' y='100' id='error'></state><state x='100' y='100' id='finished' final='true'></state></scxml>"
),
xmlDoc2
=
jQuery
.
parseXML
(
"<scxml xmlns='http://www.w3.org/2005/07/scxml' version='1.0'><state id='provisioning3'></state></scxml>"
),
xml1
=
jQuery
(
xmlDoc1
),
...
...
@@ -418,6 +418,15 @@ test( "XML DOM manipulation (#9960)", function() {
scxml2
=
jQuery
(
"scxml"
,
xml2
),
state
=
scxml2
.
find
(
"state"
);
// Android 2.3 doesn't automatically adopt nodes from foreign documents.
// Although technically this is compliant behavior, no other browser
// (including newer Android Browsers) behave in this way so do the adopting
// just for Android 2.3.
// Support: Android 2.3
if
(
/android 2
\.
3/i
.
test
(
navigator
.
userAgent
)
)
{
state
=
jQuery
(
xmlDoc1
.
adoptNode
(
state
[
0
]
)
);
}
scxml1
.
append
(
state
);
strictEqual
(
scxml1
[
0
].
lastChild
,
state
[
0
],
"append"
);
...
...
@@ -430,7 +439,13 @@ test( "XML DOM manipulation (#9960)", function() {
scxml1
.
find
(
"#provisioning"
).
before
(
state
);
strictEqual
(
scxml1
[
0
].
firstChild
,
state
[
0
],
"before"
);
scxml2
.
replaceWith
(
scxml1
);
// Support: Android 2.3
if
(
/android 2
\.
3/i
.
test
(
navigator
.
userAgent
)
)
{
scxml1Adopted
=
jQuery
(
xmlDoc2
.
adoptNode
(
scxml1
[
0
]
)
);
scxml2
.
replaceWith
(
scxml1Adopted
);
}
else
{
scxml2
.
replaceWith
(
scxml1
);
}
deepEqual
(
jQuery
(
"state"
,
xml2
).
get
(),
scxml1
.
find
(
"state"
).
get
(),
"replaceWith"
);
});
...
...
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