Closed Bug 524808 Opened 10 years ago Closed 10 years ago

add support for animation of integer-valued properties (i.e., z-index)

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: dbaron, Assigned: dbaron)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
No description provided.
Attachment #408714 - Flags: review?(dholbert)
Comment on attachment 408714 [details] [diff] [review]
patch

>@@ -125,16 +125,22 @@ nsStyleAnimation::ComputeDistance(const 
>+      aDistance = PR_ABS(startInt - endInt);


Nit: You should probably reverse the order here -- i.e. change to |endInt - startInt| -- to match the surrounding code.


>@@ -429,16 +435,23 @@ nsStyleAnimation::AddWeighted(double aCo
>+    case eUnit_Integer: {
>+      aResultValue.SetIntValue(NS_floor(
>+          aCoeff1 * double(aValue1.GetIntValue()) +
>+          aCoeff2 * double(aValue2.GetIntValue())),
>+        eUnit_Integer);
>+      break;
>+    }

Are you sure NS_floor is the behavior you want?

So in a transition from 0 to 1, we effectively won't do any interpolation at all -- we'll stay at 0 for the entire duration of the transition (until aPortion == 1, when we snap up to 1).

I guess this behavior seems reasonable -- I just want to double-check that it's what you're going for.

r=dholbert with the subtraction-order-reversal nit.
http://hg.mozilla.org/mozilla-central/rev/dea8208d7b64
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Priority: -- → P2
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.