If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[FLOAT] floating image and nowrap causes table to overflow

RESOLVED FIXED in mozilla0.8



Layout: Tables
17 years ago
13 years ago


(Reporter: Claude Gohier, Assigned: karnaze (gone))


({compat, testcase, top100})

Windows NT
compat, testcase, top100

Firefox Tracking Flags

(Not tracked)




(5 attachments)



17 years ago
part of the text "Add to my yahoo!" is outside the cell.

I will attach a small testcase.

Comment 1

17 years ago
Created attachment 17881 [details]
Testcase for layout problem

Comment 2

17 years ago
I'll attach a new test case where there is a quick fix (removing the width or
nowrap) that fixes the problem.

There is bad html code here.  The image and text part that goes outside the cell
are from a nested table with the parent cell of 1% width.

I suggest evangelism because it is bad code that is causing the problem.

Comment 3

17 years ago
Created attachment 17900 [details]
test case - poor structure causing the problem

Comment 4

17 years ago
Changing Component to Evangelism because of previous comments and because it's
Yahoo! and noticable on every yahoo! news page.

Again this is caused by bad markup.
Assignee: karnaze → blakeross
Component: HTMLTables → Evangelism
Ever confirmed: true
QA Contact: chrisd → zach

Comment 5

17 years ago
Moving back to HTML Tables.

Changing summary. Old summary: "Layout problem on yahoo! Tech news".

The problem here is that mozilla renders the content outside the parent table
because of the width for parent table is 1%. The space required by the content
is greater than 1%.  Removing the width and/or nowrap fixes the layout problem.

Thanks buster!
Assignee: blakeross → karnaze
Component: Evangelism → HTMLTables
Keywords: testcase
QA Contact: zach → chrisd
Summary: Layout problem on yahoo! Tech news → nested table overflows parent table because of smaller width

Comment 6

17 years ago
*** Bug 59384 has been marked as a duplicate of this bug. ***

Comment 7

17 years ago
This is frequently used by developers. The method of specifying a cell width 
smaller than the content is frequently used by developers to get a browser to 
collapse a cell around the content, or to get the cell to expand just large 
enough to hold the content, depending on how you look at it.

Adding compat keyword.
Keywords: compat

Comment 8

17 years ago
Created attachment 20473 [details]
Testcase without nested table

Comment 9

17 years ago
Adding correctness.
Keywords: correctness

Comment 10

17 years ago
Adding keywords: 4xp, top100 from duplicate bug.

As the testcase I just attached shows this has nothing to do with nested tables.
(The problem only showed itself in a nested table because noone uses width=1 or
width=1% on the <table> tag, and if you do so on <td> it overrides "nowrap")

The problem is that the width of floated images is not calculated into the
minimum desired with of the block (the table cell in this case), because
normally if the content cannot fit because of the floating image, line boxes
can be skipped until content can be resumed below the image.
This is not the case with "nowrap" where no linebox is skipped because nowrap.

It looks like the solution is:
  Calculate the width of floats into the width of a block when nowrap is used.

Changing summary from:
  "nested table overflows parent table because of smaller width"
  "[FLOAT] floating image and nowrap causes table to overflow"

Exiting because mozilla is dying...
Keywords: correctness → 4xp, top100
Summary: nested table overflows parent table because of smaller width → [FLOAT] floating image and nowrap causes table to overflow

Comment 11

17 years ago
Fixing mid air collision
Keywords: correctness

Comment 12

17 years ago
Marking mozilla0.8
Target Milestone: --- → mozilla0.8

Comment 13

17 years ago
Created attachment 21618 [details] [diff] [review]
patch to fix the bug

Comment 14

17 years ago
Created attachment 22022 [details] [diff] [review]
better patch, using the style system

Comment 15

17 years ago
r=rods as long as maxElementWidth cannot be greater than stylewidth (when 

Comment 16

17 years ago
much better.  sr=buster

Comment 17

17 years ago
The patch has been checked in.
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 18

17 years ago
*** Bug 60354 has been marked as a duplicate of this bug. ***

Comment 19

17 years ago
I am not sure whether the patch is really good, in my opinion this patch should
not rise the cell size for fixed table layout.

Comment 20

17 years ago
I think it has regressed. Probably due to the fix of bug 56201.

Comment 21

17 years ago
QA contact update
QA Contact: chrisd → amar
There are comments above saying this has regressed, but it seems OK to me in a
current build.  What regressed?

Comment 23

16 years ago
Mass removing self from CC list.

Comment 24

16 years ago
Now I feel sumb because I have to add back. Sorry for the spam.

Comment 25

13 years ago
(Adding self to CC list; changing URL from
which is stale, to
which tests for regression just fine)

In Mozilla 1.7.1, the testcase displays incorrectly.  I guess this
regressed.  Tomorrow morning I will check the latest nightly to see
whether the regression has been silently fixed since then.
You need to log in before you can comment on or make changes to this bug.