Changeset 97635 in webkit


Ignore:
Timestamp:
Oct 17, 2011 11:20:38 AM (12 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/10293929> REGRESSION (r97525): iChat transcript has horizontal scroll bar when the conversation includes a wide image
https://bugs.webkit.org/show_bug.cgi?id=70204

Reviewed by Darin Adler.

Source/WebCore:

Reverted r97525, which was supposed to fix <http://webkit.org/b/29447>.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):

  • rendering/RenderBox.h:

LayoutTests:

  • fast/replaced/table-percent-width-expected.txt: Updated the results to

show that this test is failing after reverting r97525.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r97632 r97635  
     12011-10-17  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10293929> REGRESSION (r97525): iChat transcript has horizontal scroll bar when the conversation includes a wide image
     4        https://bugs.webkit.org/show_bug.cgi?id=70204
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/replaced/table-percent-width-expected.txt: Updated the results to
     9        show that this test is failing after reverting r97525.
     10
    1112011-10-17  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/LayoutTests/fast/replaced/table-percent-width-expected.txt

    r97525 r97635  
    1616PASS getWidth('img-3') is '40px'
    1717PASS getHeight('img-3') is '40px'
    18 PASS getWidth('img-4') is '36px'
    19 PASS getHeight('img-4') is '36px'
     18FAIL getWidth('img-4') should be 36px. Was 98px.
     19FAIL getHeight('img-4') should be 36px. Was 98px.
    2020PASS getWidth('img-5') is '40px'
    21 PASS getHeight('img-5') is '36px'
     21FAIL getHeight('img-5') should be 36px. Was 98px.
    2222PASS successfullyParsed is true
    2323
  • trunk/Source/WebCore/ChangeLog

    r97633 r97635  
     12011-10-17  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10293929> REGRESSION (r97525): iChat transcript has horizontal scroll bar when the conversation includes a wide image
     4        https://bugs.webkit.org/show_bug.cgi?id=70204
     5
     6        Reviewed by Darin Adler.
     7
     8        Reverted r97525, which was supposed to fix <http://webkit.org/b/29447>.
     9
     10        * rendering/RenderBox.cpp:
     11        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
     12        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
     13        * rendering/RenderBox.h:
     14
    1152011-10-17  Ada Chan  <adachan@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r97525 r97635  
    12721272}
    12731273
    1274 enum IntrinsicDimension { LogicalHeightDimension, LogicalWidthDimension };
    1275 
    1276 static bool shouldExpandToIntrinsicDimension(RenderBlock* cb, IntrinsicDimension dimension)
    1277 {
    1278     // This function allows images to size correctly to their intrinsic height/width when inside table cells
    1279     // that only have percent or auto height/width.
    1280     // It's only interested in inspecting as far as the containing table, if there is one.
    1281     bool inTableCell = false;
    1282     while (cb && !cb->isRenderView()) {
    1283         if (cb->isTableCell())
    1284             inTableCell = true;
    1285 
    1286         if (dimension == LogicalHeightDimension && !cb->style()->logicalHeight().isAuto() && !cb->style()->logicalHeight().isPercent())
    1287             return false;
    1288         if (dimension == LogicalWidthDimension && !cb->style()->logicalWidth().isAuto() && !cb->style()->logicalWidth().isPercent())
    1289             return false;
    1290 
    1291         if (cb->isTable())
    1292             break;
    1293 
    1294         cb = cb->containingBlock();
    1295     }
    1296     return inTableCell;
    1297 }
    1298 
    1299 LayoutUnit RenderBox::containingBlockReplacedLogicalWidthForContent() const
    1300 {
    1301     RenderBlock* cb = containingBlock();
    1302     if (shouldExpandToIntrinsicDimension(cb, LogicalWidthDimension))
    1303         return max(shrinkToAvoidFloats() ? cb->availableLogicalWidthForLine(logicalTop(), false) : cb->availableLogicalWidth(), intrinsicLogicalWidth());
    1304     return containingBlockLogicalWidthForContent();
    1305 }
    1306 
    13071274LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const
    13081275{
     
    22112178            // containing block's block-flow.
    22122179            // https://bugs.webkit.org/show_bug.cgi?id=46496
    2213             const LayoutUnit cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockReplacedLogicalWidthForContent();
     2180            const LayoutUnit cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent();
    22142181            if (cw > 0)
    22152182                return computeContentBoxLogicalWidth(logicalWidth.calcMinValue(cw));
     
    22712238                // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
    22722239                // https://bugs.webkit.org/show_bug.cgi?id=46997
    2273                 if (shouldExpandToIntrinsicDimension(toRenderBlock(cb), LogicalHeightDimension)) {
    2274                     availableHeight = max(availableHeight, intrinsicLogicalHeight());
    2275                     return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
     2240                while (cb && !cb->isRenderView() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) {
     2241                    if (cb->isTableCell()) {
     2242                        // Don't let table cells squeeze percent-height replaced elements
     2243                        // <http://bugs.webkit.org/show_bug.cgi?id=15359>
     2244                        availableHeight = max(availableHeight, intrinsicLogicalHeight());
     2245                        return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
     2246                    }
     2247                    cb = cb->containingBlock();
    22762248                }
    22772249            }
  • trunk/Source/WebCore/rendering/RenderBox.h

    r97525 r97635  
    298298    LayoutUnit containingBlockLogicalWidthForContentInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
    299299    LayoutUnit perpendicularContainingBlockLogicalHeight() const;
    300     LayoutUnit containingBlockReplacedLogicalWidthForContent() const;
    301300   
    302301    virtual void computeLogicalWidth();
Note: See TracChangeset for help on using the changeset viewer.