min-width/min-height/max-width/max-height does not work for table elements

NEW
Assigned to

Status

()

defect
14 years ago
3 months ago

People

(Reporter: giampaolo, Assigned: mats)

Tracking

(Blocks 1 bug, {css2, testcase})

Trunk
Points:
---
Dependency tree / graph
Bug Flags:
webcompat ?

Firefox Tracking Flags

(Webcompat Priority:?)

Details

(Whiteboard: [reflow-refactor] [webcompat], )

Attachments

(6 attachments, 1 obsolete attachment)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

See the example here:
http://www.bellavite.com/bugzilla/tbody.htm
the <tbody> tag should display scrollbars in the table thanks to the following
style sheet:
<tbody style="max-height:110px;overflow:auto">
in Firefox 1.5 beta1 this seems not working, as happens in Firefox 1.0.6

Reproducible: Always

Steps to Reproduce:
Create a long table with max-height/overflow:auto style sheet properties in the
<tbody> tag. The max height value should be less height than the table height.
Actual Results:  
Scrollbars don't appears

Expected Results:  
Show scrollbars

I've upgraded from firefox 1.0.6 to firefox 1.5 beta
Posted file Example file (obsolete) —
I found the CSS2 specification doesn't allow the max-height property in table cells:
http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-max-height
So I guess this is not really a bug.
Severity: normal → minor
In the latest CSS 2.1 working draft, max-height is said to apply to "all 
elements but non-replaced inline elements, table columns, and column groups", so 
it should affect TBODY. 
Component: General → Layout: Tables
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → Trunk
INVALID per comments 2 and 3.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You misread comment 3.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Posted file TABLE min-height
Posted file TR min-height
Posted file TD min-width/height
Posted file TBODY min-height
Posted file TBODY max-height
Attachment #195521 - Attachment is obsolete: true
Assignee: nobody → mats.palmgren
Severity: minor → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: css2, testcase
OS: Windows XP → All
Hardware: PC → All
Summary: CSS: max-height in tbody doesn't work in 1.5 beta1 → min-width/min-height/max-width/max-height does not work for table elements
Posted patch Patch rev. 1Splinter Review
Attachment #195979 - Flags: superreview?(dbaron)
Attachment #195979 - Flags: review?(bernd_mozilla)
Blocks: 308403
Comment on attachment 195979 [details] [diff] [review]
Patch rev. 1

I have spawned off max-height/max-width for table cells to bug 308403,
which this patch does not address (other than setting up a correct
reflow state).
*** Bug 227650 has been marked as a duplicate of this bug. ***
Mats, sorry for the delay but its high on my priority list now.

+        if (eStyleUnit_Auto == heightUnit) {
+          mComputedHeight = (mComputedMinHeight == 0) ? NS_AUTOHEIGHT :
mComputedMinHeight;
+        } else {

Could you please convince me that this is the right thing to do.

If a auto height table element has a min height it gets a computed height?

Wouldnt that break for standards mode the pct to auto conversion for children of
such a element?

nsStyleCoord nsTableColFrame::GetStyleWidth() const

I have big doubts that the changes are correct, while usually fixed widths are
the upper limits, with the patch a specified min width on a column turns the
column into a column with a fixed width, I would rather expect that a specified
min width influences rather the MEW than changes a col type.




        
Comment on attachment 195979 [details] [diff] [review]
Patch rev. 1

The changes to BasicTableLayoutStrategy are wrong. The min-width should update
the MIN_CON
http://lxr.mozilla.org/seamonkey/source/layout/tables/nsTableColFrame.h#53
the max-width is an additional constraint which should be added between MIN_PRO
and FINAL. The new constraint should take part in the balancing.
My proposal is to split these widths for colspans just by dividing trough the
real cols that it covers.
Attachment #195979 - Flags: review?(bernd_mozilla) → review-
Out of curiousity... has this bug been forgotten?
No point working on this until reflow branch lands, since that rewrites pretty much all of BasicTableLayoutStrategy.
Whiteboard: [reflow-refactor]
2.0 is out, any news on when the reflow branch will land and when this will be fixed?
Kelly, what 2.0 is doing is completely unrelated to the reflow branch.  The current trunk plan is to stabilize the existing cairo and Cocoa widget work, then ship an alpha of Gecko 1.9 sometime in early to mid November, with any luck, then land the reflow branch on the trunk.  After that, this bug should be revisited.

You can keep track of the current state of reflow branch via http://wiki.mozilla.org/Gecko:Reflow_Refactoring#Status and http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyAll&branch=REFLOW_20060830_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot
Now that the reflow branch has landed, will this bug be revisited?
At some point, sure.  There are 80-some open bugs (including this one) that are flagged as needing someone to look at them after the branch lands, so...  ;)
Most of the patch is obsolete due to the reflow branch landing.
Duplicate of this bug: 394472
This is still alive.

Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.9b3pre) Gecko/2008010605 Minefield/3.0b3pre
Duplicate of this bug: 453034
It's weird, but this bug still seems to be present in FF3.5
I still do not see the expected behaviour on my divs containing tables like FF1.x did...
Please address this issue again. It's really annoying..
For me, I was setting up a table I wanted to center and set the max-width.  It worked--but only if I used inline styles.  If I use a class, "max-width:792px;" is treated as "width:792px;" and the table is left justified.  To be fair, IE appears to be doing the same.
This bug is about table _internal_ elements, not <table>s.  We don't do anything differently for inline style vs class styling, so it sounds like you just had a mistake in your class styling somewhere.  Please file a separate bug if you think there was a Gecko issue on your testcase, and attach your testcase to that bug.
Hi,

Any news on this bug, this is still current en very much annoying. Any idea on when it will be fixed, it seems to take a long time...
Danilo, comments 30 and 31 have nothing to do with this bug.
I do not understand why it takes so long to fix "min-height" because the "height" property is interpreted as minimum height on tables anyway (it's like an alias).

Today, only Firefox does not support this property on table, even with IE 11 it works fine. It's surprising to see a basic layout property not working only on firefox and to do a workaround only for this browser.

I thought maybe nobody reported it, but since 2005 this bug is know. I don't know what is happening, maybe this bug should be splitted in 4 differents bugs (one for each properties).
No longer blocks: 311639
Duplicate of this bug: 977929
This page is broken in Firefox because of this: https://developer.chrome.com/devsummit/sessions/
I just ran into this problem also, pretty annoying to see my site broken in FF and have to spend extra time having to fix it for a specific browser.
Duplicate of this bug: 1206271
There's duplicates of this bug here (or this is a duplicate of one of them :D) : 
bug 720669
bug 975632
bug 308403
bug 434230
(found with https://bugzilla.mozilla.org/buglist.cgi?quicksearch=max-width+table)
That's not a great search, because....

> bug 720669

Is about an element _inside_ a table cell, not a table element.

> bug 975632

Same thing.

> bug 434230

Same thing.

> bug 308403

Is already marked dependent on this bug.
Duplicate of this bug: 1221721
This bug is more than 10 years old. When might we see a fix for it?
Probably a duplicate Web Compatibility issue.
https://webcompat.com/issues/2818
I just ran into this again on http://flyweb.github.io/
I think one good thing to do is to figure out which of the 36 combinations of:
 - -height vs. -width (with table-layout: auto) vs. -width (with table-layout: fixed, in the first row of course)
 - min- vs. max-
 - on table vs. column vs column-group vs. row vs. row-group vs. cell
do *something* in other browsers, and whether what they do seems interoperable at a very basic level.

It may be worth filing separate bugs on many of these things rather than trying to do them all in one bug.
Flags: needinfo?(bugs)
David,

(In reply to David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) from comment #45)
> I think one good thing to do is to figure out which of the 36 combinations
> of:
> It may be worth filing separate bugs on many of these things rather than
> trying to do them all in one bug.

I created a reduced test case for one of the Web Compat bug when I was trying to understand what was happening. See

https://webcompat.com/issues/2818#issuecomment-231620400
http://codepen.io/anon/pen/JKAajx
Surprised to see how old this issue is. @karlcow's codepen illustrates the issue perfectly.

FYI, my current hack to make this work is to add any specific height in addition to the min-height declaration.  Doesn't seem like that should be needed, but it works for now.

http://codepen.io/squarecandy/pen/wWLNAV
I have noted that this case now corrected in Firefox Developer Edition 50.0a2 (will come to regular Firefox soon I hope), but now it does not override the height if somewhere before min-height, height is declared in percents (%).

Here is the sample
http://codepen.io/zarkojovic/pen/KgzQwV
I'm not seeing this as being corrected in Firefox Dev edition 50.0a2.  I've attached a screenshot of it displaying your code-pen.

http://postimg.org/image/jnqvqwu63/
Whiteboard: [reflow-refactor] → [reflow-refactor] [webcompat]
Clearly ni on Jet as he no longer works at Mozilla.
Flags: needinfo?(bugs)
This is not resolved on quantum. see the above-fold element on http://www.openmhealth.org/

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

You need to log in before you can comment on or make changes to this bug.