ext Boris Zbarsky wrote:
Ok, I'm trying to find out the "best/fast" way to zooming images. So
far, I've taken two paths:
1) getting the current size, applying the zooming scale, via
nsIDOM(NS)HTMLImageElement methods (set/get height/width).
it works, but slowly.
Ok... what does "slowly" mean? Compared to what?
In this case, comparing to opera :). I mean, around 10 seconds slower
using the 1st approach and 1 or 2 seconds slower using the 2nd one
(bellow) - I am zooming gmail (100 emails per page).
Also, what Gecko version is this, just so we're on the same page?
Hummm, it is dated from nov/05. Pretty old indeed. I am about to update
asap to 1.8 branch.
2) getting the "intrinsic" image size from imgContainer, applying the
zooming scale, and then setting via nsIDOMHTMLImageElement methods
(set height/width).
as you could see, I didn't know it would get me the immutable image
size.
Is this actually faster than the other approach??
Yep, it's like 65% faster than the former one. I got the intrinsic size
once, caching them (instead of getting it from the DOM GetHeight|Width)
and set them when it's needed. Is there any drawback from this, like
mis-synchronization between my cache and the DOM if this got changed
somehow| (or by something) beyond my zooming ?
--Antonio
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout