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
6aa4095e
Commit
6aa4095e
authored
Dec 06, 2011
by
Mike Sherov
Committed by
Dave Methvin
Dec 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #10796. Allow IE<9 to retrieve uncomputed styles.
parent
64df670a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
css.js
src/css.js
+3
-3
css.js
test/unit/css.js
+23
-0
No files found.
src/css.js
View file @
6aa4095e
...
@@ -5,7 +5,7 @@ var ralpha = /alpha\([^)]*\)/i,
...
@@ -5,7 +5,7 @@ var ralpha = /alpha\([^)]*\)/i,
// fixed for IE9, see #8346
// fixed for IE9, see #8346
rupper
=
/
([
A-Z
]
|^ms
)
/g
,
rupper
=
/
([
A-Z
]
|^ms
)
/g
,
rnumpx
=
/^-
?\d
+
(?:
px
)?
$/i
,
rnumpx
=
/^-
?\d
+
(?:
px
)?
$/i
,
rnum
=
/^-
?\d
/
,
rnum
nopx
=
/^-
?\d
+
(?!
px
)[^\d\s]
+$/i
,
rrelNum
=
/^
([\-
+
])
=
([\-
+.
\d
e
]
+
)
/
,
rrelNum
=
/^
([\-
+
])
=
([\-
+.
\d
e
]
+
)
/
,
cssShow
=
{
position
:
"absolute"
,
visibility
:
"hidden"
,
display
:
"block"
},
cssShow
=
{
position
:
"absolute"
,
visibility
:
"hidden"
,
display
:
"block"
},
...
@@ -280,7 +280,7 @@ if ( document.documentElement.currentStyle ) {
...
@@ -280,7 +280,7 @@ if ( document.documentElement.currentStyle ) {
// Avoid setting ret to empty string here
// Avoid setting ret to empty string here
// so we don't default to auto
// so we don't default to auto
if
(
ret
==
=
null
&&
style
&&
(
uncomputed
=
style
[
name
])
)
{
if
(
ret
==
null
&&
style
&&
(
uncomputed
=
style
[
name
])
)
{
ret
=
uncomputed
;
ret
=
uncomputed
;
}
}
...
@@ -289,7 +289,7 @@ if ( document.documentElement.currentStyle ) {
...
@@ -289,7 +289,7 @@ if ( document.documentElement.currentStyle ) {
// If we're not dealing with a regular pixel number
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// but a number that has a weird ending, we need to convert it to pixels
if
(
!
rnumpx
.
test
(
ret
)
&&
rnum
.
test
(
ret
)
)
{
if
(
rnumnopx
.
test
(
ret
)
)
{
// Remember the original values
// Remember the original values
left
=
style
.
left
;
left
=
style
.
left
;
...
...
test/unit/css.js
View file @
6aa4095e
...
@@ -511,6 +511,29 @@ test("can't get css for disconnected in IE<9, see #10254 and #8388", function()
...
@@ -511,6 +511,29 @@ test("can't get css for disconnected in IE<9, see #10254 and #8388", function()
equal
(
div
.
css
(
"top"
),
"10px"
,
"can't get top in IE<9, see #8388"
);
equal
(
div
.
css
(
"top"
),
"10px"
,
"can't get top in IE<9, see #8388"
);
});
});
test
(
"can't get background-position in IE<9, see #10796"
,
function
()
{
var
div
=
jQuery
(
"<div/>"
).
appendTo
(
"#qunit-fixture"
),
units
=
[
"0 0"
,
"12px 12px"
,
"13px 12em"
,
"12em 13px"
,
"12em center"
,
"+12em center"
,
"12.2em center"
,
"center center"
,
],
l
=
units
.
length
,
i
=
0
;
expect
(
l
);
for
(
;
i
<
l
;
i
++
)
{
div
.
css
(
"background-position"
,
units
[
i
]
);
ok
(
div
.
css
(
"background-position"
),
"can't get background-position in IE<9, see #10796"
);
}
});
test
(
"Do not append px to 'fill-opacity' #9548"
,
1
,
function
()
{
test
(
"Do not append px to 'fill-opacity' #9548"
,
1
,
function
()
{
var
$div
=
jQuery
(
"<div>"
).
appendTo
(
"#qunit-fixture"
);
var
$div
=
jQuery
(
"<div>"
).
appendTo
(
"#qunit-fixture"
);
...
...
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