Bug 3508 - REGRESSION (125-412): problem with negative margin-top and position: absolute (vre.aitg.com)
Summary: REGRESSION (125-412): problem with negative margin-top and position: absolute...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Darin Adler
URL: http://vre.aitg.com
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 12:15 PDT by Chris Petersen
Modified: 2006-01-31 21:20 PST (History)
3 users (show)

See Also:


Attachments
Reduced test case (415 bytes, text/html)
2005-06-13 12:19 PDT, Chris Petersen
no flags Details
an even-better reduction that shows the problem (199 bytes, text/html)
2006-01-21 20:43 PST, Darin Adler
no flags Details
patch to fix the problem (negative top margins in position: absolute case) (14.36 KB, patch)
2006-01-22 11:21 PST, Darin Adler
no flags Details | Formatted Diff | Diff
patch without the extra file (KWQListBox.mm) in it (13.63 KB, patch)
2006-01-22 11:29 PST, Darin Adler
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Petersen 2005-06-13 12:15:35 PDT
Steps to Reproduce: 
1. reference URL is http://vre.aitg.com
2. Click on any links along top (Service Information, Special Programs, etc)
3. Rendering is incorrect; line below text appears below "reference line" (line entirely across top of 
page, separating beige from white).

Expected Results:
"beige on beige", ie text appears above "reference" line. Appeared correctly in 1.2

Actual Results:
text blocks (Service Information, etc) appears below "reference" line

Notes:
Site primarily developed in Dreamweaver on Mac OS X 10.3. Primary browser was Safari 1.2 under 
10.3.8.
Comment 1 Chris Petersen 2005-06-13 12:16:23 PDT
4/20/05 11:52 AM Chris Petersen:
I have isolated the issue to a reduced test case. The test case uses two DIV (DIV 1, DIV 2) elements. The 
problem is the DIV 2 is using absolute positioning with a negative margin value assigned.

position: absolute; margin: -24 0 0 166px;


Open the attached test case " vre_aitg.html" in Safari v412 or v312. Notice the text "Service Information" 
is displayed below the background image in DIV 1. Open "vre_aitg.html" in either Safari v125 or Firefox 
1.0.2. Notice the text is displayed above the horizontal line in the tiled background image. This is the 
correct behavior in Safari v125 and Firefox.

Comment 2 Chris Petersen 2005-06-13 12:18:17 PDT
Apple Bug : <rdar://problem/4093277>
Comment 3 Chris Petersen 2005-06-13 12:19:17 PDT
Created attachment 2300 [details]
Reduced test case
Comment 4 Daniel Udey 2005-11-09 11:31:26 PST
For what it's worth, this bug is still confirmed in ToT as of November 9th. It appears that WebKit is not 
applying the negative margin due to the div being position: absolute; without positioning, it works fine.
Comment 5 Eric Seidel (no email) 2005-12-28 02:20:57 PST
The test case could be made slightly more self-documentary.  Regardless, this is still clearly a bug in TOT.  
Regressions are p1s according to the guidelines.
Comment 6 Darin Adler 2006-01-21 20:43:13 PST
Created attachment 5825 [details]
an even-better reduction that shows the problem
Comment 7 Darin Adler 2006-01-21 20:54:46 PST
The problem seems to be that RenderBox::calcVerticalMargins is never called for a positioned block, so the code thinks it has a marginTop of 0.
Comment 8 Darin Adler 2006-01-22 11:21:50 PST
Created attachment 5842 [details]
patch to fix the problem (negative top margins in position: absolute case)
Comment 9 Darin Adler 2006-01-22 11:29:22 PST
Created attachment 5843 [details]
patch without the extra file (KWQListBox.mm) in it
Comment 10 Maciej Stachowiak 2006-01-22 13:48:29 PST
Comment on attachment 5843 [details]
patch without the extra file (KWQListBox.mm) in it

looks good
Comment 11 Eric Seidel (no email) 2006-01-31 21:20:30 PST
Removing Regression keyword from bugs already fixed.