Tuesday, October 14th, 2008
MozAfterPaint: Being able to get a callback event on repaint
John Resig put together a nice usage of MozAfterPaint, the new Firefox event that will call back letting you know when a repaint operation has happened:
The event object contains two properties: .clientRects and .boundingClientRect, both of which refer to the result of the associated DOM methods.
In a nutshell, boundingClientRect gives you a single rectangle encompassing the entire area in which a paint operation could’ve taken place whereas clientRects gives you a number of rectangles, each encompassing an individual area that was drawn.
To test this I created a quick demo using CNN.com (only works in the latest Firefox nightlies).

John creating a simple tracking script that uses the new event to show where you have been.
kourge reminded us of the related Flash event showRedrawRegions.
Robert O’Callahan mentioned a use for the event when he discussed SVG bling that made it into the first 3.1 beta.
David Hyatt put in a WebKit patch to add support for CSS transitions on some SVG properties.












This could be cool for performance testing, ie., literally highlighting how JS may cause larger reflow operations than you might intend and perhaps helping find more optimal ways to update the DOM.
I think the flash player’s context menu includes “show redraw regions” as one of the items, which is neat.
Can’t you basically do this with the DOMSubtreeModified event? Am I misunderstanding or is this just sugar around that event?
.
Incidentally, I’d love to be able to get an event specifically when an element’s dimensions change. Does anyone know of anything like that?
Perhaps this (untested)?
http://msdn.microsoft.com/en-us/library/ms536959(VS.85).aspx
@TNO: Unfortunately, only IE supports onresize firing for element dimension changes; all other browsers only fire onresize when the window changes dimensions, regardless of where the event is attached.
After a little more research, perhaps onpropertychange for IE, and addEvent(”DOMAttrModified”…..) for the rest
I’ve been using DOMSubtreeModified and comparing dimensions to a cache, but this performs badly. (It does perform better with the check against a cache than without, to be clear.) :(
For me it doesnt really work well, but sildenafil from india
surely does.
Abercrombie And Fitch Abercrombie And Fitch Abercrombie And Fitch
Fix it Fix it Fix it
Columbia Sportswear Columbia Sportswear Columbia Sportswear
Pandora Jewelry Pandora Jewelry Pandora Jewelry
wedding dresses Wedding Dresses wedding dresses
Fitch store in general Abercrombie And Fitch , everything a good matrimony before marriage have nothing to retain the preceding “female mad batch -Abercrombie” part of the two is the first home in new york city a horde promotion sportswear for men and it is a successful lawyer, that is, fitch.Ezra fitch in a charge over a very intricate to read from the abercrombie is obstinate to read and long abercrombie & fitch. He’s also very good brandAbercrombie Clothing, including Abercrombie Sale and Abercrombie And Fitch Clothing, Abercrombie and Fitch Hoodies, Abercrombie and Fitch Jeans. Has become a fashionable personage’s first choice,Abercrombie and Fitch Pants is all over the world, of course, is also expected toAbercrombie and Fitch Tees.
New Year was coming, everyone wants new clothes to disguise themselves,Abercrombie and Fitch Shorts is a good choice. BecauseAbercrombie and Fitch Sweaters is a well-known brand,Abercrombie and Fitch Outerweareverywhere, abercrombie is very much a Cheap Abercrombie. There has Abercrombie and Fitch Polos, Abercrombie Womens andAbercrombie and Fitch Shirt. Personally, I’m looking forward to Abercrombie Hollister’s 2009 New Arrivals, such as Abercrombie Ruehl No.925 like this style.
Fitch store in general Abercrombie And Fitch , everything a good matrimony before marriage have nothing to retain the preceding “female mad batch -Abercrombie” part of the two is the first home in new york city a horde promotion sportswear for men and it is a successful lawyer, that is, fitch.Ezra fitch in a charge over a very intricate to read from the abercrombie is obstinate to read and long abercrombie & fitch. He’s also very good brandAbercrombie Clothing, including Abercrombie Sale and Abercrombie And Fitch Clothing, Abercrombie and Fitch Hoodies,Abercrombie and Fitch Jeans. Has become a fashionable personage’s first choice,Abercrombie and Fitch Pants is all over the world, of course, is also expected toAbercrombie and Fitch Tees.
New Year was coming, everyone wants new clothes to disguise themselves,Abercrombie and Fitch Shorts is a good choice. BecauseAbercrombie and Fitch Sweatersis a well-known brand,Abercrombie and Fitch Outerwear everywhere, abercrombie is very much a Cheap Abercrombie. There has Abercrombie and Fitch Polos, Abercrombie Womens andAbercrombie and Fitch Shirt. Personally, I’m looking forward to Abercrombie Hollister’s 2009 New Arrivals, such as Abercrombie Ruehl No.925 like this style.
Lace Wigs
Wedding Dresses
ugg boots
ED Hardy Hoodies ED Hardy Hoodies
Ed Hardy Swimwear Ed Hardy Swimwear
ed hardy tops ed hardy tops
ed hardy shoes ed hardy shoes
ed hardy t shirt ed hardy t shirt
ed hardy shirts ed hardy shirts
christian audigier christian audigier
ed hardy kids ed hardy kids
Ed Hardy Sunglasses Ed Hardy Sunglasses
ED Hardy belts ED Hardy belts
ed hardy Bags ed hardy Bags
ed hardy purse ed hardy purse
ed hardy mens ed hardy mens
ed hardy womens d hardy womens
ed hardy mens shirts ed hardy mens shirts
ed hardy mens tops ed hardy mens tops
ed hardy mens hoodies d hardy mens hoodies
ed hardy mens swim trunks ed hardy mens swim trunks
ed hardy mens shoes ed hardy mens shoes
ed hardy womens swimwear ed hardy womens swimwear
ed hardy womens t shirt ed hardy womens t shirt
ed hardy womens tops ed hardy womens tops
ed hardy womens pants ed hardy womens pants
ed hardy womens hoodies ed hardy womens hoodies
ed hardy womens shoes ed hardy womens shoes
ed hardy womens clothing ed hardy womens clothing