Last Comment Bug 233078 - Using overflow:hidden causes right padding doubling on elements inside a table
: Using overflow:hidden causes right padding doubling on elements inside a table
Status: RESOLVED WORKSFORME
: testcase
Product: Core
Classification: Components
Component: Layout: Block and Inline (show other bugs)
: Trunk
: x86 All
: -- normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks: 284242
  Show dependency treegraph
 
Reported: 2004-02-04 12:46 PST by Kenneth Kolano
Modified: 2005-09-30 15:08 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
reporter's testcase (554 bytes, text/html)
2004-02-04 12:54 PST, David Baron :dbaron: ⌚️UTC-7 (busy September 14-25)
no flags Details
Testcase for Mozilla <= 1.5 (using overflow:-moz-scrollbars-none) (471 bytes, text/html)
2004-02-04 18:33 PST, Mats Palmgren (:mats)
no flags Details
problem reappears when buttons are pressed (970 bytes, text/html)
2005-09-30 15:03 PDT, Brian Duchek
no flags Details

Description Kenneth Kolano 2004-02-04 12:46:48 PST
User-Agent:       
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7a) 

Applying the style overflow:hidden to an element inside a table cell causes 
the right padding of that element to be doubled in width.

Sample HTML...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 
1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Overflow Doubles Padding</title>
	</head>
	<body>
		<table><tr>
			<td>
				<div 
style="overflow:hidden;padding:15px;width:190px;border:5px solid #F00">
					<div style="border:5px solid 
#f00">Test</div>
				</div>
			</td>
		</tr></table>
		<div 
style="overflow:hidden;padding:15px;width:190px;border:5px solid #F00">
			<div style="border:5px solid #f00">Test</div>
		</div>
	</body>
</html>

Reproducible: Always
Steps to Reproduce:
1. View sample HTML in Mozilla based browser
Actual Results:  
The <div> inside of the table has a doubled right padding, the one outside one 
does not.

Expected Results:  
Both <div>'s should look the same with 15px padding all the way around.

This is my first bug submission, I hope I didn't forget anything.
Comment 1 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2004-02-04 12:52:47 PST
Where's the rest of your build identifier?  I don't see a build date.
Comment 2 Kenneth Kolano 2004-02-04 12:54:28 PST
(In reply to comment #1)
> Where's the rest of your build identifier?  I don't see a build date.

Oops, missed the second line of it. The full version id is...

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7a) Gecko/20040131 
Firebird/0.8.0+
Comment 3 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2004-02-04 12:54:54 PST
Created attachment 140617 [details]
reporter's testcase
Comment 4 Mats Palmgren (:mats) 2004-02-04 18:33:32 PST
Created attachment 140638 [details]
Testcase for Mozilla <= 1.5  (using overflow:-moz-scrollbars-none)
Comment 5 Mats Palmgren (:mats) 2004-02-04 18:37:37 PST
Causing a reflow by zooming cures the problem.
Bug does not occur in Mozilla 1.0.2
Bug occurs in Mozilla 1.2.1 and forward.
Comment 6 Bernd 2004-02-04 22:06:46 PST
reducing the window size makes the second div without a table in attachment
140617 [details]  to go to the size of the div in the table.
Comment 7 Maxime Petazzoni 2004-05-16 12:30:14 PDT
(In reply to comment #5)
> Causing a reflow by zooming cures the problem.
> Bug does not occur in Mozilla 1.0.2
> Bug occurs in Mozilla 1.2.1 and forward.

This bug is still present in Mozilla 1.6 : Mozilla/5.0 (X11; U; Linux i686;
fr-FR; rv:1.6) Gecko/20040413 Debian/1.6-5.
It also occurs in some places with a div within another div, zooming corrects
the problem.
Take a look at http://www.bulix.org for an example.
Comment 8 Glenn Nilsson 2005-03-07 02:10:40 PST
In "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050223
Firefox/1.0.1" this code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
/>
	<title>padding-right proglem in Firefox</title>
	<style type="text/css">
p {
	float: left;
	width: 300px;
	background-color: blue;
	overflow: hidden;
	padding-right: 50px;
}
	</style>
</head>

<body>
	<p>Ut eros. Praesent porttitor euismod massa. Donec commodo ornare justo.
Phasellus pulvinar dolor in turpis. Nunc pede. Proin sollicitudin. Donec
tincidunt quam.</p>
	<img src="images/highlight1.jpg" alt="" />
</body>
</html>

have the same rendering error.
floating left or right adds 50px to the right margin.
padding-left instead of right adds 50px to the left AND right!
adding a fixed height removes the problem
the bg-color has no inpact.
Comment 9 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-08-09 10:38:16 PDT
I can see the bug in Mozilla1.7, but not anymore in current trunk build, marking
WFM. Please reopen, if you still can see the bug in current trunk build.
Comment 10 Brian Duchek 2005-09-30 15:03:20 PDT
Created attachment 198058 [details]
problem reappears when buttons are pressed
Comment 11 Brian Duchek 2005-09-30 15:06:11 PDT
For the most recently added attachmment (198058)...

User-Agent:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915
Firefox/1.0.7

This bug reappears for me when there's need to reflow the some of the
child-node's content, cases triggering the bug are things like clicking a form
button, or resizing text in a hyperlink on hover. 

I'd reopen this, but it it appears that I don't have permission to, or am
misunderstanding something. Sorry.
Comment 12 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-09-30 15:08:37 PDT
Brian, you're using 1.0.7, that's why you're still seeing the bug.
This bug is fixed in the 1.5beta release and in current trunk builds:
http://ftp.scarlet.be/pub/mozilla.org/firefox/nightly/latest-trunk/

Note You need to log in before you can comment on or make changes to this bug.