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
449e099b
Commit
449e099b
authored
Nov 11, 2009
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Landing tweak from 'haruka' that fixes non-pixel fontSize values in IE. Fixes #760.
parent
bf71575b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
css.js
src/css.js
+2
-2
testsuite.css
test/data/testsuite.css
+4
-0
css.js
test/unit/css.js
+12
-1
No files found.
src/css.js
View file @
449e099b
...
@@ -167,7 +167,7 @@ jQuery.extend({
...
@@ -167,7 +167,7 @@ jQuery.extend({
// Put in the new values to get a computed value out
// Put in the new values to get a computed value out
elem
.
runtimeStyle
.
left
=
elem
.
currentStyle
.
left
;
elem
.
runtimeStyle
.
left
=
elem
.
currentStyle
.
left
;
style
.
left
=
ret
||
0
;
style
.
left
=
camelCase
===
"fontSize"
?
"1em"
:
(
ret
||
0
)
;
ret
=
style
.
pixelLeft
+
"px"
;
ret
=
style
.
pixelLeft
+
"px"
;
// Revert the changed values
// Revert the changed values
...
...
test/data/testsuite.css
View file @
449e099b
...
@@ -103,3 +103,7 @@ div.chain.out { background: green; }
...
@@ -103,3 +103,7 @@ div.chain.out { background: green; }
div
.chain.out
div
{
background
:
red
;
display
:
none
;
}
div
.chain.out
div
{
background
:
red
;
display
:
none
;
}
div
#show-tests
*
{
display
:
none
;
}
div
#show-tests
*
{
display
:
none
;
}
#nothiddendiv
{
font-size
:
16px
;
}
#nothiddendivchild
.em
{
font-size
:
2em
;
}
#nothiddendivchild
.prct
{
font-size
:
150%
;
}
test/unit/css.js
View file @
449e099b
module
(
"css"
);
module
(
"css"
);
test
(
"css(String|Hash)"
,
function
()
{
test
(
"css(String|Hash)"
,
function
()
{
expect
(
2
3
);
expect
(
2
7
);
equals
(
jQuery
(
'#main'
).
css
(
"display"
),
'none'
,
'Check for css property "display"'
);
equals
(
jQuery
(
'#main'
).
css
(
"display"
),
'none'
,
'Check for css property "display"'
);
...
@@ -38,6 +38,17 @@ test("css(String|Hash)", function() {
...
@@ -38,6 +38,17 @@ test("css(String|Hash)", function() {
equals
(
jQuery
(
'#empty'
).
css
(
'opacity'
),
'0'
,
"Assert opacity is accessible via filter property set in stylesheet in IE"
);
equals
(
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'
});
equals
(
jQuery
(
'#empty'
).
css
(
'opacity'
),
'1'
,
"Assert opacity is taken from style attribute when set vs stylesheet in IE with filters"
);
equals
(
jQuery
(
'#empty'
).
css
(
'opacity'
),
'1'
,
"Assert opacity is taken from style attribute when set vs stylesheet in IE with filters"
);
var
div
=
jQuery
(
'#nothiddendiv'
),
child
=
jQuery
(
'#nothiddendivchild'
);
equals
(
parseInt
(
div
.
css
(
"fontSize"
)),
16
,
"Verify fontSize px set."
);
equals
(
parseInt
(
child
.
css
(
"fontSize"
)),
16
,
"Verify fontSize px set."
);
child
.
attr
(
"class"
,
"em"
);
equals
(
parseInt
(
child
.
css
(
"fontSize"
)),
32
,
"Verify fontSize em set."
);
child
.
attr
(
"class"
,
"prct"
);
equals
(
parseInt
(
child
.
css
(
"fontSize"
)),
24
,
"Verify fontSize % set."
);
});
});
test
(
"css(String, Object)"
,
function
()
{
test
(
"css(String, Object)"
,
function
()
{
...
...
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