Closed Bug 52242 Opened 24 years ago Closed 23 years ago

bottom margin dropped on floating IMG elements in tables [FLOAT]

Categories

(Core :: Layout: Tables, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: M.Hankus, Assigned: waterson)

References

(Blocks 1 open bug, )

Details

(Keywords: css1, testcase, Whiteboard: [Hixie-P3])

Attachments

(4 files)

Check above URL. There is an image located inside a table. Image has VSPACE attribute. It is renedered OK when there is no ALIGN attribute. But when you add ALIGN="left" bottom space of image is ignored (top is ok).
Confirmed in MacOS 9.0.4 2000-09-04-08, Win 98 2000-09-06-08, Linux 6.2 2000-09- 06-08. Updating status to NEW, and platform to ALL.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Hardware: PC → All
Also confirmed working in 4.x for Mac.
Dividing up Claytons bugs to triage
Assignee: clayton → kmcclusk
Confirmed that is still a problem with 12/13/2000 build on WINNT. The test case works fine in I.E 5.5. Reassigning to buster
Assignee: kmcclusk → buster
Reassigning QA Contact for all open and unverified bugs previously under Lorca's care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
qa contact updated.
QA Contact: gerardok → bsharma
SPAM. HTML Element component deprecated, changing component to Layout. See bug 88132 for details.
Component: HTML Element → Layout
Note that this works fine when *not* in a table-changing component. Reporter: vspace is deprecated, use CSS to position elements when possible.
Assignee: buster → karnaze
Component: Layout → HTMLTables
Keywords: testcase
QA Contact: bsharma → amar
table cell block problem with floating image. -->waterson.
Assignee: karnaze → waterson
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.6
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Target Milestone: mozilla0.9.7 → mozilla0.9.8
vspace is converted to top- and bottom-margin; you can see this problem when setting these values with CSS properties, as well.
cc'ing hixie before I make a fool of myself.
Blocks: float
Keywords: css1
Summary: VSPACE in IMG ignored when there is ALIGN attribute → bottom margin dropped on floating IMG elements in tables [FLOAT]
Whiteboard: [Hixie-P3]
Attachment #63569 - Attachment mime type: text/plain → text/html
I think this is because of the somewhat ad hoc way table cells deal with expanding to hold floats -- they use the overflow area, IIRC, which should really only be used for painting/event handling/'overflow' handling. We really need a better concept of a formatting context that contains floats. (Do we have the same problem for floats within floats?)
Here's an attempt at a test case. Both these look ``correct'' AFAICT in IE5.5 Mac; however, we bungle them pretty badly, and probably in ways that are not related to this specific bug. I'll file different bugs if none are on-file already. Hixie?
Oh yeah, expanding floats with 'height: auto' based on floats within them isn't in the spec yet. :-)
So I've investigated this a bit more, and I don't think that the problem is necessarily the use of the overflow area. This seems fairly reasonable to me, and we've got the frame's area and margins stored correctly in the floater cache, and transferred correctly to the space manager. So, if we could incorporate the space manager's state into the information we return to the table cell, that might solve the problem. Another way to deal with this would be to include the floater's bottom margin in the in-flow line's combined area. I don't fully understand the implications of doing this, but I tend to think that this would be an overly general way to handle a specific problem -- floats in table cells. Specifically, this might screw up 10.6.3. (I'm curious: would any of you CSS lawyers consider our handling of this case `correct' based on a literal interpretation of 10.6.3? Namely, ``Only children in the normal flow are taken into account''.) Anyway, still thinking about this. Comments welcome.
Attached patch stab in the darkSplinter Review
This patch needs thorough testing. It fixes this test case, but probably has other unexpected side effects. The basic idea is to include the space manager's YMost() when computing an auto-height block frame's height. I don't think that we need to do this in the horizontal direction: it should be done implicitly as we compute the combined area for the lines.
Comment on attachment 64166 [details] [diff] [review] stab in the dark r=dbaron. This is exactly how I've proposed CSS should be changed and should be pretty much how IE works.
Attachment #64166 - Flags: review+
(I think this would probably allow us to get *rid* of using the overflow area for table cells, although there might still be issues with absolute positioning. Not using the overflow area would fix some bugs with relative positioning within table cells, I think.)
I'm not sure that table cells are using overflow area (at least, I don't see anything obvious in the table code). In regards to this bug, the place that I saw overflow area being used was in nsBlockFrame::ReflowFloater: the overflow area computed during the reflow is returned as the combined area for the float. Is this what you were thinking of?
Hrm. Combined area. I need to refresh my memory on what that is, but it sounds evil.
This passes the regression tests, AFAICT. Lots of frame-state mismatches, but no bbox errors or visual artifacts. I'll comment the patch a bit better; marc, could you sr=?
Comment on attachment 64166 [details] [diff] [review] stab in the dark sr=attinasi
Attachment #64166 - Flags: superreview+
Are you going to check in the testcase as a regression test? Might be a good idea...
Fix checked in, with regression test.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
No more regressions. Verified with Build ID: 2002031303.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
No more regressions. Verified with Build ID: 2002031303.
Status: REOPENED → VERIFIED
repairing bugzilla problem "status:Verified, Resolution: "")
Status: VERIFIED → REOPENED
fixed
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
verified fixed
Status: RESOLVED → VERIFIED
Blocks: 134645
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: