quirk nowrap + fixed style width does not give style width as MEW

RESOLVED FIXED

Status

()

Core
Layout: Tables
RESOLVED FIXED
13 years ago
11 years ago

People

(Reporter: drew, Assigned: Bernd)

Tracking

Trunk
x86
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

1.26 KB, text/html
Details
3.55 KB, patch
Details | Diff | Splinter Review
(Reporter)

Description

13 years ago
Example:

<table width="500px" border="1">
    <tr>
        <td style="width: 300px;">test 1</td>
        <td width="100%">test2</td>
    </tr>
</table>

<table width="500px" border="1">
    <tr>
        <td style="width: 300px;">test 3</td>
        <td>test4</td>
    </tr>
</table>

In the first table, the first cell should take up the 300px it specified, and
the second cell should take up 100% of the remaining width of the container.
(Assignee)

Comment 1

13 years ago
>In the first table, the first cell should take up the 300px it specified, and
the second cell should take up 100% of the remaining width of the container.

and this is specified where that it should do this? Especially how does that fit
with http://www.w3.org/TR/CSS21/tables.html#width-layout?
(Reporter)

Comment 2

13 years ago
From the section you linked:

"If the specified 'width' (W) of the cell is greater than MCW, W is the minimum
cell width."

And:

"A percentage value for a column width is relative to the table width. If the
table has 'width: auto', a percentage represents a constraint on the column's
width, which a UA should try to satisfy. (Obviously, this is not always
possible: if the column's width is '110%', the constraint cannot be satisfied.)"

I interpret this to mean that in the sample I gave the specified 'width' should
be the minimum cell width.  The specifiction of 100% "cannot be satisfied."

The spec seems ambiguous, in that the second passage I quoted uses the term
"constraint" without specifying that it is constraining the maximum, not the
minimum.  I believe the intent of the spec is to constrain the maximum.
(Assignee)

Comment 3

13 years ago
Ah I overlooked that the cells are in the same row.
The cell width specification is not correct in the first case, so the browser
goes into its fixup code (the GIGO principle, garbage in - garbage out). And we
can do whatever we want as this is not covered by any spec that I know. We
render this identical to IE and Opera, which have followed the NN.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
(Reporter)

Comment 4

13 years ago
Why is the first width specificatin not correct?  If it is not correct in the
first case it shouldn't have been applied correctly in the second.  The only
difference between the two cases is that the first has a non-css width specifier
on the second cell.  
(Reporter)

Comment 5

13 years ago
The example I posted at first didn't properly demonstrate the problem.  I was
given a better example:

http://dkime.com/dochope.html

This is taken from the PayPal shopping cart application.  Go to
http://dochope.com and click the "View Cart" to see the original.  The link
above is the simplified test case.

In the new example:

* The first table uses a style for pixel width in the first cell and html for
percent width in the second

* The second table uses html for pixel width in the first cell and html for
percent width in the second

* The third table uses a style for pixel width in the first cell and a style for
percent width in the second

The second table is the only one that displays as you would expect.

I wouldn't reopen this bug, except that the PayPal code is out of my control,
and it gets thousands of unique visitors a day -- not just my site, everyone
using PayPal shopping cart.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Summary: Table cell with width in percent ignores cell with width in pixels → CSS table column width specifier not calculated correctly
(Assignee)

Comment 6

13 years ago
Created attachment 170666 [details]
reduced testcase
(Assignee)

Comment 7

13 years ago
Created attachment 170667 [details]
more obvious testcase
Attachment #170666 - Attachment is obsolete: true
(Assignee)

Comment 8

13 years ago
Thats the ugly nowrap fixed width quirk hack, and we dont apply that hack for
style widths but we do it for html widths
Summary: CSS table column width specifier not calculated correctly → quirk nowrap + fixed style width does not give style width as MEW
(Assignee)

Comment 9

13 years ago
the code at
http://lxr.mozilla.org/seamonkey/source/layout/tables/nsTableCellFrame.cpp#230
interacts with 
http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsHTMLTableCellElement.cpp#399
(Assignee)

Comment 10

13 years ago
Drew you are relying on illegal behaviour here. Its an error that origined from
NN but has nothing to do with a spec. So this if ever will only work in quirks
mode (http://www.mozilla.org/docs/web-developer/quirks/)
(Reporter)

Comment 11

13 years ago
I wish I were the one relying on that behavior.  As I said, this is the PayPal
shopping cart page.  Is there any process that seems to work for requesting
someone fix their code to standards?
(Assignee)

Comment 12

13 years ago
Created attachment 170731 [details] [diff] [review]
patch
Assignee: nobody → bernd_mozilla
Status: UNCONFIRMED → ASSIGNED
(Assignee)

Updated

13 years ago
Attachment #170731 - Flags: superreview?(bzbarsky)
Attachment #170731 - Flags: review?(bzbarsky)
(Assignee)

Comment 13

13 years ago
This patch should first of all make the nowrap thing a quirk.
Second it should increase the min table cell width to a fixed width if nowrap in
specified. IE resets the nowrap attribute regardless how the fixed width has
been specified via html or the style system. This patch resets the nowrap only
for the html width but increases the table cell width. This should also help in
couple of those img. wrap scenarios.
Comment on attachment 170731 [details] [diff] [review]
patch

So what is the quirk?  That in quirks mode table cells with fixed HTML width
set don't have the "nowrap" attribute apply to actually prohibit wrapping?  And
that table cells with the nowrap attribute set and a width specified behave
weirdly?

If that's correct, r+sr=bzbarsky...
Attachment #170731 - Flags: superreview?(bzbarsky)
Attachment #170731 - Flags: superreview+
Attachment #170731 - Flags: review?(bzbarsky)
Attachment #170731 - Flags: review+
(Assignee)

Comment 15

13 years ago
fix checked in
(Assignee)

Updated

13 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago13 years ago
Resolution: --- → FIXED

Updated

12 years ago
Blocks: 297651

Updated

12 years ago
Blocks: 298014

Updated

12 years ago
Blocks: 295586

Updated

12 years ago
Blocks: 299862

Updated

12 years ago
Blocks: 301614

Updated

12 years ago
Blocks: 308161

Updated

12 years ago
Blocks: 311549

Updated

12 years ago
Blocks: 318828

Updated

12 years ago
Blocks: 319427

Updated

12 years ago
Blocks: 318262

Updated

12 years ago
Blocks: 307901
*** Bug 323310 has been marked as a duplicate of this bug. ***

Updated

11 years ago
Blocks: 331507
You need to log in before you can comment on or make changes to this bug.