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
d16fe84d
Commit
d16fe84d
authored
Sep 17, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No ticket: Improve line-height animation test stability
parent
ff156d77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
23 deletions
+31
-23
effects.js
test/unit/effects.js
+31
-23
No files found.
test/unit/effects.js
View file @
d16fe84d
...
@@ -1450,7 +1450,8 @@ test("Do not append px to 'fill-opacity' #9548", 1, function() {
...
@@ -1450,7 +1450,8 @@ test("Do not append px to 'fill-opacity' #9548", 1, function() {
});
});
asyncTest
(
"line-height animates correctly (#13855)"
,
12
,
function
()
{
asyncTest
(
"line-height animates correctly (#13855)"
,
12
,
function
()
{
var
longDuration
=
2000
,
var
t0
,
longDuration
=
2000
,
shortDuration
=
500
,
shortDuration
=
500
,
animated
=
jQuery
(
animated
=
jQuery
(
"<p style='line-height: 100;'>unitless</p>"
+
"<p style='line-height: 100;'>unitless</p>"
+
...
@@ -1461,26 +1462,14 @@ asyncTest("line-height animates correctly (#13855)", 12, function() {
...
@@ -1461,26 +1462,14 @@ asyncTest("line-height animates correctly (#13855)", 12, function() {
initialHeight
=
jQuery
.
map
(
animated
,
function
(
el
)
{
initialHeight
=
jQuery
.
map
(
animated
,
function
(
el
)
{
return
jQuery
(
el
).
height
();
return
jQuery
(
el
).
height
();
}),
}),
tolerance
=
1.5
,
tolerance
=
1.5
;
t0
=
+
(
new
Date
());
animated
.
animate
(
{
"line-height"
:
"hide"
},
longDuration
);
// Delay start to improve test stability
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
progress
=
(
(
new
Date
())
-
t0
)
/
longDuration
;
animated
.
each
(
function
(
i
)
{
var
label
=
jQuery
.
text
(
this
),
initial
=
initialHeight
[
i
],
height
=
jQuery
(
this
).
height
(),
lower
=
initial
*
(
1
-
progress
)
/
tolerance
;
ok
(
height
<
initial
,
"hide "
+
label
+
": upper bound; "
+
height
+
" < "
+
initial
+
" @ "
+
(
progress
*
100
)
+
"%"
);
ok
(
height
>
lower
,
"hide "
+
label
+
": lower bound; "
+
height
+
" > "
+
lower
+
" @ "
+
(
progress
*
100
)
+
"%"
);
});
t0
=
+
(
new
Date
());
t0
=
+
(
new
Date
());
animated
.
stop
(
true
,
true
).
hide
().
animate
(
{
"line-height"
:
"show"
},
longDuration
);
animated
.
animate
(
{
"line-height"
:
"hide"
},
longDuration
,
"linear"
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
progress
=
(
(
new
Date
())
-
t0
)
/
longDuration
;
var
progress
=
(
(
new
Date
())
-
t0
)
/
longDuration
;
...
@@ -1488,15 +1477,34 @@ asyncTest("line-height animates correctly (#13855)", 12, function() {
...
@@ -1488,15 +1477,34 @@ asyncTest("line-height animates correctly (#13855)", 12, function() {
var
label
=
jQuery
.
text
(
this
),
var
label
=
jQuery
.
text
(
this
),
initial
=
initialHeight
[
i
],
initial
=
initialHeight
[
i
],
height
=
jQuery
(
this
).
height
(),
height
=
jQuery
(
this
).
height
(),
upper
=
initial
*
progress
*
tolerance
;
lower
=
initial
*
(
1
-
progress
)
/
tolerance
;
ok
(
height
<
upper
,
"show "
+
label
+
": upper bound; "
+
ok
(
height
<
initial
,
"hide "
+
label
+
": upper bound; "
+
height
+
" < "
+
upper
+
" @ "
+
(
progress
*
100
)
+
"%"
);
height
+
" < "
+
initial
+
" @ "
+
(
progress
*
100
)
+
"%"
);
ok
(
height
>
lower
,
"hide "
+
label
+
": lower bound; "
+
height
+
" > "
+
lower
+
" @ "
+
(
progress
*
100
)
+
"%"
);
});
});
animated
.
stop
(
true
,
true
);
t0
=
+
(
new
Date
());
start
();
animated
.
stop
(
true
,
true
).
hide
()
.
animate
(
{
"line-height"
:
"show"
},
longDuration
,
"linear"
);
setTimeout
(
function
()
{
var
progress
=
(
(
new
Date
())
-
t0
)
/
longDuration
;
animated
.
each
(
function
(
i
)
{
var
label
=
jQuery
.
text
(
this
),
initial
=
initialHeight
[
i
],
height
=
jQuery
(
this
).
height
(),
upper
=
initial
*
progress
*
tolerance
;
ok
(
height
<
upper
,
"show "
+
label
+
": upper bound; "
+
height
+
" < "
+
upper
+
" @ "
+
(
progress
*
100
)
+
"%"
);
});
animated
.
stop
(
true
,
true
);
start
();
},
shortDuration
);
},
shortDuration
);
},
shortDuration
);
},
shortDuration
);
},
50
);
});
});
// Start 1.8 Animation tests
// Start 1.8 Animation tests
...
...
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