Bug 15286
Summary: | position:absolute causes div width to collapse | ||
---|---|---|---|
Product: | WebKit | Reporter: | Anantha Keesara <anantha> |
Component: | Evangelism | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | jensimmons, mitz, webkit |
Priority: | P2 | ||
Version: | 523.x (Safari 3) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://www.suberic.net/pooka/screenshot.html |
Anantha Keesara
Specifying a style "position:absolute" on a div in Safari causes its width to collapse. FF and IE both keep the div width at 100% by default even when specifying absolute position.
http://help.improve.safari.googlepages.com/absolute_width_collapse_1.html
Another testcase:
http://help.improve.safari.googlepages.com/absolute_width_collapse_2.html
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
mitz
Looks like bug 11946 again (see also bug 15272).
Robert Blaut
It isn't a bug. Webkit and Firefox 3 correctly resolves width for position: absolute using "shrink to fit" method:
"Calculation of the shrink-to-fit width is similar to calculating the width of a table cell using the automatic table layout algorithm. Roughly: calculate the preferred width by formatting the content without breaking lines other than where explicit line breaks occur, and also calculate the preferred minimum width, e.g., by trying all possible line breaks. [...]
Then the shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width)."
[http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width]
Confirmed as an evangelism bug.