Changeset 85499 in webkit


Ignore:
Timestamp:
May 2, 2011 11:50:41 AM (13 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/7972529> Images with percentage based height/max-height are missing when they are inside blocks inside tables
https://bugs.webkit.org/show_bug.cgi?id=58006

Reviewed by Simon Fraser.

Source/WebCore:

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeReplacedLogicalHeightUsing): Expanded the scope of the fix for
<http://webkit.org/b/15359> from r29039 to cover not just the case of a auto-or-percent-height
table cell as the immediate containing block, but any case where all containing block ancestors
up to and including a table cell are auto-or-percent height.

LayoutTests:

  • fast/replaced/table-percent-height-expected.txt: Updated.
  • fast/replaced/table-percent-height.html: Added a test case with a replaced object nested in an

auto-height block inside a table cell.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85495 r85499  
     12011-05-02  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        <rdar://problem/7972529> Images with percentage based height/max-height are missing when they are inside blocks inside tables
     6        https://bugs.webkit.org/show_bug.cgi?id=58006
     7
     8        * fast/replaced/table-percent-height-expected.txt: Updated.
     9        * fast/replaced/table-percent-height.html: Added a test case with a replaced object nested in an
     10        auto-height block inside a table cell.
     11
    1122011-05-02  Daniel Bates  <dbates@webkit.org>
    213
  • trunk/LayoutTests/fast/replaced/table-percent-height-expected.txt

    r67770 r85499  
     1
     2
    13
    24
     
    4143PASS getWidth('img-100') is '100px'
    4244PASS getHeight('img-100') is '100px'
     45PASS getWidth('img-75-nested') is '75px'
     46PASS getHeight('img-75-nested') is '75px'
     47PASS getWidth('img-100-nested') is '100px'
     48PASS getHeight('img-100-nested') is '100px'
    4349PASS getWidth('object-75') is '300px'
    4450PASS getHeight('object-75') is '112px'
  • trunk/LayoutTests/fast/replaced/table-percent-height.html

    r67770 r85499  
    7777    shouldBe("getHeight('img-100')", "'100px'");
    7878
     79    shouldBe("getWidth('img-75-nested')", "'75px'");
     80    shouldBe("getHeight('img-75-nested')", "'75px'");
     81    shouldBe("getWidth('img-100-nested')", "'100px'");
     82    shouldBe("getHeight('img-100-nested')", "'100px'");
     83
    7984    shouldBe("getWidth('object-75')", "'300px'");
    8085    shouldBe("getHeight('object-75')", "'112px'");
     
    144149<table><tr><td><img id="img-100" src="resources/square-blue-100x100.png" style="height: 100%;"></td></tr></table>
    145150
     151<table><tr><td><div><img id="img-75-nested" src="resources/square-blue-100x100.png" style="height: 75%;"></div></td></tr></table>
     152<table><tr><td><div><img id="img-100-nested" src="resources/square-blue-100x100.png" style="height: 100%;"></div></td></tr></table>
     153
    146154<table><tr><td><object id="object-75" style="background-color: #00ff00; height: 75%;"></object></td></tr></table>
    147155<table><tr><td><object id="object-100" style="background-color: #00ff00; height: 100%;"></object></td></tr></table>
  • trunk/Source/WebCore/ChangeLog

    r85495 r85499  
     12011-05-02  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        <rdar://problem/7972529> Images with percentage based height/max-height are missing when they are inside blocks inside tables
     6        https://bugs.webkit.org/show_bug.cgi?id=58006
     7
     8        * rendering/RenderBox.cpp:
     9        (WebCore::RenderBox::computeReplacedLogicalHeightUsing): Expanded the scope of the fix for
     10        <http://webkit.org/b/15359> from r29039 to cover not just the case of a auto-or-percent-height
     11        table cell as the immediate containing block, but any case where all containing block ancestors
     12        up to and including a table cell are auto-or-percent height.
     13
    1142011-05-02  Daniel Bates  <dbates@webkit.org>
    215
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r85256 r85499  
    20182018            // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
    20192019            // https://bugs.webkit.org/show_bug.cgi?id=46997
    2020             if (cb->isTableCell() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) {
    2021                 // Don't let table cells squeeze percent-height replaced elements
    2022                 // <http://bugs.webkit.org/show_bug.cgi?id=15359>
    2023                 availableHeight = max(availableHeight, intrinsicLogicalHeight());
    2024                 return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
     2020            while (cb && !cb->isRenderView() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) {
     2021                if (cb->isTableCell()) {
     2022                    // Don't let table cells squeeze percent-height replaced elements
     2023                    // <http://bugs.webkit.org/show_bug.cgi?id=15359>
     2024                    availableHeight = max(availableHeight, intrinsicLogicalHeight());
     2025                    return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
     2026                }
     2027                cb = cb->containingBlock();
    20252028            }
    20262029
Note: See TracChangeset for help on using the changeset viewer.