using width or height = auto, takes about 100x longer than IE to compute the height or width

RESOLVED EXPIRED

Status

()

Core
DOM
RESOLVED EXPIRED
14 years ago
12 years ago

People

(Reporter: No one public, Unassigned)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

This shows up if you use getContentHeight or getContentWidth in the dynapi3x
package dynapi.sourceforge.net
These calls invoke the following code
doc.width = auto
or doc.height = auto
then try 
to get
doc.offsetWidth or doc.offsetHeight


Reproducible: Always

Steps to Reproduce:
1.
2.
3.
What exact code does this package run for Mozilla?  Is it the same code as runs
for IE?

A small self-contained testcase showing the problem would be very helpful...
(Reporter)

Comment 2

14 years ago
In my application, the div contents are 70% a line of text with less
than 40 characters, or a SELECT component.

As far as I can tell at the moment, elm = css = the dom object for the
DIV.

At the current time I don't know how to build a test case that doesn't
use the library.

dynapi.sourceforge.net is where the library comes from.

Basically I am making 'div's, computing the size of the after the
content has been added, then placing them on the page so that they
line up in a manner my app needs [simple layout manager].



Under mozilla

p.getContentWidth=function() {
	if (this.elm==null) return 0;
	else {
		var p = this.parent;		
		var tw = this.elm.style.width;
		this.css.width = "auto";		
		var w = this.elm.offsetWidth;
		this.css.width = tw;
		return w;
	};
};
p.getContentHeight=function() {
	if (this.elm==null) return 0;
	else {
		var th = this.css.height;
		this.elm.style.height = "auto";
		var h = this.elm.offsetHeight;
		this.css.height = th;
		return h;
	}
};

---

ie:

p.getContentWidth=function() {
	if (this.elm==null) return 0;
	else {
		var w,tw = this.css.width;
		this.css.width='auto'; // force ie to get width
		if (dynapi.ua.platform=="mac") w = this.elm.offsetWidth;
		else w = parseInt(this.elm.scrollWidth);
		this.css.width=tw;
		return w;
	};
};
p.getContentHeight=function() {
	if (this.elm==null) return 0;
	else {
		if (dynapi.ua.platform=="mac") return this.elm.offsetHeight;
		return parseInt(this.elm.scrollHeight);
		
	}
};
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.