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
a270d638
Commit
a270d638
authored
Dec 11, 2012
by
Scott González
Committed by
Dave Methvin
Dec 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CSS: Save some bytes. Close gh-1071.
parent
13651f29
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
css.js
src/css.js
+13
-13
No files found.
src/css.js
View file @
a270d638
...
@@ -147,7 +147,6 @@ jQuery.extend({
...
@@ -147,7 +147,6 @@ jQuery.extend({
// We should always get a number back from opacity
// We should always get a number back from opacity
var
ret
=
curCSS
(
elem
,
"opacity"
);
var
ret
=
curCSS
(
elem
,
"opacity"
);
return
ret
===
""
?
"1"
:
ret
;
return
ret
===
""
?
"1"
:
ret
;
}
}
}
}
}
}
...
@@ -386,6 +385,7 @@ if ( window.getComputedStyle ) {
...
@@ -386,6 +385,7 @@ if ( window.getComputedStyle ) {
function
setPositiveNumber
(
elem
,
value
,
subtract
)
{
function
setPositiveNumber
(
elem
,
value
,
subtract
)
{
var
matches
=
rnumsplit
.
exec
(
value
);
var
matches
=
rnumsplit
.
exec
(
value
);
return
matches
?
return
matches
?
// Guard against undefined "subtract", e.g., when used as in cssHooks
Math
.
max
(
0
,
matches
[
1
]
-
(
subtract
||
0
)
)
+
(
matches
[
2
]
||
"px"
)
:
Math
.
max
(
0
,
matches
[
1
]
-
(
subtract
||
0
)
)
+
(
matches
[
2
]
||
"px"
)
:
value
;
value
;
}
}
...
@@ -432,8 +432,8 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
...
@@ -432,8 +432,8 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
function
getWidthOrHeight
(
elem
,
name
,
extra
)
{
function
getWidthOrHeight
(
elem
,
name
,
extra
)
{
// Start with offset property, which is equivalent to the border-box value
// Start with offset property, which is equivalent to the border-box value
var
val
=
name
===
"width"
?
elem
.
offsetWidth
:
elem
.
offsetHeight
,
var
val
ueIsBorderBox
=
true
,
val
ueIsBorderBox
=
true
,
val
=
name
===
"width"
?
elem
.
offsetWidth
:
elem
.
offsetHeight
,
styles
=
getStyles
(
elem
),
styles
=
getStyles
(
elem
),
isBorderBox
=
jQuery
.
support
.
boxSizing
&&
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
;
isBorderBox
=
jQuery
.
support
.
boxSizing
&&
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
;
...
@@ -506,9 +506,8 @@ function css_defaultDisplay( nodeName ) {
...
@@ -506,9 +506,8 @@ function css_defaultDisplay( nodeName ) {
// Called ONLY from within css_defaultDisplay
// Called ONLY from within css_defaultDisplay
function
actualDisplay
(
name
,
doc
)
{
function
actualDisplay
(
name
,
doc
)
{
var
elem
,
display
;
var
elem
=
jQuery
(
doc
.
createElement
(
name
)
).
appendTo
(
doc
.
body
),
elem
=
jQuery
(
doc
.
createElement
(
name
)
);
display
=
jQuery
.
css
(
elem
[
0
],
"display"
);
display
=
jQuery
.
css
(
elem
.
appendTo
(
doc
.
body
)[
0
],
"display"
);
elem
.
remove
();
elem
.
remove
();
return
display
;
return
display
;
}
}
...
@@ -621,8 +620,9 @@ jQuery(function() {
...
@@ -621,8 +620,9 @@ jQuery(function() {
jQuery
.
each
(
[
"top"
,
"left"
],
function
(
i
,
prop
)
{
jQuery
.
each
(
[
"top"
,
"left"
],
function
(
i
,
prop
)
{
jQuery
.
cssHooks
[
prop
]
=
{
jQuery
.
cssHooks
[
prop
]
=
{
get
:
function
(
elem
,
computed
)
{
get
:
function
(
elem
,
computed
)
{
var
ret
;
if
(
computed
)
{
if
(
computed
)
{
var
ret
=
curCSS
(
elem
,
prop
);
ret
=
curCSS
(
elem
,
prop
);
// if curCSS returns percentage, fallback to offset
// if curCSS returns percentage, fallback to offset
return
rnumnonpx
.
test
(
ret
)
?
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
ret
;
return
rnumnonpx
.
test
(
ret
)
?
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
ret
;
}
}
...
@@ -651,13 +651,13 @@ jQuery.each({
...
@@ -651,13 +651,13 @@ jQuery.each({
},
function
(
prefix
,
suffix
)
{
},
function
(
prefix
,
suffix
)
{
jQuery
.
cssHooks
[
prefix
+
suffix
]
=
{
jQuery
.
cssHooks
[
prefix
+
suffix
]
=
{
expand
:
function
(
value
)
{
expand
:
function
(
value
)
{
var
i
,
var
i
=
0
,
// assumes a single number if not a string
// assumes a single number if not a string
parts
=
typeof
value
===
"string"
?
value
.
split
(
" "
)
:
[
value
],
parts
=
typeof
value
===
"string"
?
value
.
split
(
" "
)
:
[
value
],
expanded
=
{};
expanded
=
{};
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
;
i
<
4
;
i
++
)
{
expanded
[
prefix
+
cssExpand
[
i
]
+
suffix
]
=
expanded
[
prefix
+
cssExpand
[
i
]
+
suffix
]
=
parts
[
i
]
||
parts
[
i
-
2
]
||
parts
[
0
];
parts
[
i
]
||
parts
[
i
-
2
]
||
parts
[
0
];
}
}
...
...
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