ext Boris Zbarsky wrote:

Antônio Gomes wrote:

Might I ask why you're not just using naturalWidth and naturalHeight (on nsIDOMNSHTMLImageElement)?


Two reasons:

1) Such access to the DOM style is much slower (4 times at least) than using the imgContainer (measuring the time manually).

I'm not talking about style. I'm talking about naturalWidth and naturalHeight. They have nothing to do with style.

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

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's why I searched for an alternative way for changing image size and I ended up at the imgl* interfaces.

What do you mean by "its DOM value :s"?

I meant length (height || width)

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 :))

I realize you're zooming images. What I don't understand is whether you're zooming from the intrinsic size or the current size.

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

Your code looks like the code for zooming from intrinsic size, but then you're complaining that it's zooming from intrinsic size...

That's because I haven't seen that imgl* work with intrinsic size.

Is there another way ?

To do what? Once you explain what you're doing, we can tell you how you can do it.

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.

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.


What do you suggest ?

--Antonio Gomes

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

Reply via email to