Closed Bug 543052 Opened 14 years ago Closed 14 years ago

Legend element is ignoring parent position property when positioned absolutely

Categories

(Core :: Layout: Form Controls, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 450418

People

(Reporter: dgavey, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 FirePHP/0.4
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6

Up till the latest production version of FF 3.6 the legend element was being properly positioned.  But not since FF3.6 or in the latest development release.

If the legend element is position using absolute co-ordinates, and the Fieldset has position:relative applied, the legend element should be measuring from the top of the fieldset.  But it is not.  It is dropping down about 20px and starting the absolute positioning from there.

All other modern browsers I have tested on, more or less gets this right. (Within a few pixels anyway)

I have submitted a very stripped down test case url that you can test browsers with.  It has just enough to show the bug off.

I have also tested with numerous doctype declarations and they all do the same thing.

Reproducible: Always

Steps to Reproduce:
Visit Test case URL.  http://gavey.ca/Testlegend.html
Actual Results:  
The legend element is dropped by about 20 px

Expected Results:  
The legend element should sit at the top of the Fieldset element.
Right I forgot to say I have gotten other people to test of Windows FF3.6 and it does the same thing to them as well.
This isn't an issue with legend, but with fieldset.  

In Firefox 3.5 and earlier, position was always forced to "static" on <legend>, no matter how you style it....
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Oh, and setting padding-top to 0 on the fieldset should give you the behavior you're probably looking for....
This is similar but not a repeat of bug 450418.  This bug only started showing up on FF 3.6 in the last week, the previous versions of firefox back to 3.0 did not render this form in this way.

And yes setting padding-top:0; does fix the problem, but absolute positioning should not be affected by padding values.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
> This bug only started showing up on FF 3.6 in the last week

Yes, see comment 2 second paragraph.  Before Firefox 3.6 the legend just wasn't being positioned at all.  Try changing your top/left values for the legend and observe the behavior in 3.5.  Then try setting position:static in both 3.5 and 3.6 being identical.

> but absolute positioning should not be affected by padding values.

Yes, that's what bug 450418 is about.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → DUPLICATE
(In reply to comment #5)

Ok I see, so because the Legend is now "not" being forced to static, the old bug is now applied to Legend as well.  I understand.  Still, no fix of this from the original bug report in 2008.  I can work around it, but it seems like no fix is in sight.  Perhaps, I will have to actually brush up on my c++ skills.  So would this be a gecko engine bug I would have to find?
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Yeah, the basic issue is described in bug 455338.  Right now only block boxes can be absolute positioning blocks in Gecko, and unfortunately the block box inside a fieldset is inside the fieldset padding.

If you didn't actually mean to reopen the bug (which I hope is the case, since it needs to be fixed in bug 450418 or bug 455338), please force-reload before replying so you don't reset the status?
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → DUPLICATE
Nope didn't mean to re-open it, sorry bout that, just didn't refresh the page.  The only reason I am using absolute positioning on the legend in the first place is to fix a IE rendering error, ah the life of a web designer.  I have fixed it in firefox by using some CSS3 selectors that IE wont understand.  Thanks for helping find that dupe, I tried really hard to find it, but I was looking for the wrong html element I guess.
You need to log in before you can comment on or make changes to this bug.