Summary: | max-width and max-height are not overriding the width and height properties when 'display' set to 'table' | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | jasneet <jasneet> | ||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | daniekatz, eric, hyatt, jamesr, jasneet, jchaffraix, jparent, julo, pravind.2k4, robert, stephen.cantini, tony | ||||
Priority: | P2 | Keywords: | HasReduction | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | 98455, 98633 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
jasneet
2009-04-02 17:59:52 PDT
Created attachment 29213 [details]
testcase
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. IE8: OK Hyatt? 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: http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderBox.cpp#L2025 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. http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderTable.cpp?rev=129929#L258 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)) |