Closed Bug 30802 Opened 25 years ago Closed 18 years ago

[BLOCK]{inc} Percentage CSS padding-left values fail on single-line blocks within tables

Categories

(Core :: Layout: Block and Inline, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: mlindner, Assigned: dbaron)

References

Details

(Keywords: css1, testcase, Whiteboard: [nsbeta3-][CSS1-5.5.9] relnote-devel[patch])

Attachments

(2 files, 1 obsolete file)

I'm using Mozilla M14 Build ID: 2000022820 on Win98. Mozilla M14 misrenders 
html when using the (css) padding-left property in certain circumstances. 
Please take a look at
http://www.mitec.net/~lindner/mo-css.html
a copy follows.

--- mo-css.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"PR-html40-19990824/loose.dtd">
<html>
<head>
<title>test of mozilla's css support</title>
<link rel=StyleSheet href="stsyles/main.css" type="text/css">
<style>
<!--
.indent {padding-left: 25%}
.indent2 {padding-left: 100}
-->
</style>
</head>
<body>
I used the following style declaration:<br>
&lt;style&gt;<br>
&lt;!--<br>
.indent {padding-left: 25%}<br>
.indent2 {padding-left: 100}<br>
--&gt;<br>
&lt;/style&gt;<br>

<br>
In addition, lines with red text should wrap around in your browser window for 
this test, lines with blue text shouldn't wrap. All lines should be have a bit 
of space in front of them.
<br><br><br>

	<p class=indent><font color=red>first &lt;p class=indent&gt; It seems 
the {padding-left: 10%} is only applied if the line is long enough to wrap, 
ugh. But it only does this while in a container (i've only tested it in a 
table).</font></p>

	<p class=indent><font color=blue>second &lt;p 
class=indent&gt;</font></p>

	<p class=indent2><font color=blue>first &lt;p 
class=indent2&gt;</font></p>

	<p class=indent2><font color=red>Second &lt;p class=indent2&gt;. The 
odd thing about this is that the line-long-enough-to-wrap requirement applies 
if the value for padding-left is given as a percentage, but not otherwise (i 
tried pixel values (no unit given) and em's).</font></p>

<table border=1>
<tr>
<td width=100>
</td>
<td>

	<p class=indent><font color=red>first &lt;p class=indent&gt; It seems 
the {padding-left: 10%} is only applied if the line is long enough to wrap, 
ugh.</font></p>

	<p class=indent><font color=blue>second &lt;p class=indent&gt; ACK!!!
</font></p>

	<p class=indent2><font color=blue>first &lt;p 
class=indent2&gt;</font></p>

	<p class=indent2><font color=red>Second &lt;p class=indent2&gt;. The 
odd thing about this is that the line-long-enough-to-wrap requirement applies 
if the value for padding-left is given as a percentage, but not otherwise (i 
tried pixel values (no unit given) and em's).</font></p>

</td></tr></table>
</body>
</html>
If I see this right, then the first two pars in the table cell should be
indented 25% of the table cell, and sure enough, they aren't.
Assignee: cbegle → pierre
Component: Browser-General → Style System
QA Contact: asadotzler → chrisd
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assigning to ekrock: 1/3 of Pierre's NEW bugs to help reduce his doomage factor
Assignee: pierre → ekrock
Reassigned back to me these bugs that shouldn't have left my list.
Assignee: ekrock → pierre
Assignee: pierre → troy
Component: Style System → Layout
Keywords: css1
QA Contact: chrisd → petersen
Summary: CSS support (padding-left property) in M14 → percentage left padding fails on one-line blocks
Retitling, changing component, and reassigning.

The problem seems to be that if padding-left is a percentage:
 * it doesn't work correctly on blocks with only one line in a table
 * resize-reflow doesn't change it on one-line blocks outside of a table

Both seem like problems related to not reflowing an additional time when an
additional reflow was really needed (in the second case, it's the multiple
passes of table reflow, I'd think, but it sounds like the same bug).  I'd guess
that the reflow is being skipped because there is an optimization that blocks
with only one line don't need to be reflowed again in certain conditions.
this should be on my list
Assignee: troy → buster
Status: NEW → ASSIGNED
Target Milestone: --- → M19
redistributing bugs across future milestones, sorry for the spam
Target Milestone: M19 → M21
we should fix this.  It should be a simple matter of checking to see if there is 
a percent margin or padding on the block and skipping the reflow optimization if 
there is.
Priority: P3 → P2
Summary: percentage left padding fails on one-line blocks → [BLOCK]percentage left padding fails on one-line blocks
Keywords: nsbeta3, relnote2
Denying approval for beta3: too many bugs and not enough resources, so this one 
will have to be atteneded to in the future.
Whiteboard: [nsbeta3-]
QA Contact: petersen → chrisd
P2 bugs will not make RTM. Milestone -> Future.
Target Milestone: M21 → Future
Whiteboard: [nsbeta3-] → [nsbeta3-] relnote-devel
Nom. nsbeta1. Correctness of CSS1 compliance. Also, one-line blocks won't be so
rare; this will actually bite folks.
Keywords: nsbeta1
Netscape's standard compliance QA team reorganised itself once again, so taking 
remaining non-tables style bugs. Sorry about the spam. I tried to get this done 
directly at the database level, but apparently that is "not easy because of the 
shadow db", "plus it screws up the audit trail", so no can do...
QA Contact: chrisd → ian
Attached file Testcase above moved to file (obsolete) —
Build reassigning Buster's bugs to Marc.
Assignee: buster → attinasi
Status: ASSIGNED → NEW
Blocks: 104166
*** Bug 108343 has been marked as a duplicate of this bug. ***
Whiteboard: [nsbeta3-] relnote-devel → [nsbeta3-][CSS1-5.5.9] relnote-devel
Summary: [BLOCK]percentage left padding fails on one-line blocks → [BLOCK]percentage left padding fails on one-line blocks within tables
*** Bug 134514 has been marked as a duplicate of this bug. ***
What does "padding-left: 100" mean? 100 is neither a length nor a percentage,
the two values allowed for padding.
*** Bug 172564 has been marked as a duplicate of this bug. ***
It actually doesn't matter if you put in correct things either.

See the minimal test case attached to bug 108343
<URL: http://bugzilla.mozilla.org/attachment.cgi?id=56417&action=view>
*** Bug 250266 has been marked as a duplicate of this bug. ***
this is a block issue
Assignee: attinasi → nobody
Component: Layout → Layout: Block and Inline
QA Contact: ian → core.layout.block-and-inline
Previous testcase was invalid, failing to specify px units in CSS.
(padding-left:100 is not a valid CSS rule. padding-left:100px is.)
Attachment #50463 - Attachment is obsolete: true
Also reproduced using Firefox 1.0/Mac, so setting Hardware and OS to All. 
OS: Windows 98 → All
Hardware: PC → All
Summary: [BLOCK]percentage left padding fails on one-line blocks within tables → [BLOCK] Percentage CSS padding-left values fail on single-line blocks within tables
Strange that the DOM Inspector shows the computed padding-left as correct. It's
just not drawn that way.
I can reproduce this for non-table elements with display:table, but not with display:block (and can upload a simplified test case for this if desired).

Incidentally, resizing the font on the page makes the test case render properly until the page is reloaded.
This bug still affects all current versions of Firefox from 1.5.0.4 to trunk 3.0a1 built on 2006-07-21.

Width of block with percentage padding-left is not recalculated on window resize if text is shorter than one line. See the simplified testcase with workaround.
I just checked in a fix for this to REFLOW_20060603_BRANCH, although it's pretty unrelated to the branch and could easily land separately.  (I made PrepareResizeReflow check that the padding-left was not a percentage.)
Assignee: nobody → dbaron
Whiteboard: [nsbeta3-][CSS1-5.5.9] relnote-devel → [nsbeta3-][CSS1-5.5.9] relnote-devel[patch]
Target Milestone: Future → mozilla1.9alpha
Summary: [BLOCK] Percentage CSS padding-left values fail on single-line blocks within tables → [BLOCK]{inc} Percentage CSS padding-left values fail on single-line blocks within tables
*** Bug 194119 has been marked as a duplicate of this bug. ***
Fixed by reflow branch landing.
Status: NEW → RESOLVED
Closed: 18 years ago
Depends on: reflow-refactor
Resolution: --- → FIXED
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20061208 Minefield/3.0a1 ID:2006120812 [cairo]

VERIFIED
Status: RESOLVED → VERIFIED
Flags: in-testsuite?
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: