Bug 14856 - Select control inside table wraps incorrectly
Summary: Select control inside table wraps incorrectly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.altavista.com/image/default
Keywords: HasReduction
Depends on:
Blocks: 15218
  Show dependency treegraph
 
Reported: 2007-08-01 14:41 PDT by Matt Perry
Modified: 2023-02-24 04:28 PST (History)
7 users (show)

See Also:


Attachments
reduced test case (586 bytes, text/html)
2007-08-01 14:41 PDT, Matt Perry
no flags Details
even more reduced test case (314 bytes, text/html)
2008-01-17 02:27 PST, Eric Seidel (no email)
no flags Details
even more reduced test case (237 bytes, text/html)
2008-01-17 02:38 PST, Eric Seidel (no email)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Perry 2007-08-01 14:41:14 PDT
Reduced test case coming up.

Compare the above page (or upcoming test) in Safari and Firefox.  Notice how Safari wraps the last <select> control to the second line, even though there should be enough room to fit them all on the same line.

I've only been able to determine that this is somehow related to <select> controls inside of a table, that the previous <td> has a width percent set, and that the outer <td> has rowspan set.

My vague guess is that the size of a <select> control isn't properly taken into account when determining the width of the table it's inside, and then is wrapped when it turns out to be too big.
Comment 1 Matt Perry 2007-08-01 14:41:56 PDT
Created attachment 15793 [details]
reduced test case
Comment 2 David Kilzer (:ddkilzer) 2007-08-02 06:43:41 PDT
Confirmed with a local debug build of WebKit r24803 with Safari 3 Public Beta v. 3.0.3 (522.12.1) on Mac OS X 10.4.10 (8R218).

This is not a regression as the same behavior occurs with Safari 2.0.4 (419.3) with original WebKit on 10.4.10.

Renders as expected in Firefox 2.0.0.6 and Opera 9.21.

Comment 3 Eric Seidel (no email) 2008-01-17 02:27:10 PST
Created attachment 18495 [details]
even more reduced test case
Comment 4 Eric Seidel (no email) 2008-01-17 02:38:02 PST
Created attachment 18496 [details]
even more reduced test case
Comment 5 Eric Seidel (no email) 2008-01-17 02:40:52 PST
I suspect this is some incorrect prefWidth calculation.  Possibly the colspan is not taken into account during the layout of the inner table.  Since w/o the col-span the prefWidth for the first td would be 0, with the colspan, it's 500.
Comment 6 Eric Seidel (no email) 2008-01-17 02:43:51 PST
Suspicious:
void FixedTableLayout::calcPrefWidths(int& minWidth, int& maxWidth)
{
    // FIXME: This entire calculation is incorrect for both minwidth and maxwidth.

Comment 7 Eric Seidel (no email) 2008-01-17 02:58:18 PST
Actually, this is an AutoTableLayout table, so my previous comment does not apply.  I'm not familiar enough with table layout to know immediately where this bug would be, and thus-far my debugging has not yielded a culprit.  Next bug in the list...
Comment 8 Dave Hyatt 2008-01-17 10:43:51 PST
Colspans don't stretch properly in a lot of circumstances.  This bug is in Radar somewhere.  It's very old.

Comment 9 Eric Seidel (no email) 2008-01-17 11:53:43 PST
(In reply to comment #8)
> Colspans don't stretch properly in a lot of circumstances.  This bug is in
> Radar somewhere.  It's very old.
> 

Well, you were looking for old/bad CSS bugs to really enrage you yesterday... I might suggest this is one to get excited about, since if bug 15218 turns out to really be a dupe then this has been seen in 2 major sites. :)
Comment 10 Dave Hyatt 2008-01-17 12:17:55 PST
If this is the bug I'm thinking of, it's really hard to fix.  Our 2-pass layout system (using min/max pref widths and then laying out) made this one really hard.  However this might just be a completely different issue.

Comment 11 Elliott Sprehn 2012-06-26 00:52:05 PDT
Maybe you want to take a stab at this Julien? Or point me at what part of the table layout code to look into.
Comment 12 Ahmad Saleem 2023-02-24 04:28:13 PST
I am able to reproduce this bug in Safari Technology Preview 164 and the test case does not show in one line like Chrome Canary 112 and Firefox Nightly 112.