WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
12396
max-width do not work on tables
https://bugs.webkit.org/show_bug.cgi?id=12396
Summary
max-width do not work on tables
Jeremy Nicoll
Reported
2007-01-24 12:46:19 PST
The URL that I have attached contains the bare necessities of what I am talking about. As one resizes the window, each element inside resizes according to the size of the window. In other words, each element has a width of the percentage of the window. The exception is that there are two DIVs at the top which are used to measure whether the min and max values are being honored. You will see that every element except for the table has the min and max values applied correctly. I did not test on min/max height, but I would assume it would be the same. I have the latest version of Safari running on 10.4, and I have also downloaded the latest version of Webkit nightly. Both exhibit this problem.
Attachments
reduced test case
(757 bytes, text/html)
2007-01-24 13:54 PST
,
Sam Weinig
no flags
Details
Minimal test case
(1.17 KB, application/xhtml+xml)
2010-07-18 15:55 PDT
,
Evan Chaney
no flags
Details
rendering in safari, firefox, chrome
(1022.76 KB, image/png)
2025-01-23 22:48 PST
,
Karl Dubost
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2007-01-24 13:54:43 PST
Created
attachment 12649
[details]
reduced test case
David Kilzer (:ddkilzer)
Comment 2
2007-01-29 10:34:21 PST
See also
Bug 12460
.
mackyle
Comment 3
2010-05-23 21:41:26 PDT
min-width works properly on tables in both Firefox (3.6.3 tested) and Opera (10.53 tested).
Evan Chaney
Comment 4
2010-07-18 15:53:20 PDT
Issue persists on WebKit nightly
r63606
(built 7/17/2010) and Safari 5.0 (6533.16) on Mac OS X 10.6.4.
Evan Chaney
Comment 5
2010-07-18 15:55:17 PDT
Created
attachment 61916
[details]
Minimal test case
Max Vujovic
Comment 6
2012-01-18 09:45:36 PST
For the min-width case, see
Bug 76553
- min-width does not work on <table>
Daniel Trebbien
Comment 7
2013-04-03 06:48:44 PDT
https://bugzilla.mozilla.org/show_bug.cgi?id=307866
Ahmad Saleem
Comment 8
2022-06-12 18:09:37 PDT
I am able to reproduce these bugs using attached test cases in Safari 15.5 on macOS 12.4. In both test cases, Safari differs from Chrome Canary 104 and Firefox Nightly 103, where both match each other. From attached test cases, in "reduced test case", Safari renders "max-width" different from other browsers. While in "minimal test case", Safari does not show "red line" to restrict "table width" and it just goes off the edge of viewport. If I am testing it incorrectly, please retest accordingly. Thanks!
Brent Fulgham
Comment 9
2022-07-06 16:03:59 PDT
Safari continues to have different output than Chrome and Firefox.
Radar WebKit Bug Importer
Comment 10
2022-07-06 16:04:15 PDT
<
rdar://problem/96554687
>
Karl Dubost
Comment 11
2025-01-23 22:48:31 PST
Created
attachment 473999
[details]
rendering in safari, firefox, chrome This would deserve a WPT test case Safari Technology Preview 18.2 20621.1.9.111.1 Firefox Nightly 136.0a1 13625.1.23 Google Chrome Canary 134.0.6975.0 6975.0
Ahmad Saleem
Comment 12
2025-02-21 20:53:50 PST
Blink Merge:
https://chromium.googlesource.com/chromium/src.git/+/364480a952dc2eb710b26f82543e08bd4bac825b
void AutoTableLayout::applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const { if (auto& tableLogicalWidth = m_table->style().logicalWidth(); tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) { // 'minWidth' is the result of measuring the intrinsic content's size. Keep it to // make sure we are *never* smaller than the actual content. LayoutUnit minContentWidth = minWidth; // FIXME: This line looks REALLY suspicious as it could allow the minimum // preferred logical width to be smaller than the table content. This has // to be cross-checked against other browsers. minWidth = maxWidth = std::max<int>(minWidth, LayoutUnit { tableLogicalWidth.value() }); const auto& styleMaxLogicalWidth = m_table->style().logicalMaxWidth(); if (styleMaxLogicalWidth.isFixed() && !styleMaxLogicalWidth.isNegative()) { minWidth = std::min<int>(minWidth, LayoutUnit { styleMaxLogicalWidth.value() }); minWidth = std::max(minWidth, minContentWidth); maxWidth = minWidth; } } } ^ Fixes this test case.
Ahmad Saleem
Comment 13
2025-02-21 20:57:20 PST
It also get fixed with proposed Blink commit merge in
Bug 106603
.
Ahmad Saleem
Comment 14
2025-03-03 00:17:41 PST
Pull request:
https://github.com/WebKit/WebKit/pull/41759
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug