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
03fdc70a
Commit
03fdc70a
authored
Sep 11, 2013
by
Timmy Willison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct the checkClone support test for Safari 5.1 and mobile webkits
Conflicts: src/manipulation/support.js
parent
7a6c635c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
support.js
src/manipulation/support.js
+13
-16
No files found.
src/manipulation/support.js
View file @
03fdc70a
...
...
@@ -3,14 +3,13 @@ define([
],
function
(
support
)
{
(
function
()
{
var
input
,
fragment
,
div
=
document
.
createElement
(
"div"
);
var
fragment
=
document
.
createDocumentFragment
(),
div
=
document
.
createElement
(
"div"
),
input
=
document
.
createElement
(
"input"
);
// Setup
div
.
setAttribute
(
"className"
,
"t"
);
div
.
innerHTML
=
" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"
;
input
=
div
.
getElementsByTagName
(
"input"
)[
0
];
input
.
type
=
"checkbox"
;
div
.
innerHTML
=
" <link/><table></table><a href='/a'>a</a>"
;
// IE strips leading whitespace when .innerHTML is used
support
.
leadingWhitespace
=
div
.
firstChild
.
nodeType
===
3
;
...
...
@@ -32,20 +31,18 @@ define([
input
.
checked
=
true
;
support
.
noCloneChecked
=
input
.
cloneNode
(
true
).
checked
;
// #11217 - WebKit loses check when the name is after the checked attribute
input
.
checked
=
false
;
input
.
setAttribute
(
"checked"
,
"t"
);
input
.
setAttribute
(
"name"
,
"t"
);
fragment
=
document
.
createDocumentFragment
();
fragment
.
appendChild
(
input
);
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
fragment
.
appendChild
(
input
);
support
.
appendChecked
=
input
.
checked
;
// WebKit doesn't clone checked state correctly in fragments
support
.
checkClone
=
fragment
.
cloneNode
(
true
).
cloneNode
(
true
).
lastChild
.
checked
;
// #11217 - WebKit loses check when the name is after the checked attribute
fragment
.
appendChild
(
div
);
div
.
innerHTML
=
"<input type='radio' checked name='t'/>"
;
// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
// old WebKit doesn't clone checked state correctly in fragments
support
.
checkClone
=
div
.
cloneNode
(
true
).
cloneNode
(
true
).
lastChild
.
checked
;
// Support: IE<9
// Opera does not clone events (and typeof div.attachEvent === undefined).
...
...
@@ -71,7 +68,7 @@ define([
}
// Null elements to avoid leaks in IE.
input
=
fragment
=
div
=
null
;
fragment
=
div
=
input
=
null
;
})();
return
support
;
...
...
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