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
c80bc227
Commit
c80bc227
authored
Jun 07, 2012
by
Mike Sherov
Committed by
Rick Waldron
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't swap to measure dimensions unless the element is display:none. #807 Fixes #11293
parent
79af1b45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
css.js
src/css.js
+1
-1
dimensions.js
test/unit/dimensions.js
+10
-0
No files found.
src/css.js
View file @
c80bc227
...
@@ -480,7 +480,7 @@ jQuery.each([ "height", "width" ], function( i, name ) {
...
@@ -480,7 +480,7 @@ jQuery.each([ "height", "width" ], function( i, name ) {
jQuery
.
cssHooks
[
name
]
=
{
jQuery
.
cssHooks
[
name
]
=
{
get
:
function
(
elem
,
computed
,
extra
)
{
get
:
function
(
elem
,
computed
,
extra
)
{
if
(
computed
)
{
if
(
computed
)
{
if
(
elem
.
offsetWidth
!==
0
)
{
if
(
elem
.
offsetWidth
!==
0
||
curCSS
(
elem
,
"display"
)
!==
"none"
)
{
return
getWidthOrHeight
(
elem
,
name
,
extra
);
return
getWidthOrHeight
(
elem
,
name
,
extra
);
}
else
{
}
else
{
return
jQuery
.
swap
(
elem
,
cssShow
,
function
()
{
return
jQuery
.
swap
(
elem
,
cssShow
,
function
()
{
...
...
test/unit/dimensions.js
View file @
c80bc227
...
@@ -299,6 +299,16 @@ test("outerWidth(true) returning % instead of px in Webkit, see #10639", functio
...
@@ -299,6 +299,16 @@ test("outerWidth(true) returning % instead of px in Webkit, see #10639", functio
equal
(
el
.
outerWidth
(
true
),
400
,
"outerWidth(true) and css('margin') returning % instead of px in Webkit, see #10639"
);
equal
(
el
.
outerWidth
(
true
),
400
,
"outerWidth(true) and css('margin') returning % instead of px in Webkit, see #10639"
);
});
});
test
(
"getting dimensions of zero width/height table elements shouldn't alter dimensions"
,
function
()
{
expect
(
1
);
var
table
=
jQuery
(
"<table><tbody><tr><td></td><td>a</td></tr><tr><td></td><td>a</td></tr></tbody></table>"
).
appendTo
(
"#qunit-fixture"
),
elem
=
table
.
find
(
"tr:eq(0) td:eq(0)"
);
table
.
find
(
"td"
).
css
({
margin
:
0
,
padding
:
0
});
equal
(
elem
.
width
(),
elem
.
width
(),
"width() doesn't alter dimension values"
);
});
test
(
"box-sizing:border-box child of a hidden elem (or unconnected node) has accurate inner/outer/Width()/Height() see #10413"
,
function
()
{
test
(
"box-sizing:border-box child of a hidden elem (or unconnected node) has accurate inner/outer/Width()/Height() see #10413"
,
function
()
{
expect
(
16
);
expect
(
16
);
...
...
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