Closed Bug 46983 Opened 25 years ago Closed 23 years ago

[REL POS] Relatively positioning an inline box inside a table cell wrongly affects cell dimensions

Categories

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

defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: make, Assigned: dbaron)

References

Details

(Keywords: css2, testcase, Whiteboard: [awd:tbl][patch])

Attachments

(2 files, 2 obsolete files)

From Bugzilla Helper: User-Agent: Mozilla/4.74 [en] (WinNT; U) BuildID: 2000072909 Images inside table cells which are (relative) positioned via a CSS style may lead to an increased row height of the table. Reproducible: Always Steps to Reproduce: 1. Create a page with an IMG inside a TD. Add some text to another TD 2. Move the IMG down by adding a CSS style like {position:relative; top:100px;} Actual Results: 3. The table will behave as if the following CSS style has been used for the TD {padding-top:100px;}, ie. the row height will be increased as much is needed to keep the img inside the cells boundary. Expected Results: My understanding of relative positioning is something like this: Do initial layout -> Move relative positioned elements (w.o. changing the layout). I would expect that the tables row height should not change if I move the IMG via CSS (BTW. what may happen if the IMG is moved up?). Maybe I add a testcase tomorrow. No time left today.
Keywords: css1, makingtest
Keywords: makingtestnsbeta3, testcase
Attached file testcase (obsolete) —
QA Contact: chrisd → py8ieh=bugzilla
Something has to go - denying beta3 nomination for absolute/relative positioning problems in tables.
Status: NEW → ASSIGNED
Whiteboard: [nsbeta3-]
Target Milestone: --- → Future
Summary: Relative positioning of an IMG inside a TD influences table row height → [POS] Relative positioning of an IMG inside a TD influences table row height
Summary: [POS] Relative positioning of an IMG inside a TD influences table row height → [REL POS] Relative positioning of an IMG inside a TD influences table row height
I'm no expert in CSS, but I think that tables are structural entities which are meant to hold content inside them. Bringing content that was inserted inside a <td> within a table and making it move outside a table is kind of meaningless. Why should it be in a table structure in the first place if it is not meant to physically be there. Personally, I think IE 5.5 renders this wrong by allowing the relative position outside the table. I think Mozilla does it correctly by just extending the height of the table to keep it within there. Maybe I'm on the above, but I think it is a misuse of table any way you look at it. Should things even be allowed to be relatively positioned within the table? Enlighten me. jake
According to CSS, yes, relatively positioning _anything_ is allowed. Don't forget, CSS is not about structure, it's about presentation. The underlying document should be purely structural, and the CSS should be presentational. So what happens if you want to relatively position something that happens to be in a table? Hence it is allowed.
Whatever you may think about CSS and tables, relative positioning should never affect ancestor elements.
And, BTW, this may be a dup of bug 4519.
Ok, I'm convinced. Mostly going on a gut feeling and the fact that this bug hadn't been commented on since early august and seemed like it needed a kick in the butt to get it fixed. Like I said "I'm no expert in CSS". I'll read a bit more of the spec before I make a statement like that again. Sorry. I am glad the bug is getting attention again, though. Jake
*** Bug 64987 has been marked as a duplicate of this bug. ***
QA Contact: ian → amar
Whiteboard: [nsbeta3-] → [awd:tbl]
Keywords: css1css2
using FizzillaCFM/2002071208, the testcase works as expect IF the images are changed to display: block using CSS. (See bug 22274). As such, I suggest this bug be resolved WFM.
Setting All/All since first testcase behavior can be observed as originally described using FizzillaCFM/2002071208.
OS: Windows NT → All
Hardware: PC → All
No, this is a bug and should not be resolved as worksforme.
Attachment #91236 - Attachment description: Updated testcase with img { display: block; } CSS rule → Modified testcase with 'img { display: block; }' CSS rule
Ah, I think I get the point. The problem is that relatively positioning any inline box inside a TD influences the table cell height. Using display: block is merely a workaround. I think this might be a better Summary.
Summary: [REL POS] Relative positioning of an IMG inside a TD influences table row height → Relatively positioning an inline box inside a table cell wrongly affects cell height
Attached file Improved testcase
Attachment #12146 - Attachment is obsolete: true
Attachment #91236 - Attachment is obsolete: true
Summary: Relatively positioning an inline box inside a table cell wrongly affects cell height → [REL POS] Relatively positioning an inline box inside a table cell wrongly affects cell height
Summary: [REL POS] Relatively positioning an inline box inside a table cell wrongly affects cell height → [REL POS] Relatively positioning an inline box inside a table cell wrongly affects cell dimensions
Depends on: 131475
See bug 172896 comment 11, which describes a fix for this bug.
This is fixed by my patch on bug 172896.
Assignee: karnaze → dbaron
Status: ASSIGNED → NEW
Depends on: 172896
Whiteboard: [awd:tbl] → [awd:tbl][patch]
The code gives a table with columns that shrink and grow as they are changed. Surely they should stay the same? The problem seems similar to bug 46983.
Steps to reproduce the problem in the above attachment. 1. Load the attachment. 2. Click near the top of the text and then near the bottom so there are two red columns. 3. Repeatedly click either column and see it grow or shrink. Tested in K-Meleon Version 0.7 Build 700 Compiled Thu Oct 31 00:54:24 2002
The previous two comments are not related to this bug.
Fixed by checkin of bug 172896.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
just wanted to note that the attachment in comment 17 crashes Phoenix (latest nightly). However, there are lots of crashers today and I'm not sure which of these might match with this crasher. I'll let someone else figure that out...or I might check back and do it myself if I get the time. Jake
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: