Open Bug 313306 Opened 19 years ago Updated 2 years ago

Fails to render properly if the sum of the widths in table elements exceeds 100%

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
Windows XP
defect

Tracking

()

People

(Reporter: anthony.vanorizande, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050702
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050702

I found other bugs that seem to be related but I think this is in a different vein.

The following HTML will render correctly in IE but not a recent version of Mozilla.

===============================================================
<HTML><BODY>
	<TABLE WIDTH="100%" BORDER="0">
	<TR>
		<TD WIDTH="%100" align=left>Left Aligned Text</TD>
		<TD width="%100" align="center">Centered Text</TD>
		<TD WIDTH="%100" align=right>Right Aligned Text</TD>
	</TR>
	</TABLE>
</BODY></HTML>
===============================================================

I believe that the problem is that all three columns have a width of 100% which
totals to be > 100%.   My understanding is that Mozilla should be taking any
values that exceed a total of 100% and scaling them down so that the sum equals
to 100%.   Basically it should be rendered as if the width on all three columns
was equal to 33.3%

Anthony

Reproducible: Always

Steps to Reproduce:
Past the following HTML into a text file and open.

<HTML><BODY>
	<TABLE WIDTH="100%" BORDER="0">
	<TR>
		<TD WIDTH="%100" align=left>Left Aligned Text</TD>
		<TD width="%100" align="center">Centered Text</TD>
		<TD WIDTH="%100" align=right>Right Aligned Text</TD>
	</TR>
	</TABLE>
</BODY></HTML>
Actual Results:  
The table was rendered with the first column taking up almost all of the space
and the last two squashed into the edge.

Expected Results:  
The three columns should have been scaled down so that each was equal to 33.3
percent
Well, the table cells have  width="%100", which is wrong but somehow Mozilla
converts that into 100%.
That is not what IE6 and Opera are doing, so I would think this is a bug.
Assignee: composer → mrbkap
Status: UNCONFIRMED → NEW
Component: Composer → HTML: Parser
Ever confirmed: true
Keywords: testcase
Product: Mozilla Application Suite → Core
QA Contact: parser
Version: unspecified → Trunk
Not really an HTML: Parser bug... more of an attribute parsing one.
Assignee: mrbkap → general
Component: HTML: Parser → DOM
QA Contact: parser → ian
Attached patch patchSplinter Review
Well, this fixes it for me.
Attachment #200388 - Flags: review?(bugmail)
Comment on attachment 200388 [details] [diff] [review]
patch

We just talked about this for a bit on irc.  This patch fixes this testcase,
but not width="w%100", for example.  The answer, we think, is to add a strict
integer-parsing function of some sort and use it here.	See also bug 52019.
Attachment #200388 - Flags: review?(bugmail) → review-
Depends on: 52019
I am impressed with how quick you all have responded.

I realize now that the percent sign was on the wrong side.  I also made another
mistake.  Looking closely it appears that IE just plain ignored my width
arguments instead of attempting to deal with them.

If the objective is to match the functionality of IE then you will need to
ignore the invalid parameters instead of attempting deal with them.

I hope I have not wasted your time too much.

Many Thanks

Anthony
Assignee: general → nobody
QA Contact: ian → general
Apparently, Nightly, Chrome 35 and IE11 all display the same thing, but it's not what the reporter was expecting (33,3% / 33,3% / 33,3%).
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: