1. Go to attached testcase
width and height are overriding max-width and max-height (max-width and max-height must override width and height)
III Other Browsers:
IV Nightly tested: 42138
Bug in Chromium : http://code.google.com/p/chromium/issues/detail?id=9550
Created attachment 29213 [details]
There is a minor mistake in 'Other browsers' section: IE7 doesn't support 'display:table' at all, so originally I've tested the test case on IE8.
I have confirmed that our behavior does not match FF3.
Hyatt says that tables have had this bug forever. In general our table support needs improving. Perhaps a member of the Tokyo team would be up to the task.
Any chance that somebody will look into this?
Are there any workarounds?
+1 Some time has passed... any news? The only workaround I have found is wrapping the table inside a div with "max-width" set...a css-only solution would be much appreciated.
The bug is presumably in RenderBox::computeLogicalHeight:
DISCLAIMER: I've never looked at the webkit code before.
Could it be in RenderBox::computeLogicalWidthInRegion() for the ignored "max-width" part? If this is the case, maybe it never reaches this if statement http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderBox.cpp#L1765
Any news from the tokyo team or anybody else on this issue? Is there anything else I can do to help solve it? Someone to contact directly?
The bug is probably in RenderTable::updateLogicalWidth. You can see that it checks against min-width, but there's no code for max-width.
I'm not sure how table height gets computed, but if you look in RenderBox::computeLogicalHeight, it only calculates margins. I suspect the height is updated by it's children or something.
> I'm not sure how table height gets computed, but if you look in RenderBox::computeLogicalHeight, it only calculates margins. I suspect the height is updated by it's children or something.
The logical height computation is in RenderTable::layout(). We need to check for the min / max logical height and update |computedLogicalHeight| accordingly.
Note that the effect of min / max width / height on tables is undefined in CSS 2.1 (http://www.w3.org/TR/CSS21/visudet.html#propdef-max-width) so we will need to evaluate what other browsers are doing in some corner cases (e.g. should we shrink our content if max-height is defined? (we never shrink our height currently as it would violate CSS 2.1 tables: we could make a cell smaller than the minimum height for its content))
After bug 98455 and bug 98633, this is fixed.