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
3d9edb32
Commit
3d9edb32
authored
Jan 02, 2013
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove stranded support.js checks for oldIE.
parent
445dbd9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
64 deletions
+1
-64
support.js
src/support.js
+0
-23
css.js
test/unit/css.js
+1
-41
No files found.
src/support.js
View file @
3d9edb32
...
@@ -21,25 +21,6 @@ jQuery.support = (function() {
...
@@ -21,25 +21,6 @@ jQuery.support = (function() {
a
.
style
.
cssText
=
"float:left;opacity:.5"
;
a
.
style
.
cssText
=
"float:left;opacity:.5"
;
support
=
{
support
=
{
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute
:
div
.
className
!==
"t"
,
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace
:
div
.
firstChild
.
nodeType
===
3
,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody
:
!
div
.
getElementsByTagName
(
"tbody"
).
length
,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize
:
!!
div
.
getElementsByTagName
(
"link"
).
length
,
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity
:
/^0.5/
.
test
(
a
.
style
.
opacity
),
// Verify style float existence
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
// (IE uses styleFloat instead of cssFloat)
cssFloat
:
!!
a
.
style
.
cssFloat
,
cssFloat
:
!!
a
.
style
.
cssFloat
,
...
@@ -51,10 +32,6 @@ jQuery.support = (function() {
...
@@ -51,10 +32,6 @@ jQuery.support = (function() {
// Support: IE9, IE10
// Support: IE9, IE10
optSelected
:
opt
.
selected
,
optSelected
:
opt
.
selected
,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone
:
document
.
createElement
(
"nav"
).
cloneNode
(
true
).
outerHTML
!==
"<:nav></:nav>"
,
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel
:
document
.
compatMode
===
"CSS1Compat"
,
boxModel
:
document
.
compatMode
===
"CSS1Compat"
,
...
...
test/unit/css.js
View file @
3d9edb32
...
@@ -3,7 +3,7 @@ if ( jQuery.css ) {
...
@@ -3,7 +3,7 @@ if ( jQuery.css ) {
module
(
"css"
,
{
teardown
:
moduleTeardown
});
module
(
"css"
,
{
teardown
:
moduleTeardown
});
test
(
"css(String|Hash)"
,
function
()
{
test
(
"css(String|Hash)"
,
function
()
{
expect
(
4
6
);
expect
(
4
5
);
equal
(
jQuery
(
"#qunit-fixture"
).
css
(
"display"
),
"block"
,
"Check for css property
\"
display
\"
"
);
equal
(
jQuery
(
"#qunit-fixture"
).
css
(
"display"
),
"block"
,
"Check for css property
\"
display
\"
"
);
...
@@ -66,9 +66,6 @@ test("css(String|Hash)", function() {
...
@@ -66,9 +66,6 @@ test("css(String|Hash)", function() {
equal
(
jQuery
(
"#empty"
).
css
(
"opacity"
),
"0"
,
"Assert opacity is accessible via filter property set in stylesheet in IE"
);
equal
(
jQuery
(
"#empty"
).
css
(
"opacity"
),
"0"
,
"Assert opacity is accessible via filter property set in stylesheet in IE"
);
jQuery
(
"#empty"
).
css
({
"opacity"
:
"1"
});
jQuery
(
"#empty"
).
css
({
"opacity"
:
"1"
});
equal
(
jQuery
(
"#empty"
).
css
(
"opacity"
),
"1"
,
"Assert opacity is taken from style attribute when set vs stylesheet in IE with filters"
);
equal
(
jQuery
(
"#empty"
).
css
(
"opacity"
),
"1"
,
"Assert opacity is taken from style attribute when set vs stylesheet in IE with filters"
);
jQuery
.
support
.
opacity
?
ok
(
true
,
"Requires the same number of tests"
):
ok
(
~
jQuery
(
"#empty"
)[
0
].
currentStyle
.
filter
.
indexOf
(
"gradient"
),
"Assert setting opacity doesn't overwrite other filters of the stylesheet in IE"
);
div
=
jQuery
(
"#nothiddendiv"
);
div
=
jQuery
(
"#nothiddendiv"
);
var
child
=
jQuery
(
"#nothiddendivchild"
);
var
child
=
jQuery
(
"#nothiddendivchild"
);
...
@@ -273,43 +270,6 @@ test( "css(Array)", function() {
...
@@ -273,43 +270,6 @@ test( "css(Array)", function() {
deepEqual
(
elem
.
css
(
expectedSingle
).
css
([
"width"
]),
expectedSingle
,
"Getting single element array"
);
deepEqual
(
elem
.
css
(
expectedSingle
).
css
([
"width"
]),
expectedSingle
,
"Getting single element array"
);
});
});
if
(
!
jQuery
.
support
.
opacity
)
{
test
(
"css(String, Object) for MSIE"
,
function
()
{
expect
(
5
);
// for #1438, IE throws JS error when filter exists but doesn't have opacity in it
jQuery
(
"#foo"
).
css
(
"filter"
,
"progid:DXImageTransform.Microsoft.Chroma(color='red');"
);
equal
(
jQuery
(
"#foo"
).
css
(
"opacity"
),
"1"
,
"Assert opacity is 1 when a different filter is set in IE, #1438"
);
var
filterVal
=
"progid:DXImageTransform.Microsoft.Alpha(opacity=30) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)"
;
var
filterVal2
=
"progid:DXImageTransform.Microsoft.alpha(opacity=100) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)"
;
var
filterVal3
=
"progid:DXImageTransform.Microsoft.Blur(pixelradius=5)"
;
jQuery
(
"#foo"
).
css
(
"filter"
,
filterVal
);
equal
(
jQuery
(
"#foo"
).
css
(
"filter"
),
filterVal
,
"css('filter', val) works"
);
jQuery
(
"#foo"
).
css
(
"opacity"
,
1
);
equal
(
jQuery
(
"#foo"
).
css
(
"filter"
),
filterVal2
,
"Setting opacity in IE doesn't duplicate opacity filter"
);
equal
(
jQuery
(
"#foo"
).
css
(
"opacity"
),
1
,
"Setting opacity in IE with other filters works"
);
jQuery
(
"#foo"
).
css
(
"filter"
,
filterVal3
).
css
(
"opacity"
,
1
);
ok
(
jQuery
(
"#foo"
).
css
(
"filter"
).
indexOf
(
filterVal3
)
!==
-
1
,
"Setting opacity in IE doesn't clobber other filters"
);
});
test
(
"Setting opacity to 1 properly removes filter: style (#6652)"
,
function
()
{
var
rfilter
=
/filter:
[^
;
]
*/i
,
test
=
jQuery
(
"#t6652"
).
css
(
"opacity"
,
1
),
test2
=
test
.
find
(
"div"
).
css
(
"opacity"
,
1
);
function
hasFilter
(
elem
)
{
var
match
=
rfilter
.
exec
(
elem
[
0
].
style
.
cssText
);
if
(
match
)
{
return
true
;
}
return
false
;
}
expect
(
2
);
ok
(
!
hasFilter
(
test
),
"Removed filter attribute on element without filter in stylesheet"
);
ok
(
hasFilter
(
test2
),
"Filter attribute remains on element that had filter in stylesheet"
);
});
}
test
(
"css(String, Function)"
,
function
()
{
test
(
"css(String, Function)"
,
function
()
{
expect
(
3
);
expect
(
3
);
...
...
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