Antônio Gomes wrote:
Ok, I see. Are width and height from naturalWidth and naturalHeight also intrinsic as the ones from imgContainer ? Should I use these methods instead ?

Yes, those are intrinsic.  And yes, if you want intrinsic size you should use 
those.

I've seen these methods already, and this is exactly the point I want to get across: I understand the DOM Tree manipulation as the best way to change the content of any thing in a web page. But sometimes, accessing (hitting) the DOM Tree many times could make my app slower.

That shouldn't be happening.  If it is, please file bugs.  CC me on them.

That doesn't really answer my question. I can think of at least 5 different things you could mean here (computed style, specified style, HTML attribute, DOM property, boxObject properties). Which one are you talking about?

In this case, I meant html attribute (I guess :))

The HTML attribute is what you'd get with setAttribute() and getAttribute()... That is, the string actually attached to the <img> tag.

Ok, I'm intending to zoom from the current size.

.width and .height on nsIDOMHTMLImageElement will give you the current size.

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?

Also, what Gecko version is this, just so we're on the same page?

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??

-Boris
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to