Closed Bug 472244 Opened 16 years ago Closed 16 years ago

Reftest layout/reftests/reftest-sanity/zoom-invalidation.html fails on Tinderbox

Categories

(Testing :: Reftest, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.2

People

(Reporter: roc, Assigned: roc)

References

Details

Attachments

(1 file)

... and now it fails on my machine too. Weird. Actually I think it's random, which is bad, since MozReftestInvalidate was supposed to make it not random.
OK, I found and fixed the randomness. The problem is that after load has fired, even though we flush reflows and invalidates and repaints there could still be a pending MozAfterPaint event with the full window dimensions in it. That will cause reftest to repaint the entire canvas, so we have to delay firing MozReftestInvalidate until after that MozAfterPaint has been received.

Now to fix the actual zoom-invalidate.html test ...
OK, I had this code to round the repaint rectangle edges to "device pixels":

        var left = Math.floor(roundTo(r.left*scale, 0.001))/scale;
        var top = Math.floor(roundTo(r.top*scale, 0.001))/scale;
        var right = Math.ceil(roundTo(r.right*scale, 0.001))/scale;
        var bottom = Math.ceil(roundTo(r.bottom*scale, 0.001))/scale;

Problem is, drawWindow takes integer parameters (in CSS pixels) so this code goes all wrong as XPConnect rounds values. I need to think about what we can do here. Maybe drawWindow's parameters need to be floats...
Attached patch fixSplinter Review
Okay, this patch has two parts. The main part is to delay attaching our MozAfterPaint listener and firing MozReftestInvalidate until after any MozAfterPaint triggered by load-event activity has been flushed. The other part is to make the parameters to drawWindow floats; this lets us draw at "device pixel" boundaries even when those don't align with CSS pixel boundaries in the zoomed content.
Attachment #355555 - Flags: review?(dbaron)
Comment on attachment 355555 [details] [diff] [review]
fix

Need vlad's review on the drawWindow change.
Attachment #355555 - Flags: review?(vladimir)
Comment on attachment 355555 [details] [diff] [review]
fix

r=dbaron, although it might be clearer to name that function rather than having a 15 line anonymous function inside a function call
Attachment #355555 - Flags: review?(dbaron) → review+
Comment on attachment 355555 [details] [diff] [review]
fix

Hey, this'll help mobile as well when doing its zoom stuff.  Though, why floats and not doubles?  Cairo and gfx math is going to be all in doubles.
Because all the other canvas APIs are float
Pushed 670a3b50dfe0
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
This bug won't land on m-1.9.1, right?
Target Milestone: --- → mozilla1.9.2
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: