Closed Bug 286127 Opened 20 years ago Closed 20 years ago

Block element inherits parent elements' clientWidth although its content is larger than the parent elements clientWidth

Categories

(SeaMonkey :: General, defect)

1.7 Branch
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: carstenklein, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217


Setting up a document as such:

...
<body>
<div style="position:absolute;">
<table>
...
</table>
</div>
</body>
...


yields a clientWidth of for example 540(px) iff the document is being displayed
in an embedded frame (iframe) that is 540px wide.

Now, outputting the clientWidth of the div element in the above document yields
540px which is true for a block level element with a content width less than or
equal to the parent element of the div, i.e. the body element.

Having set up a table that has a width that is larger than 540px, for example
1024px yields that the div still has a clientWidth of 540px regardless of its
content width.



Reproducible: Always

Steps to Reproduce:
1.see above
2.
3.

Actual Results:  
the div is 540 pixels wide, it should be as wide as its content dictates.

Expected Results:  
the div should have the width of the table plus additional padding and margins
defined by its content widths.
I forgot to mention that this also applies to the clientHeight.
Forget the last comment, I was sort of out-of-my-mind, so to say.
It does not apply to clientHeight, actually ;-)
Version: unspecified → 1.7 Branch
The clientWidth is the width of the div (put borders on it to see how wide it
is). The contents of the div are wider than the div, but that doesn't change the
clientWidth...

Note that in IE, the div gets wider if its contents are "too wide", which is a
violation of the CSS specification.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.