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
3e285bd6
Commit
3e285bd6
authored
Apr 21, 2008
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small optimization to jQuery.curCSS (thanks Ariel Flesler)
parent
5d033dba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
core.js
src/core.js
+10
-7
No files found.
src/core.js
View file @
3e285bd6
...
@@ -611,6 +611,8 @@ var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {};
...
@@ -611,6 +611,8 @@ var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {};
// exclude the following css properties to add px
// exclude the following css properties to add px
var
exclude
=
/z-
?
index|font-
?
weight|opacity|zoom|line-
?
height/i
;
var
exclude
=
/z-
?
index|font-
?
weight|opacity|zoom|line-
?
height/i
;
// cache getComputedStyle
var
getComputedStyle
=
document
.
defaultView
&&
document
.
defaultView
.
getComputedStyle
;
jQuery
.
extend
({
jQuery
.
extend
({
noConflict
:
function
(
deep
)
{
noConflict
:
function
(
deep
)
{
...
@@ -838,7 +840,8 @@ jQuery.extend({
...
@@ -838,7 +840,8 @@ jQuery.extend({
if
(
!
jQuery
.
browser
.
safari
)
if
(
!
jQuery
.
browser
.
safari
)
return
false
;
return
false
;
var
ret
=
document
.
defaultView
.
getComputedStyle
(
elem
,
null
);
// getComputedStyle is cached
var
ret
=
getComputedStyle
(
elem
,
null
);
return
!
ret
||
ret
.
getPropertyValue
(
"color"
)
==
""
;
return
!
ret
||
ret
.
getPropertyValue
(
"color"
)
==
""
;
}
}
...
@@ -864,7 +867,7 @@ jQuery.extend({
...
@@ -864,7 +867,7 @@ jQuery.extend({
if
(
!
force
&&
elem
.
style
&&
elem
.
style
[
name
]
)
if
(
!
force
&&
elem
.
style
&&
elem
.
style
[
name
]
)
ret
=
elem
.
style
[
name
];
ret
=
elem
.
style
[
name
];
else
if
(
document
.
defaultView
&&
document
.
defaultView
.
getComputedStyle
)
{
else
if
(
getComputedStyle
)
{
// Only "float" is needed here
// Only "float" is needed here
if
(
name
.
match
(
/float/i
)
)
if
(
name
.
match
(
/float/i
)
)
...
@@ -872,10 +875,10 @@ jQuery.extend({
...
@@ -872,10 +875,10 @@ jQuery.extend({
name
=
name
.
replace
(
/
([
A-Z
])
/g
,
"-$1"
).
toLowerCase
();
name
=
name
.
replace
(
/
([
A-Z
])
/g
,
"-$1"
).
toLowerCase
();
var
getComputedStyle
=
document
.
defaultView
.
getComputedStyle
(
elem
,
null
);
var
computedStyle
=
getComputedStyle
(
elem
,
null
);
if
(
getC
omputedStyle
&&
!
color
(
elem
)
)
if
(
c
omputedStyle
&&
!
color
(
elem
)
)
ret
=
getC
omputedStyle
.
getPropertyValue
(
name
);
ret
=
c
omputedStyle
.
getPropertyValue
(
name
);
// If the element isn't reporting its values properly in Safari
// If the element isn't reporting its values properly in Safari
// then some display: none elements are involved
// then some display: none elements are involved
...
@@ -898,7 +901,7 @@ jQuery.extend({
...
@@ -898,7 +901,7 @@ jQuery.extend({
// one special, otherwise get the value
// one special, otherwise get the value
ret
=
name
==
"display"
&&
swap
[
stack
.
length
-
1
]
!=
null
?
ret
=
name
==
"display"
&&
swap
[
stack
.
length
-
1
]
!=
null
?
"none"
:
"none"
:
(
getComputedStyle
&&
getC
omputedStyle
.
getPropertyValue
(
name
)
)
||
""
;
(
computedStyle
&&
c
omputedStyle
.
getPropertyValue
(
name
)
)
||
""
;
// Finally, revert the display styles back
// Finally, revert the display styles back
for
(
var
i
=
0
;
i
<
swap
.
length
;
i
++
)
for
(
var
i
=
0
;
i
<
swap
.
length
;
i
++
)
...
...
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