On Tue, Jun 10, 2008 at 10:02 AM, Timothy Armes wrote:
>
> I'm struggling with a Safari float shrinking problem and I'm
> desperately seeking a solution.  I've spent days on the issue now.
>
> I have a floated container containing floated fixed sized divs. On FF
> the container shrinks to fit the contents, as is correct for a
> widthless float. In Safari however the container isn't shrinking, it's
> taking up 100% of the available width.
[...]
>
> When the window is wide enough to display the 3 blocks the behaviour
> is as expected and the container shrink wraps the floats. However,
> when the window is made narrower we see that the container takes up
> the full width of the window when it should still be shrinking to fit
> the contents, as it does on FF.
>
> You can also see the bug  in action here:
>
> http://www.timothyarmes.com/gallery.php?lang=en-gb&sec=personal

On the above page, what you see in Safari occurs in Firefox 3 beta as
well. And I believe it is not wrong according to the definition of the
shrink-to-fit algorithm in the spec [1].  When the "preferred width"
(no inserted line breaks) cannot be used because it is greater than
the available width, then the width "jumps" to the latter. In other
words, roughly speaking, the spec says: fit the content if you don't
need to break it, but as soon as you need to break some lines then use
all the available width.
Once line breaks are determined you would like to have a sort of extra
step to fit the placed contents. This 'extra fit' (not required by the
spec) is done by Opera (and by FF2), and it would indeed be sometimes
desirable, but I don't know how to get it with current CSS.

Bruno


[1] http://www.w3.org/TR/CSS21/visudet.html#float-width

-- 
Bruno Fassino http://www.brunildo.org/test
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to