mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #12159 - notriddle:fix_interpolate_cleanup_regression, r=emilio
Do not crash on partial calc interpolation It should always be possible to interpolate between CalcLengthOrPercentage points. ____ - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12151 (github issue number if applicable). - [ ] There are tests for these changes (*I STILL NEED TO WRITE TESTS*) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12159) <!-- Reviewable:end -->
This commit is contained in:
commit
ed514d7934
4 changed files with 48 additions and 2 deletions
|
@ -324,8 +324,8 @@ impl Interpolate for CalcLengthOrPercentage {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn interpolate(&self, other: &Self, time: f64) -> Result<Self, ()> {
|
fn interpolate(&self, other: &Self, time: f64) -> Result<Self, ()> {
|
||||||
Ok(CalcLengthOrPercentage {
|
Ok(CalcLengthOrPercentage {
|
||||||
length: try!(self.length.interpolate(&other.length, time)),
|
length: self.length.interpolate(&other.length, time).ok().and_then(|x|x),
|
||||||
percentage: try!(self.percentage.interpolate(&other.percentage, time)),
|
percentage: self.percentage.interpolate(&other.percentage, time).ok().and_then(|x|x),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5320,6 +5320,18 @@
|
||||||
"url": "/_mozilla/css/transition_calc.html"
|
"url": "/_mozilla/css/transition_calc.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"css/transition_calc_implicit.html": [
|
||||||
|
{
|
||||||
|
"path": "css/transition_calc_implicit.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/transition_calc_implicit_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/transition_calc_implicit.html"
|
||||||
|
}
|
||||||
|
],
|
||||||
"css/translate_clip.html": [
|
"css/translate_clip.html": [
|
||||||
{
|
{
|
||||||
"path": "css/translate_clip.html",
|
"path": "css/translate_clip.html",
|
||||||
|
@ -12440,6 +12452,18 @@
|
||||||
"url": "/_mozilla/css/transition_calc.html"
|
"url": "/_mozilla/css/transition_calc.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"css/transition_calc_implicit.html": [
|
||||||
|
{
|
||||||
|
"path": "css/transition_calc_implicit.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/transition_calc_implicit_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/_mozilla/css/transition_calc_implicit.html"
|
||||||
|
}
|
||||||
|
],
|
||||||
"css/translate_clip.html": [
|
"css/translate_clip.html": [
|
||||||
{
|
{
|
||||||
"path": "css/translate_clip.html",
|
"path": "css/translate_clip.html",
|
||||||
|
|
21
tests/wpt/mozilla/tests/css/transition_calc_implicit.html
Normal file
21
tests/wpt/mozilla/tests/css/transition_calc_implicit.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel='match' href='transition_calc_implicit_ref.html'>
|
||||||
|
<style>
|
||||||
|
#inner {
|
||||||
|
transition: transform 0.01s;
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
transform: translate(1%, 1%);
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
transform: translate(0px, 1px) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id=inner></div>
|
||||||
|
<script>
|
||||||
|
requestAnimationFrame(function() {
|
||||||
|
var inner = document.getElementById('inner');
|
||||||
|
inner.className = 'active';
|
||||||
|
requestAnimationFrame(function() {});
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -0,0 +1 @@
|
||||||
|
<!DOCTYPE html>
|
Loading…
Add table
Add a link
Reference in a new issue