Changeset 29039 in webkit


Ignore:
Timestamp:
Dec 30, 2007 9:05:52 AM (16 years ago)
Author:
ddkilzer@apple.com
Message:

WebCore:

Reviewed by Darin.

The problem occurs when a replaced element (image, canvas, etc.) with
a percent-height attribute is contained by a table cell with an auto-
or percent-height attribute. If there are no other conditions to cause
the table cell's height to expand, an available height of zero will
always be returned. In these cases, the intrinsic height of the
replaced element should be used if it is greater than the available
height of the table cell.

Tests: fast/replaced/table-percent-height.html

tables/mozilla/bugs/bug137388-1.html
tables/mozilla/bugs/bug137388-2.html

  • rendering/RenderBox.cpp: (WebCore::RenderBox::calcReplacedHeightUsing):

LayoutTests:

Reviewed by Darin.

This test was added specifically for this bug. It tests the height of
replaced elements (canvas, embed, img, object, button, input, isindex,
select, textarea ) within table cells.

  • fast/replaced/table-percent-height-expected.txt: Added.
  • fast/replaced/table-percent-height.html: Added.

These test results were updated because they are more correct.

  • platform/mac/fast/replaced/width100percent-image-expected.checksum: Updated.
  • platform/mac/fast/replaced/width100percent-image-expected.png: Updated.
  • platform/mac/fast/replaced/width100percent-image-expected.txt: Updated.

Moved tests and results for these two tests from tables/mozilla_expected_failures/bugs
to tables/mozilla/bugs since these results have been fixed.

  • platform/mac/tables/mozilla/bugs/bug137388-1-expected.checksum: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.checksum.
  • platform/mac/tables/mozilla/bugs/bug137388-1-expected.png: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.png.
  • platform/mac/tables/mozilla/bugs/bug137388-1-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt.
  • platform/mac/tables/mozilla/bugs/bug137388-2-expected.checksum: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.checksum.
  • platform/mac/tables/mozilla/bugs/bug137388-2-expected.png: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.png.
  • platform/mac/tables/mozilla/bugs/bug137388-2-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt.
  • platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.checksum: Removed.
  • platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.png: Removed.
  • platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt: Removed.
  • platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.checksum: Removed.
  • platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.png: Removed.
  • platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt: Removed.
  • tables/mozilla/bugs/bug137388-1.html: Copied from LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-1.html.
  • tables/mozilla/bugs/bug137388-2.html: Copied from LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-2.html.
  • tables/mozilla_expected_failures/bugs/bug137388-1.html: Removed.
  • tables/mozilla_expected_failures/bugs/bug137388-2.html: Removed.
Location:
trunk
Files:
2 added
6 edited
8 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r29036 r29039  
     12007-12-30  David Kilzer  <ddkilzer@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=15359
     6          JPEG image not shown when height is specified as percentage inside a table
     7
     8        This test was added specifically for this bug.  It tests the height of
     9        replaced elements (canvas, embed, img, object, button, input, isindex,
     10        select, textarea ) within table cells.
     11
     12        * fast/replaced/table-percent-height-expected.txt: Added.
     13        * fast/replaced/table-percent-height.html: Added.
     14
     15        These test results were updated because they are more correct.
     16
     17        * platform/mac/fast/replaced/width100percent-image-expected.checksum: Updated.
     18        * platform/mac/fast/replaced/width100percent-image-expected.png: Updated.
     19        * platform/mac/fast/replaced/width100percent-image-expected.txt: Updated.
     20
     21        Moved tests and results for these two tests from tables/mozilla_expected_failures/bugs
     22        to tables/mozilla/bugs since these results have been fixed.
     23
     24        * platform/mac/tables/mozilla/bugs/bug137388-1-expected.checksum: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.checksum.
     25        * platform/mac/tables/mozilla/bugs/bug137388-1-expected.png: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.png.
     26        * platform/mac/tables/mozilla/bugs/bug137388-1-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt.
     27        * platform/mac/tables/mozilla/bugs/bug137388-2-expected.checksum: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.checksum.
     28        * platform/mac/tables/mozilla/bugs/bug137388-2-expected.png: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.png.
     29        * platform/mac/tables/mozilla/bugs/bug137388-2-expected.txt: Copied from LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt.
     30        * platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.checksum: Removed.
     31        * platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.png: Removed.
     32        * platform/mac/tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt: Removed.
     33        * platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.checksum: Removed.
     34        * platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.png: Removed.
     35        * platform/mac/tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt: Removed.
     36        * tables/mozilla/bugs/bug137388-1.html: Copied from LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-1.html.
     37        * tables/mozilla/bugs/bug137388-2.html: Copied from LayoutTests/tables/mozilla_expected_failures/bugs/bug137388-2.html.
     38        * tables/mozilla_expected_failures/bugs/bug137388-1.html: Removed.
     39        * tables/mozilla_expected_failures/bugs/bug137388-2.html: Removed.
     40
    1412007-12-30  Eric Seidel  <eric@webkit.org>
    242
  • trunk/LayoutTests/platform/mac/fast/replaced/width100percent-image-expected.checksum

    r26026 r29039  
    1 f89073ae59d9de162f88907713fd1701
     19ea40e2b30dc6ac9e68461729ccd6dbe
  • trunk/LayoutTests/platform/mac/fast/replaced/width100percent-image-expected.txt

    r25970 r29039  
    1 layer at (0,0) size 800x600
    2   RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x600
    4   RenderBlock {HTML} at (0,0) size 800x600
    5     RenderBody {BODY} at (8,8) size 784x584
    6       RenderBlock (anonymous) at (0,0) size 784x36
     1layer at (0,0) size 785x646
     2  RenderView at (0,0) size 785x600
     3layer at (0,0) size 785x646
     4  RenderBlock {HTML} at (0,0) size 785x646
     5    RenderBody {BODY} at (8,8) size 769x630
     6      RenderBlock (anonymous) at (0,0) size 769x36
    77        RenderText {#text} at (0,0) size 761x36
    88          text run at (0,0) width 718: "The following elements behave differently in different browsers. Our current behavior will cause them to overlap, "
    99          text run at (718,0) width 43: "but we"
    1010          text run at (0,18) width 236: "may need to change this in the future."
    11       RenderTable {TABLE} at (0,36) size 784x279
    12         RenderTableSection {TBODY} at (0,0) size 784x279
    13           RenderTableRow {TR} at (0,1) size 784x277
     11      RenderTable {TABLE} at (0,36) size 769x279
     12        RenderTableSection {TBODY} at (0,0) size 769x279
     13          RenderTableRow {TR} at (0,1) size 769x277
    1414            RenderTableCell {TD} at (1,1) size 216x277 [r=0 c=0 rs=1 cs=1]
    1515              RenderImage {IMG} at (1,1) size 214x275
     
    1818            RenderTableCell {TD} at (221,1) size 2x277 [r=0 c=2 rs=1 cs=1]
    1919              RenderImage {IMG} at (1,1) size 214x275
    20             RenderTableCell {TD} at (224,129) size 559x20 [r=0 c=3 rs=1 cs=1]
     20            RenderTableCell {TD} at (224,129) size 544x20 [r=0 c=3 rs=1 cs=1]
    2121              RenderText {#text} at (1,1) size 4x18
    2222                text run at (1,1) width 4: " "
    23       RenderBlock (anonymous) at (0,315) size 784x36
     23      RenderBlock (anonymous) at (0,315) size 769x36
    2424        RenderBR {BR} at (0,0) size 0x18
    2525        RenderBR {BR} at (0,18) size 0x18
    26       RenderTable {TABLE} at (0,351) size 784x22
    27         RenderTableSection {TBODY} at (0,0) size 784x22
    28           RenderTableRow {TR} at (0,1) size 784x20
    29             RenderTableCell {TD} at (1,2) size 2x18 [r=0 c=0 rs=1 cs=1]
    30               RenderImage {IMG} at (1,1) size 12x16
    31             RenderTableCell {TD} at (4,2) size 2x18 [r=0 c=1 rs=1 cs=1]
    32               RenderImage {IMG} at (1,1) size 12x16
    33             RenderTableCell {TD} at (7,2) size 2x18 [r=0 c=2 rs=1 cs=1]
    34               RenderImage {IMG} at (1,1) size 12x16
    35             RenderTableCell {TD} at (10,1) size 773x20 [r=0 c=3 rs=1 cs=1]
     26      RenderTable {TABLE} at (0,351) size 769x279
     27        RenderTableSection {TBODY} at (0,0) size 769x279
     28          RenderTableRow {TR} at (0,1) size 769x277
     29            RenderTableCell {TD} at (1,1) size 216x277 [r=0 c=0 rs=1 cs=1]
     30              RenderImage {IMG} at (1,1) size 214x275
     31            RenderTableCell {TD} at (218,1) size 2x277 [r=0 c=1 rs=1 cs=1]
     32              RenderImage {IMG} at (1,1) size 214x275
     33            RenderTableCell {TD} at (221,1) size 2x277 [r=0 c=2 rs=1 cs=1]
     34              RenderImage {IMG} at (1,1) size 214x275
     35            RenderTableCell {TD} at (224,129) size 544x20 [r=0 c=3 rs=1 cs=1]
    3636              RenderText {#text} at (1,1) size 4x18
    3737                text run at (1,1) width 4: " "
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug137388-1-expected.checksum

    r29000 r29039  
    1 2d702da0cfe428a56645653acf133bf4
     12ecef9a92c360acfc42f67f5c666c3b1
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug137388-1-expected.txt

    r29000 r29039  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderTable {TABLE} at (0,0) size 310x10
    7         RenderTableSection {TBODY} at (0,0) size 310x10
    8           RenderTableRow {TR} at (0,2) size 310x6
    9             RenderTableCell {TD} at (2,2) size 306x6 [r=0 c=0 rs=1 cs=1]
    10               RenderPartObject {IFRAME} at (1,1) size 308x4 [border: (2px inset #000000)]
    11                 layer at (0,0) size 304x0
    12                   RenderView at (0,0) size 304x0
     6      RenderTable {TABLE} at (0,0) size 310x156
     7        RenderTableSection {TBODY} at (0,0) size 310x156
     8          RenderTableRow {TR} at (0,2) size 310x152
     9            RenderTableCell {TD} at (2,2) size 306x152 [r=0 c=0 rs=1 cs=1]
     10              RenderPartObject {IFRAME} at (1,1) size 308x150 [border: (2px inset #000000)]
     11                layer at (0,0) size 304x146
     12                  RenderView at (0,0) size 304x146
    1313                layer at (0,0) size 304x0
    1414                  RenderBlock {HTML} at (0,0) size 304x0
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug137388-2-expected.checksum

    r29000 r29039  
    1 3b98726707a77802b3062b455c75ab57
     13c5e8d131ceca043e632b50061450025
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug137388-2-expected.txt

    r29000 r29039  
    1 layer at (0,0) size 785x648
     1layer at (0,0) size 785x852
    22  RenderView at (0,0) size 785x600
    3 layer at (0,0) size 785x648
    4   RenderBlock {HTML} at (0,0) size 785x648
    5     RenderBody {BODY} at (8,8) size 769x632
     3layer at (0,0) size 785x852
     4  RenderBlock {HTML} at (0,0) size 785x852
     5    RenderBody {BODY} at (8,8) size 769x836
    66      RenderTable {TABLE} at (0,0) size 310x310
    77        RenderTableSection {TBODY} at (0,0) size 310x310
     
    2020              RenderImage {IMG} at (1,1) size 600x300
    2121              RenderText {#text} at (0,0) size 0x0
    22       RenderTable {TABLE} at (0,616) size 310x10
    23         RenderTableSection {TBODY} at (0,0) size 310x10
    24           RenderTableRow {TR} at (0,2) size 310x6
    25             RenderTableCell {TD} at (2,2) size 306x6 [r=0 c=0 rs=1 cs=1]
    26               RenderPartObject {IFRAME} at (1,1) size 308x4 [border: (2px inset #000000)]
    27                 layer at (0,0) size 304x0
    28                   RenderView at (0,0) size 304x0
     22      RenderTable {TABLE} at (0,616) size 310x156
     23        RenderTableSection {TBODY} at (0,0) size 310x156
     24          RenderTableRow {TR} at (0,2) size 310x152
     25            RenderTableCell {TD} at (2,2) size 306x152 [r=0 c=0 rs=1 cs=1]
     26              RenderPartObject {IFRAME} at (1,1) size 308x150 [border: (2px inset #000000)]
     27                layer at (0,0) size 304x146
     28                  RenderView at (0,0) size 304x146
    2929                layer at (0,0) size 304x0
    3030                  RenderBlock {HTML} at (0,0) size 304x0
    3131              RenderText {#text} at (0,0) size 0x0
    32       RenderTable {TABLE} at (0,626) size 606x6
    33         RenderTableSection {TBODY} at (0,0) size 606x6
    34           RenderTableRow {TR} at (0,2) size 606x2
    35             RenderTableCell {TD} at (2,2) size 602x2 [r=0 c=0 rs=1 cs=1]
    36               RenderImage {IMG} at (1,1) size 600x0
     32      RenderTable {TABLE} at (0,772) size 606x64
     33        RenderTableSection {TBODY} at (0,0) size 606x64
     34          RenderTableRow {TR} at (0,2) size 606x60
     35            RenderTableCell {TD} at (2,2) size 602x60 [r=0 c=0 rs=1 cs=1]
     36              RenderImage {IMG} at (1,1) size 600x58
    3737              RenderText {#text} at (0,0) size 0x0
  • trunk/WebCore/ChangeLog

    r29037 r29039  
     12007-12-30  David Kilzer  <ddkilzer@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=15359
     6          JPEG image not shown when height is specified as percentage inside a table
     7
     8        The problem occurs when a replaced element (image, canvas, etc.) with
     9        a percent-height attribute is contained by a table cell with an auto-
     10        or percent-height attribute.  If there are no other conditions to cause
     11        the table cell's height to expand, an available height of zero will
     12        always be returned.  In these cases, the intrinsic height of the
     13        replaced element should be used if it is greater than the available
     14        height of the table cell.
     15
     16        Tests: fast/replaced/table-percent-height.html
     17               tables/mozilla/bugs/bug137388-1.html
     18               tables/mozilla/bugs/bug137388-2.html
     19
     20        * rendering/RenderBox.cpp:
     21        (WebCore::RenderBox::calcReplacedHeightUsing):
     22
    1232007-12-30  Luca Bruno  <lethalman88@gmail.com>
    224
  • trunk/WebCore/rendering/RenderBox.cpp

    r28778 r29039  
    14721472            // box model.  This is essential for sizing inside
    14731473            // table cells using percentage heights.
    1474             if (cb->isTableCell() && (cb->style()->height().isAuto() || cb->style()->height().isPercent()))
     1474            if (cb->isTableCell() && (cb->style()->height().isAuto() || cb->style()->height().isPercent())) {
     1475                // Don't let table cells squeeze percent-height replaced elements
     1476                // <http://bugs.webkit.org/show_bug.cgi?id=15359>
     1477                availableHeight = max(availableHeight, intrinsicSize().height());
    14751478                return height.calcValue(availableHeight - (borderTop() + borderBottom()
    14761479                    + paddingTop() + paddingBottom()));
     1480            }
    14771481
    14781482            return calcContentBoxHeight(height.calcValue(availableHeight));
Note: See TracChangeset for help on using the changeset viewer.