Commit 6f7d9fb7 authored by hyatt@apple.com's avatar hyatt@apple.com
Browse files

<rdar://problem/8479998> REGRESSION (r67660): broken button layout at devforums.apple.com

        
Reviewed by Dan Bernstein.

Exclude floating objects from shrinking to avoid floats.  They should never do this.  Timing-related bugs could
occur as a result of this mistake, and the change to rewrite pagination to defer layout of floats until they
got encountered on the correct line exposed this issue.

Source/WebCore: 

Added /fast/block/float/float-overflow-hidden-containing-block-width.html.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::shrinkToAvoidFloats):

LayoutTests: 

Added /fast/block/float/float-overflow-hidden-containing-block-width.html.
* fast/block/float/float-overflow-hidden-containing-block-width.html: Added.
* platform/mac/fast/block/float/float-overflow-hidden-containing-block-width-expected.checksum: Added.
* platform/mac/fast/block/float/float-overflow-hidden-containing-block-width-expected.png: Added.
* platform/mac/fast/block/float/float-overflow-hidden-containing-block-width-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3fd9a593
2011-01-18 David Hyatt <hyatt@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/8479998> REGRESSION (r67660): broken button layout at devforums.apple.com
Exclude floating objects from shrinking to avoid floats. They should never do this. Timing-related bugs could
occur as a result of this mistake, and the change to rewrite pagination to defer layout of floats until they
got encountered on the correct line exposed this issue.
Added /fast/block/float/float-overflow-hidden-containing-block-width.html.
* fast/block/float/float-overflow-hidden-containing-block-width.html: Added.
* platform/mac/fast/block/float/float-overflow-hidden-containing-block-width-expected.checksum: Added.
* platform/mac/fast/block/float/float-overflow-hidden-containing-block-width-expected.png: Added.
* platform/mac/fast/block/float/float-overflow-hidden-containing-block-width-expected.txt: Added.
2011-01-18 Dmitry Titov <dimich@chromium.org>
 
[Chromium] Not reviewed, updated expectations for tests
......
<html>
<head>
<style>
.topfloat { float:right;height:22px;width:126px;overflow:hidden; background-color:orange }
.clearingfloat { clear:both;float:right; overflow:hidden }
span { float:left;overflow:hidden;height:26px;width:22px;background-color:purple }
</style>
</head>
<body>
<div style="position:absolute;">
<div class="topfloat"></div>
<div class="clearingfloat">
<span></span>
<span></span>
</div>
</div>
<script type="text/javascript">
document.body.offsetLeft;
</script>
</body>
</html>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
layer at (8,8) size 126x48
RenderBlock (positioned) {DIV} at (8,8) size 126x48
layer at (8,8) size 126x22
RenderBlock (floating) {DIV} at (0,0) size 126x22 [bgcolor=#FFA500]
layer at (90,30) size 44x26
RenderBlock (floating) {DIV} at (82,22) size 44x26
layer at (90,30) size 22x26
RenderBlock (floating) {SPAN} at (0,0) size 22x26 [bgcolor=#800080]
layer at (112,30) size 22x26
RenderBlock (floating) {SPAN} at (22,0) size 22x26 [bgcolor=#800080]
2011-01-18 David Hyatt <hyatt@apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/8479998> REGRESSION (r67660): broken button layout at devforums.apple.com
Exclude floating objects from shrinking to avoid floats. They should never do this. Timing-related bugs could
occur as a result of this mistake, and the change to rewrite pagination to defer layout of floats until they
got encountered on the correct line exposed this issue.
Added /fast/block/float/float-overflow-hidden-containing-block-width.html.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::shrinkToAvoidFloats):
2011-01-18 Zhenyao Mo <zmo@google.com>
 
Reviewed by Kenneth Russell.
......@@ -3073,14 +3073,12 @@ VisiblePosition RenderBox::positionForPoint(const IntPoint& point)
bool RenderBox::shrinkToAvoidFloats() const
{
// FIXME: Technically we should be able to shrink replaced elements on a line, but this is difficult to accomplish, since this
// involves doing a relayout during findNextLineBreak and somehow overriding the containingBlockWidth method to return the
// current remaining width on a line.
if ((isInline() && !isHTMLMarquee()) || !avoidsFloats())
// Floating objects don't shrink. Objects that don't avoid floats don't shrink. Marquees don't shrink.
if ((isInline() && !isHTMLMarquee()) || !avoidsFloats() || isFloating())
return false;
// All auto-width objects that avoid floats should always use lineWidth.
return style()->width().isAuto();
return style()->width().isAuto();
}
bool RenderBox::avoidsFloats() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment