When minimal CSS styling is applied to a form and fieldset, the fieldset layout is incorrect when rendered by Safari (412). Firefox 1.0.3 and Explorer 5.2.3 both render correctly. I will add screenshots to this bug to demonstrate the problem. The shortest amount of valid XHTML that I could write to reproduce the bug follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head><title>Test</title> <style type="text/css"> input {margin-left: .5em;float: left;} fieldset div {clear: both;margin: .1em 0;position: relative;} label, fieldset div.cr {margin: 0;display: block;width: 13em;text-align: right;float: left;} .buttons {text-align: center;float: right;} </style></head><body> <form action="login" method="post" id="loginform"> <fieldset> <div> <input checked="checked" name="existing" type="radio" value="existing" /> <label for="user_password">Yes, my password is:</label> <input type="password" name="user_password" id="user_password" size="23" /> </div> <div> <input name="existing" type="radio" value="new-home" /> <label for="user_password">No, I would like to create a home account.</label> </div> <div> <input name="existing" type="radio" value="new-business" /> <label for="user_password">No, I would like to create a business account.</label> </div> <div class="buttons"> <input type="submit" name="login" value="Login »" class="primary" /> </div> </fieldset> </form></body></html>
Created attachment 2852 [details] Safari screenshot showing incorrect rendering
Created attachment 2853 [details] Firefox screenshot showing correct rendering
Created attachment 2854 [details] Explorer screenshot showing correct rendering
Confirmed, i will attach the code below as a minimal testcase.
Created attachment 5312 [details] Test case as attachment
This really could use some further reduction.
Created attachment 5324 [details] Minimal Testcase This is very small, and should allow for some easy fixing :)
Changed NeedsReduction to HasReduction, since i just added it.
This is a fun bug. Apparently there's an unspecified behavior for fieldsets, which is that they behave in a fashion similar to floats. If the height of a fieldset is auto then it expands to encompass overhanging floats (just as an enclosing float might). This would be an interesting thing to note in the HTML5 WhatWG spec, as this behavior is not documented anywhere that I can find.
Created attachment 10510 [details] Patch that fixes the bug Create a new method, allowOverhangingFloats(), and better factor the code so that fieldsets and table cells can subclass for their respective specialized behaviors.
Comment on attachment 10510 [details] Patch that fixes the bug I would consider reversing the sense of allowOverhangingFloats and naming it something like expandsForOverhangingFloats(). In any case r=me
Fixed.
(In reply to comment #12) > Fixed. In r16319. Tests in r16320.