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
22fac5c2
Commit
22fac5c2
authored
Oct 01, 2012
by
Richard Gibson
Committed by
Dave Methvin
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12357: be more kind to non-browser environments. Close gh-938.
parent
f9ef91d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
support.js
src/support.js
+6
-7
No files found.
src/support.js
View file @
22fac5c2
...
@@ -13,24 +13,23 @@ jQuery.support = (function() {
...
@@ -13,24 +13,23 @@ jQuery.support = (function() {
clickFn
,
clickFn
,
div
=
document
.
createElement
(
"div"
);
div
=
document
.
createElement
(
"div"
);
//
Preliminary tests
//
Setup
div
.
setAttribute
(
"className"
,
"t"
);
div
.
setAttribute
(
"className"
,
"t"
);
div
.
innerHTML
=
" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"
;
div
.
innerHTML
=
" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"
;
// Support tests won't run in some limited or non-browser environments
all
=
div
.
getElementsByTagName
(
"*"
);
all
=
div
.
getElementsByTagName
(
"*"
);
a
=
div
.
getElementsByTagName
(
"a"
)[
0
];
a
=
div
.
getElementsByTagName
(
"a"
)[
0
];
a
.
style
.
cssText
=
"top:1px;float:left;opacity:.5"
;
if
(
!
all
||
!
a
||
!
all
.
length
)
{
// Can't get basic test support
if
(
!
all
||
!
all
.
length
)
{
return
{};
return
{};
}
}
// First batch of
supports
tests
// First batch of tests
select
=
document
.
createElement
(
"select"
);
select
=
document
.
createElement
(
"select"
);
opt
=
select
.
appendChild
(
document
.
createElement
(
"option"
)
);
opt
=
select
.
appendChild
(
document
.
createElement
(
"option"
)
);
input
=
div
.
getElementsByTagName
(
"input"
)[
0
];
input
=
div
.
getElementsByTagName
(
"input"
)[
0
];
a
.
style
.
cssText
=
"top:1px;float:left;opacity:.5"
;
support
=
{
support
=
{
// IE strips leading whitespace when .innerHTML is used
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace
:
(
div
.
firstChild
.
nodeType
===
3
),
leadingWhitespace
:
(
div
.
firstChild
.
nodeType
===
3
),
...
@@ -72,7 +71,7 @@ jQuery.support = (function() {
...
@@ -72,7 +71,7 @@ jQuery.support = (function() {
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute
:
div
.
className
!==
"t"
,
getSetAttribute
:
div
.
className
!==
"t"
,
// Tests for enctype support on a form(#6743)
// Tests for enctype support on a form
(#6743)
enctype
:
!!
document
.
createElement
(
"form"
).
enctype
,
enctype
:
!!
document
.
createElement
(
"form"
).
enctype
,
// Makes sure cloning an html5 element does not cause problems
// Makes sure cloning an html5 element does not cause problems
...
...
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