-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port offset-*-interpolation-*.html to wpt
Most of these has corresponding tests in wpt/ already, this CL adds some additional test cases that is not covered in wpt/. Bug: 900581 Change-Id: I534b55582814b31cc0e3368afcf69eeefb45e661 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1763250 Commit-Queue: Xida Chen <[email protected]> Reviewed-by: Stephen McGruer <[email protected]> Cr-Commit-Position: refs/heads/master@{#689917}
- Loading branch information
1 parent
863ab8e
commit 00832c4
Showing
5 changed files
with
456 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-shorthand"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/css/support/interpolation-testcommon.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
test_interpolation({ | ||
property: 'offset', | ||
from: 'path("M0 200H 700") 500px 800deg', | ||
to: 'path("M0 300H 700 Z") 600px 900deg', | ||
method: 'CSS Transitions', | ||
}, [ | ||
{at: -0.3, expect: 'path("M0 300H 700 Z") 470px 770deg'}, | ||
{at: 0, expect: 'path("M0 300H 700 Z") 500px 800deg'}, | ||
{at: 0.3, expect: 'path("M0 300H 700 Z") 530px 830deg'}, | ||
{at: 0.6, expect: 'path("M0 300H 700 Z") 560px 860deg'}, | ||
{at: 1, expect: 'path("M0 300H 700 Z") 600px 900deg'}, | ||
{at: 1.5, expect: 'path("M0 300H 700 Z") 650px 950deg'}, | ||
]); | ||
|
||
test_interpolation({ | ||
property: 'offset', | ||
from: 'path("M0 0H 200") 500px auto', | ||
to: 'path("M0 0H 300") 600px 0deg', | ||
method: 'CSS Transitions', | ||
}, [ | ||
{at: -0.3, expect: 'path("M0 0H 170") 470px 0deg'}, | ||
{at: 0, expect: 'path("M0 0H 200") 500px 0deg'}, | ||
{at: 0.3, expect: 'path("M0 0H 230") 530px 0deg'}, | ||
{at: 0.6, expect: 'path("M0 0H 260") 560px 0deg'}, | ||
{at: 1, expect: 'path("M0 0H 300") 600px 0deg'}, | ||
{at: 1.5, expect: 'path("M0 0H 350") 650px 0deg'}, | ||
]); | ||
|
||
test_interpolation({ | ||
property: 'offset', | ||
from: 'path("M0 200H 700") 500px 800deg', | ||
to: 'path("M0 300H 700 Z") 600px 900deg', | ||
method: 'CSS Animations', | ||
}, [ | ||
{at: -0.3, expect: 'path("M0 200H 700") 470px 770deg'}, | ||
{at: 0, expect: 'path("M0 200H 700") 500px 800deg'}, | ||
{at: 0.3, expect: 'path("M0 200H 700") 530px 830deg'}, | ||
{at: 0.6, expect: 'path("M0 300H 700 Z") 560px 860deg'}, | ||
{at: 1, expect: 'path("M0 300H 700 Z") 600px 900deg'}, | ||
{at: 1.5, expect: 'path("M0 300H 700 Z") 650px 950deg'}, | ||
]); | ||
|
||
test_interpolation({ | ||
property: 'offset', | ||
from: 'path("M0 0H 200") 500px auto', | ||
to: 'path("M0 0H 300") 600px 0deg', | ||
method: 'CSS Animations', | ||
}, [ | ||
{at: -0.3, expect: 'path("M0 0H 170") 470px auto'}, | ||
{at: 0, expect: 'path("M0 0H 200") 500px auto'}, | ||
{at: 0.3, expect: 'path("M0 0H 230") 530px auto'}, | ||
{at: 0.6, expect: 'path("M0 0H 260") 560px 0deg'}, | ||
{at: 1, expect: 'path("M0 0H 300") 600px 0deg'}, | ||
{at: 1.5, expect: 'path("M0 0H 350") 650px 0deg'}, | ||
]); | ||
|
||
test_interpolation({ | ||
property: 'offset', | ||
from: 'path("M0 200H 700") 500px 800deg', | ||
to: 'path("M0 300H 700 Z") 600px 900deg', | ||
method: 'Web Animations', | ||
}, [ | ||
{at: -0.3, expect: 'path("M0 200H 700") 470px 770deg'}, | ||
{at: 0, expect: 'path("M0 200H 700") 500px 800deg'}, | ||
{at: 0.3, expect: 'path("M0 200H 700") 530px 830deg'}, | ||
{at: 0.6, expect: 'path("M0 300H 700 Z") 560px 860deg'}, | ||
{at: 1, expect: 'path("M0 300H 700 Z") 600px 900deg'}, | ||
{at: 1.5, expect: 'path("M0 300H 700 Z") 650px 950deg'}, | ||
]); | ||
|
||
test_interpolation({ | ||
property: 'offset', | ||
from: 'path("M0 0V 200") 500px auto', | ||
to: 'path("M0 0H 300") 600px 0deg', | ||
method: 'Web Animations', | ||
}, [ | ||
{at: -0.3, expect: 'path("M0 0V 200") 470px auto'}, | ||
{at: 0, expect: 'path("M0 0V 200") 500px auto'}, | ||
{at: 0.3, expect: 'path("M0 0V 200") 530px auto'}, | ||
{at: 0.6, expect: 'path("M0 0H 300") 560px 0deg'}, | ||
{at: 1, expect: 'path("M0 0H 300") 600px 0deg'}, | ||
{at: 1.5, expect: 'path("M0 0H 300") 650px 0deg'}, | ||
]); | ||
|
||
// Regression test for crbug.com/994489 | ||
test_interpolation({ | ||
property: 'offset', | ||
from: 'path("M0 0H 200") 500px auto', | ||
to: 'path("M0 0H 300") 600px 0deg', | ||
}, [ | ||
{at: 3.40282e+038, expect: 'path("M0 0H 3.4e+38") 3.36e+07px 0deg'}, | ||
]); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.