Changeset 70619 in webkit


Ignore:
Timestamp:
Oct 27, 2010 1:18:48 AM (13 years ago)
Author:
aestes@apple.com
Message:

2010-10-27 Andy Estes <aestes@apple.com>

Reviewed by David Hyatt.

Siblings of floated elements should be cleared below the float if they
are too wide to fit in the containing block.
https://bugs.webkit.org/show_bug.cgi?id=48396

Test: fast/block/float/clear-element-too-wide-for-containing-block.html

WebKit did not clear elements adjacent to floats if they were wider than
the containing block, instead keeping them on the same line and allowing
them to spill out the right side of the containing block. We should
match the spec in this regard and clear the element below the float even
if it is too wide for the containing block. Doing this seems to also
match IE's and Firefox's behavior.

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::getClearDelta): Continue to compute the clear delta even if the child's minimum preferred width is greater than the containing block's available width.

2010-10-27 Andy Estes <aestes@apple.com>

Reviewed by David Hyatt.

Siblings of floated elements should be cleared below the float if they
are too wide to fit in the containing block.
https://bugs.webkit.org/show_bug.cgi?id=48396

  • fast/block/float/clear-element-too-wide-for-containing-block.html: Copied from LayoutTests/fast/block/float/tableshifting.html.
  • fast/block/float/tableshifting.html: Removed.
  • platform/mac/fast/block/float/clear-element-too-wide-for-containing-block-expected.checksum: Added.
  • platform/mac/fast/block/float/clear-element-too-wide-for-containing-block-expected.png: Added.
  • platform/mac/fast/block/float/clear-element-too-wide-for-containing-block-expected.txt: Added.
  • platform/mac/fast/block/float/tableshifting-expected.checksum: Removed.
  • platform/mac/fast/block/float/tableshifting-expected.png: Removed.
  • platform/mac/fast/block/float/tableshifting-expected.txt: Removed.
Location:
trunk
Files:
3 added
3 deleted
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70618 r70619  
     12010-10-27  Andy Estes  <aestes@apple.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        Siblings of floated elements should be cleared below the float if they
     6        are too wide to fit in the containing block.
     7        https://bugs.webkit.org/show_bug.cgi?id=48396
     8
     9        * fast/block/float/clear-element-too-wide-for-containing-block.html: Copied from LayoutTests/fast/block/float/tableshifting.html.
     10        * fast/block/float/tableshifting.html: Removed.
     11        * platform/mac/fast/block/float/clear-element-too-wide-for-containing-block-expected.checksum: Added.
     12        * platform/mac/fast/block/float/clear-element-too-wide-for-containing-block-expected.png: Added.
     13        * platform/mac/fast/block/float/clear-element-too-wide-for-containing-block-expected.txt: Added.
     14        * platform/mac/fast/block/float/tableshifting-expected.checksum: Removed.
     15        * platform/mac/fast/block/float/tableshifting-expected.png: Removed.
     16        * platform/mac/fast/block/float/tableshifting-expected.txt: Removed.
     17
    1182010-10-27  Csaba Osztrogonác  <ossy@webkit.org>
    219
  • trunk/LayoutTests/fast/block/float/clear-element-too-wide-for-containing-block.html

    r70589 r70619  
    11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
    22<html xmlns="http://www.w3.org/1999/xhtml">
    3   <head>
     3<head>
     4<style>
    45
    5     <title>Jeffrey Zeldman Presents: The Daily Report</title>
    6 
    7 <style>
    8        
    9 #bravefourhundred {
    10         width: 385px;
     6#container {
     7    width: 385px;
    118}
    129
     
    2017
    2118</style>
    22 
    23 
    24 
    25   </head>
     19</head>
    2620
    2721<body>
    28 <div id="bravefourhundred">
    29 <div>The yellow block should be to the right of the green block.</div>
     22<div id="container">
     23<div>The yellow block should be below the green block.</div>
    3024<div class="foo"></div><img width="395" height="275" border="0">
    3125</div>
    3226</body>
    3327</html>
     28
  • trunk/WebCore/ChangeLog

    r70617 r70619  
     12010-10-27  Andy Estes  <aestes@apple.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        Siblings of floated elements should be cleared below the float if they
     6        are too wide to fit in the containing block.
     7        https://bugs.webkit.org/show_bug.cgi?id=48396
     8
     9        Test: fast/block/float/clear-element-too-wide-for-containing-block.html
     10
     11        WebKit did not clear elements adjacent to floats if they were wider than
     12        the containing block, instead keeping them on the same line and allowing
     13        them to spill out the right side of the containing block. We should
     14        match the spec in this regard and clear the element below the float even
     15        if it is too wide for the containing block. Doing this seems to also
     16        match IE's and Firefox's behavior.
     17
     18        * rendering/RenderBlock.cpp:
     19        (WebCore::RenderBlock::getClearDelta): Continue to compute the clear
     20        delta even if the child's minimum preferred width is greater than the
     21        containing block's available width.
     22
    1232010-10-26  Rob Buis  <rwlbuis@gmail.com>
    224
  • trunk/WebCore/rendering/RenderBlock.cpp

    r70482 r70619  
    40414041    int result = clearSet ? max(0, bottom - yPos) : 0;
    40424042    if (!result && child->avoidsFloats()) {
    4043         int availableWidth = availableLogicalWidth();
    4044         if (child->minPreferredLogicalWidth() > availableWidth)
    4045             return 0;
    4046 
    40474043        int y = yPos;
    40484044        while (true) {
    40494045            int widthAtY = availableLogicalWidthForLine(y, false);
    4050             if (widthAtY == availableWidth)
     4046            if (widthAtY == availableLogicalWidth())
    40514047                return y - yPos;
    40524048
Note: See TracChangeset for help on using the changeset viewer.