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
d6500cc8
Commit
d6500cc8
authored
Dec 09, 2011
by
Richard Gibson
Committed by
Dave Methvin
Dec 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #10858: CSS regexps recognize non-integer and explicit positive numbers.
parent
8f5f1b2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
css.js
src/css.js
+7
-15
No files found.
src/css.js
View file @
d6500cc8
...
@@ -4,8 +4,8 @@ var ralpha = /alpha\([^)]*\)/i,
...
@@ -4,8 +4,8 @@ var ralpha = /alpha\([^)]*\)/i,
ropacity
=
/opacity=
([^
)
]
*
)
/
,
ropacity
=
/opacity=
([^
)
]
*
)
/
,
// fixed for IE9, see #8346
// fixed for IE9, see #8346
rupper
=
/
([
A-Z
]
|^ms
)
/g
,
rupper
=
/
([
A-Z
]
|^ms
)
/g
,
rnum
px
=
/^-
?\d
+
(?:
px
)?
$/i
,
rnum
=
/^
[\-
+
]?(?:\d
*
\.)?\d
+
$/i
,
rnumno
px
=
/^-
?\d
+
(?!
px
)[^\d\s]
+$/i
,
rnumno
npx
=
/^-
?(?:\d
*
\.)
?\d
+
(?!
px
)[^\d\s]
+$/i
,
rrelNum
=
/^
([\-
+
])
=
([\-
+.
\d
e
]
+
)
/
,
rrelNum
=
/^
([\-
+
])
=
([\-
+.
\d
e
]
+
)
/
,
rmargin
=
/^margin/
,
rmargin
=
/^margin/
,
...
@@ -181,17 +181,9 @@ jQuery.each(["height", "width"], function( i, name ) {
...
@@ -181,17 +181,9 @@ jQuery.each(["height", "width"], function( i, name ) {
},
},
set
:
function
(
elem
,
value
)
{
set
:
function
(
elem
,
value
)
{
if
(
rnumpx
.
test
(
value
)
)
{
return
rnum
.
test
(
value
)
?
// ignore negative width and height values #1599
value
+
"px"
:
value
=
parseFloat
(
value
);
value
;
if
(
value
>=
0
)
{
return
value
+
"px"
;
}
}
else
{
return
value
;
}
}
}
};
};
});
});
...
@@ -274,7 +266,7 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
...
@@ -274,7 +266,7 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
// A tribute to the "awesome hack by Dean Edwards"
// A tribute to the "awesome hack by Dean Edwards"
// WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
// WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
// which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
// which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if
(
!
jQuery
.
support
.
pixelMargin
&&
computedStyle
&&
rmargin
.
test
(
name
)
&&
rnumnopx
.
test
(
ret
)
)
{
if
(
!
jQuery
.
support
.
pixelMargin
&&
computedStyle
&&
rmargin
.
test
(
name
)
&&
rnumno
n
px
.
test
(
ret
)
)
{
width
=
style
.
width
;
width
=
style
.
width
;
style
.
width
=
ret
;
style
.
width
=
ret
;
ret
=
computedStyle
.
width
;
ret
=
computedStyle
.
width
;
...
@@ -302,7 +294,7 @@ if ( document.documentElement.currentStyle ) {
...
@@ -302,7 +294,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
(
rnumnopx
.
test
(
ret
)
)
{
if
(
rnumno
n
px
.
test
(
ret
)
)
{
// Remember the original values
// Remember the original values
left
=
style
.
left
;
left
=
style
.
left
;
...
...
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