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
6da5eb10
Commit
6da5eb10
authored
Mar 07, 2013
by
Oleg
Committed by
Dave Methvin
Apr 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow-up for
22a4e5bd
, fix .checkOn, add...
Follow-up for
22a4e5bd
, fix .checkOn, add support tests. Cloes gh-1199.
parent
5aaa276e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
138 additions
and
1 deletion
+138
-1
support.js
src/support.js
+1
-1
support.js
test/unit/support.js
+137
-0
No files found.
src/support.js
View file @
6da5eb10
...
@@ -13,7 +13,7 @@ jQuery.support = (function( support ) {
...
@@ -13,7 +13,7 @@ jQuery.support = (function( support ) {
input
.
type
=
"checkbox"
;
input
.
type
=
"checkbox"
;
// Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
// Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
support
.
checkOn
=
input
.
value
=
==
""
;
support
.
checkOn
=
input
.
value
!
==
""
;
// Must access the parent to make an option select properly
// Must access the parent to make an option select properly
// Support: IE9, IE10
// Support: IE9, IE10
...
...
test/unit/support.js
View file @
6da5eb10
...
@@ -34,6 +34,143 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
...
@@ -34,6 +34,143 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
strictEqual
(
shrinkWrapBlocks
,
jQuery
.
support
.
shrinkWrapBlocks
,
"jQuery.support.shrinkWrapBlocks properties are the same"
);
strictEqual
(
shrinkWrapBlocks
,
jQuery
.
support
.
shrinkWrapBlocks
,
"jQuery.support.shrinkWrapBlocks properties are the same"
);
});
});
(
function
()
{
var
expected
,
userAgent
=
window
.
navigator
.
userAgent
;
if
(
/chrome/i
.
test
(
userAgent
)
)
{
expected
=
{
"checkOn"
:
true
,
"optSelected"
:
true
,
"optDisabled"
:
true
,
"focusinBubbles"
:
false
,
"reliableMarginRight"
:
true
,
"noCloneChecked"
:
true
,
"radioValue"
:
true
,
"checkClone"
:
true
,
"boxModel"
:
true
,
"ajax"
:
true
,
"cors"
:
true
,
"clearCloneStyle"
:
true
,
"boxSizing"
:
true
,
"boxSizingReliable"
:
true
,
"pixelPosition"
:
false
};
}
else
if
(
/opera.*version
\/
12
\.
1/i
.
test
(
userAgent
)
)
{
expected
=
{
"checkOn"
:
true
,
"optSelected"
:
true
,
"optDisabled"
:
true
,
"focusinBubbles"
:
false
,
"reliableMarginRight"
:
true
,
"noCloneChecked"
:
true
,
"radioValue"
:
false
,
"checkClone"
:
true
,
"boxModel"
:
true
,
"ajax"
:
true
,
"cors"
:
true
,
"clearCloneStyle"
:
true
,
"boxSizing"
:
true
,
"boxSizingReliable"
:
true
,
"pixelPosition"
:
true
};
}
else
if
(
/msie 10
\.
0/i
.
test
(
userAgent
)
)
{
expected
=
{
"checkOn"
:
true
,
"optSelected"
:
false
,
"optDisabled"
:
true
,
"focusinBubbles"
:
true
,
"reliableMarginRight"
:
true
,
"noCloneChecked"
:
false
,
"radioValue"
:
false
,
"checkClone"
:
true
,
"boxModel"
:
true
,
"ajax"
:
true
,
"cors"
:
true
,
"clearCloneStyle"
:
false
,
"boxSizing"
:
true
,
"boxSizingReliable"
:
false
,
"pixelPosition"
:
true
};
}
else
if
(
/msie 9
\.
0/i
.
test
(
userAgent
)
)
{
expected
=
{
"checkOn"
:
true
,
"optSelected"
:
false
,
"optDisabled"
:
true
,
"focusinBubbles"
:
true
,
"reliableMarginRight"
:
true
,
"noCloneChecked"
:
false
,
"radioValue"
:
false
,
"checkClone"
:
true
,
"boxModel"
:
true
,
"ajax"
:
true
,
"cors"
:
false
,
"clearCloneStyle"
:
false
,
"boxSizing"
:
true
,
"boxSizingReliable"
:
false
,
"pixelPosition"
:
true
};
}
else
if
(
/5
\.
1
\.\d
+ safari/i
.
test
(
userAgent
)
)
{
expected
=
{
"checkOn"
:
false
,
"optSelected"
:
true
,
"optDisabled"
:
true
,
"focusinBubbles"
:
false
,
"reliableMarginRight"
:
true
,
"noCloneChecked"
:
true
,
"radioValue"
:
true
,
"checkClone"
:
false
,
"boxModel"
:
true
,
"ajax"
:
true
,
"cors"
:
true
,
"clearCloneStyle"
:
true
,
"boxSizing"
:
true
,
"boxSizingReliable"
:
true
,
"pixelPosition"
:
false
};
}
else
if
(
/firefox/i
.
test
(
userAgent
)
)
{
expected
=
{
"checkOn"
:
true
,
"optSelected"
:
true
,
"optDisabled"
:
true
,
"focusinBubbles"
:
false
,
"reliableMarginRight"
:
true
,
"noCloneChecked"
:
true
,
"radioValue"
:
true
,
"checkClone"
:
true
,
"boxModel"
:
true
,
"ajax"
:
true
,
"cors"
:
true
,
"clearCloneStyle"
:
true
,
"boxSizing"
:
true
,
"boxSizingReliable"
:
false
,
"pixelPosition"
:
true
};
}
if
(
expected
)
{
test
(
"Verify that the support tests resolve as expected per browser"
,
function
()
{
var
i
,
prop
,
j
=
0
;
for
(
prop
in
jQuery
.
support
)
{
j
++
;
}
expect
(
j
);
for
(
i
in
expected
)
{
if
(
jQuery
.
ajax
||
i
!==
"ajax"
&&
i
!==
"cors"
)
{
equal
(
jQuery
.
support
[
i
],
expected
[
i
],
"jQuery.support['"
+
i
+
"']: "
+
jQuery
.
support
[
i
]
+
", expected['"
+
i
+
"']: "
+
expected
[
i
]);
}
else
{
ok
(
true
,
"no ajax; skipping jQuery.support['"
+
i
+
"']"
);
}
}
});
}
})();
// Support: Safari 5.1
// Support: Safari 5.1
// Shameless browser-sniff, but Safari 5.1 mishandles CSP
// Shameless browser-sniff, but Safari 5.1 mishandles CSP
if
(
!
(
typeof
navigator
!==
"undefined"
&&
if
(
!
(
typeof
navigator
!==
"undefined"
&&
...
...
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