Closed Bug 198999 Opened 21 years ago Closed 21 years ago

Height-0 div has zero offsetWidth

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 186516

People

(Reporter: boris, Unassigned)

References

()

Details

(Keywords: hang)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

mozilla crashes when i try to display an absolute positioned table in a iframe.
It is only a quirck to display the element correctly on IE5/macOS9. In mozilla
its fine without the style-attribute.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.



Expected Results:  
I think Mozilla shouldn't crash. I think i try a workaround for the
IE5/MacOS9-Problem

There are no messages at all.
I'm seeing a hang and not a crash on this page in OS X/2003032003. hang also
didn't seem to happen until my cursor goes into the element at the top of the
testcase (although that may have just been coincidence).

Reporter, is mozilla haning or crashing outright, and if its crashing do you
have a talkback id (if you're running a talkback enabled build) or crash log?
My Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030324
consumes +/- 99% CPU when visiting the url above
It's right Mozilla don't crash but hangs.
confirming -> All/All
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: hang
OS: Windows 2000 → All
Hardware: PC → All
Summary: mozilla crashes when i try to display an absolute positioned table in a iframe → mozilla hangs when i try to display an absolute positioned table in a iframe
The iframe has nothing to do with this.  Nor does positioning.  The script in
the iframe is doing the following:

function init(n_2measure) {
        var b_fl = true, e_frm, k = 0, i;
        if (n_2measure != null)
                items[n_2measure].height = vertical ? main.offsetHeight :
main.offsetWidt\
h;
        for (i = n_num - 1; i >= 0; i--) if (!items[i].height) {
                if (items[i].content)   {
                        main.innerHTML = items[i].content;
                        setTimeout("init(" + i + ")", 100)
                }
                else if (items[i].file) {
                        e_frm = window.frames[k++];
                        if (e_frm.document.body) items[i].content =
e_frm.document.body.i\
nnerHTML
                }
                b_fl = false;
        }
        if (!b_fl) setTimeout("init()", 100)
        else if (auto) move(0)
}

Now all the items[i].content strings (there's only one uncommented one) consist
of absolutely positioned tables.  Which means it's not going to affect the width
or height of its parent ('main', in this case).  Which hence ends up with a
height of 0 and an offsetWidth of 0.

Which is the real bug, if a bug it is -- what is the offsetWidth of a height-0
div in IE?

Oh, the hang happens because of the exponentially large number of timeouts and
innerHTML munging that happens -- each timeout spawns two more.



Assignee: frame → dom_bugs
Component: Layout: HTML Frames → DOM Mozilla Extensions
QA Contact: madhur → ian
Summary: mozilla hangs when i try to display an absolute positioned table in a iframe → Height-0 div has zero offsetWidth
Attached file testcase
Since the only remaining issue is the offsetWidth of an element with zero height:

*** This bug has been marked as a duplicate of 186516 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: