зеркало из https://github.com/mozilla/pjs.git
Bug 556841: In paced-calcMode SMIL animation, don't bother computing distance in trivial 2-values case. r=roc
This commit is contained in:
Родитель
634b5fdcf4
Коммит
b92b5b0edf
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
class="reftest-wait"
|
||||
onload="go()">
|
||||
<script>
|
||||
function go() {
|
||||
// setCurrentTime to force a sample
|
||||
document.documentElement.setCurrentTime(2);
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
<rect fill="teal" x="50" y="50" width="20" height="20">
|
||||
<animateTransform attributeName="transform" type="rotate" by="30"
|
||||
calcMode="paced" dur="4s"/>
|
||||
</rect>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 501 B |
|
@ -9,3 +9,4 @@ load 529387-1.xhtml
|
|||
load 537157-1.svg
|
||||
load 547333-1.svg
|
||||
load 548899-1.svg
|
||||
load 556841-1.svg
|
||||
|
|
|
@ -522,6 +522,17 @@ nsSMILAnimationFunction::ComputePacedPosition(const nsSMILValueArray& aValues,
|
|||
"aSimpleProgress is out of bounds");
|
||||
NS_ASSERTION(GetCalcMode() == CALC_PACED,
|
||||
"Calling paced-specific function, but not in paced mode");
|
||||
NS_ABORT_IF_FALSE(aValues.Length() >= 2, "Unexpected number of values");
|
||||
|
||||
// Trivial case: If we have just 2 values, then there's only one interval
|
||||
// for us to traverse, and our progress across that interval is the exact
|
||||
// same as our overall progress.
|
||||
if (aValues.Length() == 2) {
|
||||
aIntervalProgress = aSimpleProgress;
|
||||
aFrom = &aValues[0];
|
||||
aTo = &aValues[1];
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
double totalDistance = ComputePacedTotalDistance(aValues);
|
||||
if (totalDistance == COMPUTE_DISTANCE_ERROR)
|
||||
|
|
Загрузка…
Ссылка в новой задаче