Changeset 51744 in webkit


Ignore:
Timestamp:
Dec 6, 2009 6:45:54 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-06 Kent Tamura <tkent@chromium.org>

Reviewed by Darin Adler.

Improve portability and readability of table-percent-height* tests.
https://bugs.webkit.org/show_bug.cgi?id=31858

The purpose of these tests is to confirm that an element with
height:N% inside a table cell has non-zero height. We don't need
to check concrete pixel sizes of form controls.

This updates the tests so that they check heights are non-zero and
75% heights are same as corresponding 100% heights or actually 75%.

  • fast/replaced/table-percent-height-expected.txt:
  • fast/replaced/table-percent-height-text-controls-expected.txt:
  • fast/replaced/table-percent-height-text-controls.html:
  • fast/replaced/table-percent-height.html:
Location:
trunk/LayoutTests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51743 r51744  
     12009-12-06  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Improve portability and readability of table-percent-height* tests.
     6        https://bugs.webkit.org/show_bug.cgi?id=31858
     7
     8        The purpose of these tests is to confirm that an element with
     9        height:N% inside a table cell has non-zero height. We don't need
     10        to check concrete pixel sizes of form controls.
     11
     12        This updates the tests so that they check heights are non-zero and
     13        75% heights are same as corresponding 100% heights or actually 75%.
     14
     15        * fast/replaced/table-percent-height-expected.txt:
     16        * fast/replaced/table-percent-height-text-controls-expected.txt:
     17        * fast/replaced/table-percent-height-text-controls.html:
     18        * fast/replaced/table-percent-height.html:
     19
    1202009-12-06  Fumitoshi Ukai  <ukai@chromium.org>
    221
  • trunk/LayoutTests/fast/replaced/table-percent-height-expected.txt

    r43099 r51744  
    2828
    2929
    30 PASS getComputedStyleForElement(document.getElementById('canvas-75'), 'width') is '300px'
    31 PASS getComputedStyleForElement(document.getElementById('canvas-75'), 'height') is '112px'
    32 PASS getComputedStyleForElement(document.getElementById('canvas-100'), 'width') is '300px'
    33 PASS getComputedStyleForElement(document.getElementById('canvas-100'), 'height') is '150px'
    34 PASS getComputedStyleForElement(document.getElementById('embed-75'), 'width') is '300px'
    35 PASS getComputedStyleForElement(document.getElementById('embed-75'), 'height') is '112px'
    36 PASS getComputedStyleForElement(document.getElementById('embed-100'), 'width') is '300px'
    37 PASS getComputedStyleForElement(document.getElementById('embed-100'), 'height') is '150px'
    38 PASS getComputedStyleForElement(document.getElementById('img-75'), 'width') is '75px'
    39 PASS getComputedStyleForElement(document.getElementById('img-75'), 'height') is '75px'
    40 PASS getComputedStyleForElement(document.getElementById('img-100'), 'width') is '100px'
    41 PASS getComputedStyleForElement(document.getElementById('img-100'), 'height') is '100px'
    42 PASS getComputedStyleForElement(document.getElementById('object-75'), 'width') is '300px'
    43 PASS getComputedStyleForElement(document.getElementById('object-75'), 'height') is '112px'
    44 PASS getComputedStyleForElement(document.getElementById('object-100'), 'width') is '300px'
    45 PASS getComputedStyleForElement(document.getElementById('object-100'), 'height') is '150px'
    46 PASS getComputedStyleForElement(document.getElementById('button-75'), 'width') is '51px'
    47 PASS getComputedStyleForElement(document.getElementById('button-75'), 'height') is '15px'
    48 PASS getComputedStyleForElement(document.getElementById('button-100'), 'width') is '51px'
    49 PASS getComputedStyleForElement(document.getElementById('button-100'), 'height') is '15px'
    50 PASS getComputedStyleForElement(document.getElementById('input-button-75'), 'width') is '16px'
    51 PASS getComputedStyleForElement(document.getElementById('input-button-75'), 'height') is '18px'
    52 PASS getComputedStyleForElement(document.getElementById('input-button-100'), 'width') is '16px'
    53 PASS getComputedStyleForElement(document.getElementById('input-button-100'), 'height') is '18px'
    54 PASS getComputedStyleForElement(document.getElementById('input-checkbox-75'), 'width') is '12px'
    55 PASS getComputedStyleForElement(document.getElementById('input-checkbox-75'), 'height') is '4px'
    56 PASS getComputedStyleForElement(document.getElementById('input-checkbox-100'), 'width') is '12px'
    57 PASS getComputedStyleForElement(document.getElementById('input-checkbox-100'), 'height') is '6px'
    58 PASS getComputedStyleForElement(document.getElementById('input-file-75'), 'width') is '237px'
    59 PASS getComputedStyleForElement(document.getElementById('input-file-75'), 'height') is '13px'
    60 PASS getComputedStyleForElement(document.getElementById('input-file-100'), 'width') is '237px'
    61 PASS getComputedStyleForElement(document.getElementById('input-file-100'), 'height') is '18px'
    62 PASS getComputedStyleForElement(document.getElementById('input-image-75'), 'width') is '75px'
    63 PASS getComputedStyleForElement(document.getElementById('input-image-75'), 'height') is '75px'
    64 PASS getComputedStyleForElement(document.getElementById('input-image-100'), 'width') is '100px'
    65 PASS getComputedStyleForElement(document.getElementById('input-image-100'), 'height') is '100px'
    66 PASS getComputedStyleForElement(document.getElementById('input-radio-75'), 'width') is '12px'
    67 PASS getComputedStyleForElement(document.getElementById('input-radio-75'), 'height') is '4px'
    68 PASS getComputedStyleForElement(document.getElementById('input-radio-100'), 'width') is '12px'
    69 PASS getComputedStyleForElement(document.getElementById('input-radio-100'), 'height') is '6px'
    70 PASS getComputedStyleForElement(document.getElementById('input-reset-75'), 'width') is '45px'
    71 PASS getComputedStyleForElement(document.getElementById('input-reset-75'), 'height') is '18px'
    72 PASS getComputedStyleForElement(document.getElementById('input-reset-100'), 'width') is '45px'
    73 PASS getComputedStyleForElement(document.getElementById('input-reset-100'), 'height') is '18px'
    74 PASS getComputedStyleForElement(document.getElementById('input-submit-75'), 'width') is '54px'
    75 PASS getComputedStyleForElement(document.getElementById('input-submit-75'), 'height') is '18px'
    76 PASS getComputedStyleForElement(document.getElementById('input-submit-100'), 'width') is '54px'
    77 PASS getComputedStyleForElement(document.getElementById('input-submit-100'), 'height') is '18px'
    78 PASS getComputedStyleForElement(document.getElementById('select-75'), 'width') is '68px'
    79 PASS getComputedStyleForElement(document.getElementById('select-75'), 'height') is '18px'
    80 PASS getComputedStyleForElement(document.getElementById('select-100'), 'width') is '68px'
    81 PASS getComputedStyleForElement(document.getElementById('select-100'), 'height') is '18px'
     30PASS getWidth('canvas-75') is '300px'
     31PASS getHeight('canvas-75') is '112px'
     32PASS getWidth('canvas-100') is '300px'
     33PASS getHeight('canvas-100') is '150px'
     34PASS getWidth('embed-75') is '300px'
     35PASS getHeight('embed-75') is '112px'
     36PASS getWidth('embed-100') is '300px'
     37PASS getHeight('embed-100') is '150px'
     38PASS getWidth('img-75') is '75px'
     39PASS getHeight('img-75') is '75px'
     40PASS getWidth('img-100') is '100px'
     41PASS getHeight('img-100') is '100px'
     42PASS getWidth('object-75') is '300px'
     43PASS getHeight('object-75') is '112px'
     44PASS getWidth('object-100') is '300px'
     45PASS getHeight('object-100') is '150px'
     46PASS getWidth('button-75') is getWidth('button-100')
     47PASS getHeight('button-75') != '0px' is true
     48PASS getHeight('button-75') is getHeight('button-100')
     49PASS getWidth('input-button-75') is getWidth('input-button-100')
     50PASS getHeight('input-button-75') != '0px' is true
     51PASS getHeight('input-button-75') is getHeight('input-button-100')
     52PASS getWidth('input-checkbox-75') is getWidth('input-checkbox-100')
     53PASS getHeight('input-checkbox-75') != '0px' is true
     54PASS getHeight('input-checkbox-75') [4px] is 75% of getHeight('input-checkbox-100') [6px].
     55PASS getWidth('input-file-75') is getWidth('input-file-100')
     56PASS getHeight('input-file-75') != '0px' is true
     57PASS getHeight('input-file-75') [13px] is 75% of getHeight('input-file-100') [18px].
     58PASS getWidth('input-image-75') is '75px'
     59PASS getHeight('input-image-75') is '75px'
     60PASS getWidth('input-image-100') is '100px'
     61PASS getHeight('input-image-100') is '100px'
     62PASS getWidth('input-radio-75') is getWidth('input-radio-100')
     63PASS getHeight('input-radio-75') != '0px' is true
     64PASS getHeight('input-radio-75') [4px] is 75% of getHeight('input-radio-100') [6px].
     65PASS getWidth('input-reset-75') is getWidth('input-reset-100')
     66PASS getHeight('input-reset-75') != '0px' is true
     67PASS getHeight('input-reset-75') is getHeight('input-reset-100')
     68PASS getWidth('input-submit-75') is getWidth('input-submit-100')
     69PASS getHeight('input-submit-75') != '0px' is true
     70PASS getHeight('input-submit-75') is getHeight('input-submit-100')
     71PASS getWidth('select-75') is getWidth('select-100')
     72PASS getHeight('select-75') != '0px' is true
     73PASS getHeight('select-75') is getHeight('select-100')
    8274PASS successfullyParsed is true
    8375
  • trunk/LayoutTests/fast/replaced/table-percent-height-text-controls-expected.txt

    r47528 r51744  
    1212
    1313
    14 PASS MAC input-password-75 width = 128px. Expects: MAC 128px, WIN 152px
    15 PASS MAC/WIN input-password-75 height = 8px. Expects: MAC 8px, WIN 8px
    16 PASS MAC input-password-100 width = 128px. Expects: MAC 128px, WIN 152px
    17 PASS MAC/WIN input-password-100 height = 13px. Expects: MAC 13px, WIN 13px
    18 PASS MAC input-text-75 width = 128px. Expects: MAC 128px, WIN 152px
    19 PASS MAC/WIN input-text-75 height = 8px. Expects: MAC 8px, WIN 8px
    20 PASS MAC input-text-100 width = 128px. Expects: MAC 128px, WIN 152px
    21 PASS MAC/WIN input-text-100 height = 13px. Expects: MAC 13px, WIN 13px
    22 PASS MAC isindex-75 width = 122px. Expects: MAC 122px, WIN 146px
    23 PASS MAC/WIN isindex-75 height = 13px. Expects: MAC 13px, WIN 13px
    24 PASS MAC isindex-100 width = 122px. Expects: MAC 122px, WIN 146px
    25 PASS MAC/WIN isindex-100 height = 13px. Expects: MAC 13px, WIN 13px
    26 PASS MAC textarea-75 width = 129px. Expects: MAC 129px, WIN 161px
    27 FAIL. Doesn't match any platform's results. textarea-75 height = 18px. Expects: MAC 19px, WIN 19px
    28 PASS MAC textarea-100 width = 129px. Expects: MAC 129px, WIN 161px
    29 FAIL. Doesn't match any platform's results. textarea-100 height = 26px. Expects: MAC 28px, WIN 28px
     14PASS getWidth('input-password-75') is getWidth('input-password-100')
     15PASS getFullHeight('input-password-75') != '0px' is true
     16PASS getFullHeight('input-password-75') [14px] is 75% of getFullHeight('input-password-100') [19px].
     17PASS getWidth('input-text-75') is getWidth('input-text-100')
     18PASS getFullHeight('input-text-75') != '0px' is true
     19PASS getFullHeight('input-text-75') [14px] is 75% of getFullHeight('input-text-100') [19px].
     20PASS getWidth('isindex-75') is getWidth('isindex-100')
     21PASS getFullHeight('isindex-75') != '0px' is true
     22PASS getFullHeight('isindex-75') is getFullHeight('isindex-100')
     23PASS getWidth('textarea-75') is getWidth('textarea-100')
     24PASS getFullHeight('textarea-75') != '0px' is true
     25PASS getFullHeight('textarea-75') [24px] is 75% of getFullHeight('textarea-100') [32px].
    3026PASS successfullyParsed is true
    3127
  • trunk/LayoutTests/fast/replaced/table-percent-height-text-controls.html

    r47528 r51744  
    1111}
    1212
    13 function getComputedStyleForElement (element, cssPropertyName)
     13function getComputedStyleForElement(element, cssPropertyName)
    1414{
    1515    if (!element)
     
    2525}
    2626
    27 function printMetrics(id, cssPropertyName, expectedMacValue, expectedWinValue) {
    28   var value = getComputedStyleForElement(document.getElementById(id), cssPropertyName);
     27function getWidth(id)
     28{
     29    return getComputedStyleForElement(document.getElementById(id), 'width');
     30}
    2931
    30   var matchingPlatform;
    31   if (expectedMacValue == expectedWinValue && value == expectedMacValue)
    32       matchingPlatform = 'PASS MAC/WIN';
    33   else if (value == expectedMacValue)
    34       matchingPlatform = 'PASS MAC';
    35   else if (value == expectedWinValue)
    36       matchingPlatform = 'PASS WIN';
    37   else
    38       matchingPlatform = 'FAIL. Doesn\'t match any platform\'s results.';
     32function getFullHeight(id)
     33{
     34    var element = document.getElementById(id);
     35    var h = parseFloat(getComputedStyleForElement(element, 'border-top-width'));
     36    h += parseFloat(getComputedStyleForElement(element, 'padding-top'));
     37    h += parseFloat(getComputedStyleForElement(element, 'height'));
     38    h += parseFloat(getComputedStyleForElement(element, 'padding-bottom'));
     39    h += parseFloat(getComputedStyleForElement(element, 'border-bottom-width'));
     40    return h + 'px';
     41}
    3942
    40   debug(matchingPlatform + ' ' + id + ' ' + cssPropertyName + ' = ' + value + '. ' +
    41        'Expects: MAC ' + expectedMacValue + ', WIN ' + expectedWinValue);
     43function parsePixelValue(str)
     44{
     45    if (typeof str != "string" || str.length < 3 || str.substr(str.length - 2) != "px") {
     46        testFailed(str + " is unparsable.");
     47        return -1;
     48    }
     49    return parseFloat(str);
     50}
     51
     52function is75PercentOf(expression75, expression100)
     53{
     54    var str75 = eval(expression75);
     55    var str100 = eval(expression100);
     56    var num75 = parsePixelValue(str75);
     57    var num100 = parsePixelValue(str100);
     58    if (num75 < 0 || num100 < 0)
     59        return;
     60    if (num75 == Math.floor(num100 * 75 / 100))
     61        testPassed(expression75 + " [" + str75 + "] is 75% of " + expression100 + " [" + str100 + "].");
     62    else
     63        testFailed(expression75 + " [" + str75 + "] is not 75% of " + expression100 + " [" + str100 + "].");
    4264}
    4365
     
    4769        "Text controls are in a different test than other replaced elements because their metrics are platform-specific.");
    4870
    49     printMetrics('input-password-75', 'width', '128px', '152px');
    50     printMetrics('input-password-75', 'height', '8px', '8px');
    51     printMetrics('input-password-100', 'width', '128px', '152px');
    52     printMetrics('input-password-100', 'height', '13px', '13px');
     71    shouldBe("getWidth('input-password-75')", "getWidth('input-password-100')");
     72    shouldBeTrue("getFullHeight('input-password-75') != '0px'");
     73    // Note: This behavior doesn't match to IE 8, Firefox 3.5 and Opera 10.
     74    is75PercentOf("getFullHeight('input-password-75')", "getFullHeight('input-password-100')");
    5375
    54     printMetrics('input-text-75', 'width', '128px', '152px');
    55     printMetrics('input-text-75', 'height', '8px', '8px');
    56     printMetrics('input-text-100', 'width', '128px', '152px');
    57     printMetrics('input-text-100', 'height', '13px', '13px');
     76    shouldBe("getWidth('input-text-75')", "getWidth('input-text-100')");
     77    shouldBeTrue("getFullHeight('input-text-75') != '0px'");
     78    // Note: This behavior doesn't match to IE 8, Firefox 3.5 and Opera 10.
     79    is75PercentOf("getFullHeight('input-text-75')", "getFullHeight('input-text-100')");
    5880
    59     printMetrics('isindex-75', 'width', '122px', '146px');
    60     printMetrics('isindex-75', 'height', '13px', '13px');
    61     printMetrics('isindex-100', 'width', '122px', '146px');
    62     printMetrics('isindex-100', 'height', '13px', '13px');
     81    shouldBe("getWidth('isindex-75')", "getWidth('isindex-100')");
     82    shouldBeTrue("getFullHeight('isindex-75') != '0px'");
     83    shouldBe("getFullHeight('isindex-75')", "getFullHeight('isindex-100')");
    6384
    64     printMetrics('textarea-75', 'width', '129px', '161px');
    65     printMetrics('textarea-75', 'height', '19px', '19px');
    66     printMetrics('textarea-100', 'width', '129px', '161px');
    67     printMetrics('textarea-100', 'height', '28px', '28px');
     85    shouldBe("getWidth('textarea-75')", "getWidth('textarea-100')");
     86    shouldBeTrue("getFullHeight('textarea-75') != '0px'");
     87    // Note: This behavior doesn't match to IE 8, Firefox 3.5 and Opera 10.
     88    is75PercentOf("getFullHeight('textarea-75')", "getFullHeight('textarea-100')");
    6889
    6990    isSuccessfullyParsed();
  • trunk/LayoutTests/fast/replaced/table-percent-height.html

    r43099 r51744  
    1111}
    1212
    13 function getComputedStyleForElement (element, cssPropertyName)
     13function getComputedStyleForElement(element, cssPropertyName)
    1414{
    1515    if (!element) {
     
    2525}
    2626
     27function getWidth(id)
     28{
     29    return getComputedStyleForElement(document.getElementById(id), 'width');
     30}
     31
     32function getHeight(id)
     33{
     34    return getComputedStyleForElement(document.getElementById(id), 'height');
     35}
     36
     37function parsePixelValue(str)
     38{
     39    if (typeof str != "string" || str.length < 3 || str.substr(str.length - 2) != "px") {
     40        testFailed(str + " is unparsable.");
     41        return -1;
     42    }
     43    return parseFloat(str);
     44}
     45
     46function is75PercentOf(expression75, expression100)
     47{
     48    var str75 = eval(expression75);
     49    var str100 = eval(expression100);
     50    var num75 = parsePixelValue(str75);
     51    var num100 = parsePixelValue(str100);
     52    if (num75 < 0 || num100 < 0)
     53        return;
     54    if (num75 == Math.floor(num100 * 75 / 100))
     55        testPassed(expression75 + " [" + str75 + "] is 75% of " + expression100 + " [" + str100 + "].");
     56    else
     57        testFailed(expression75 + " [" + str75 + "] is not 75% of " + expression100 + " [" + str100 + "].");
     58}
     59
    2760function test()
    2861{
    2962    description("This test checks that replaced elements with percentage heights within table cells have the correct height.");
    3063
    31     shouldBe("getComputedStyleForElement(document.getElementById('canvas-75'), 'width')", "'300px'");
    32     shouldBe("getComputedStyleForElement(document.getElementById('canvas-75'), 'height')", "'112px'");
    33     shouldBe("getComputedStyleForElement(document.getElementById('canvas-100'), 'width')", "'300px'");
    34     shouldBe("getComputedStyleForElement(document.getElementById('canvas-100'), 'height')", "'150px'");
     64    shouldBe("getWidth('canvas-75')", "'300px'");
     65    shouldBe("getHeight('canvas-75')", "'112px'");
     66    shouldBe("getWidth('canvas-100')", "'300px'");
     67    shouldBe("getHeight('canvas-100')", "'150px'");
    3568
    36     shouldBe("getComputedStyleForElement(document.getElementById('embed-75'), 'width')", "'300px'");
    37     shouldBe("getComputedStyleForElement(document.getElementById('embed-75'), 'height')", "'112px'");
    38     shouldBe("getComputedStyleForElement(document.getElementById('embed-100'), 'width')", "'300px'");
    39     shouldBe("getComputedStyleForElement(document.getElementById('embed-100'), 'height')", "'150px'");
     69    shouldBe("getWidth('embed-75')", "'300px'");
     70    shouldBe("getHeight('embed-75')", "'112px'");
     71    shouldBe("getWidth('embed-100')", "'300px'");
     72    shouldBe("getHeight('embed-100')", "'150px'");
    4073
    41     shouldBe("getComputedStyleForElement(document.getElementById('img-75'), 'width')", "'75px'");
    42     shouldBe("getComputedStyleForElement(document.getElementById('img-75'), 'height')", "'75px'");
    43     shouldBe("getComputedStyleForElement(document.getElementById('img-100'), 'width')", "'100px'");
    44     shouldBe("getComputedStyleForElement(document.getElementById('img-100'), 'height')", "'100px'");
     74    shouldBe("getWidth('img-75')", "'75px'");
     75    shouldBe("getHeight('img-75')", "'75px'");
     76    shouldBe("getWidth('img-100')", "'100px'");
     77    shouldBe("getHeight('img-100')", "'100px'");
    4578
    46     shouldBe("getComputedStyleForElement(document.getElementById('object-75'), 'width')", "'300px'");
    47     shouldBe("getComputedStyleForElement(document.getElementById('object-75'), 'height')", "'112px'");
    48     shouldBe("getComputedStyleForElement(document.getElementById('object-100'), 'width')", "'300px'");
    49     shouldBe("getComputedStyleForElement(document.getElementById('object-100'), 'height')", "'150px'");
     79    shouldBe("getWidth('object-75')", "'300px'");
     80    shouldBe("getHeight('object-75')", "'112px'");
     81    shouldBe("getWidth('object-100')", "'300px'");
     82    shouldBe("getHeight('object-100')", "'150px'");
    5083
    51     shouldBe("getComputedStyleForElement(document.getElementById('button-75'), 'width')", "'51px'");
    52     shouldBe("getComputedStyleForElement(document.getElementById('button-75'), 'height')", "'15px'");
    53     shouldBe("getComputedStyleForElement(document.getElementById('button-100'), 'width')", "'51px'");
    54     shouldBe("getComputedStyleForElement(document.getElementById('button-100'), 'height')", "'15px'");
     84    shouldBe("getWidth('button-75')", "getWidth('button-100')");
     85    shouldBeTrue("getHeight('button-75') != '0px'");
     86    shouldBe("getHeight('button-75')", "getHeight('button-100')");
    5587
    56     shouldBe("getComputedStyleForElement(document.getElementById('input-button-75'), 'width')", "'16px'");
    57     shouldBe("getComputedStyleForElement(document.getElementById('input-button-75'), 'height')", "'18px'");
    58     shouldBe("getComputedStyleForElement(document.getElementById('input-button-100'), 'width')", "'16px'");
    59     shouldBe("getComputedStyleForElement(document.getElementById('input-button-100'), 'height')", "'18px'");
     88    shouldBe("getWidth('input-button-75')", "getWidth('input-button-100')");
     89    shouldBeTrue("getHeight('input-button-75') != '0px'");
     90    shouldBe("getHeight('input-button-75')", "getHeight('input-button-100')");
    6091
    61     shouldBe("getComputedStyleForElement(document.getElementById('input-checkbox-75'), 'width')", "'12px'");
    62     shouldBe("getComputedStyleForElement(document.getElementById('input-checkbox-75'), 'height')", "'4px'");
    63     shouldBe("getComputedStyleForElement(document.getElementById('input-checkbox-100'), 'width')", "'12px'");
    64     shouldBe("getComputedStyleForElement(document.getElementById('input-checkbox-100'), 'height')", "'6px'");
     92    shouldBe("getWidth('input-checkbox-75')", "getWidth('input-checkbox-100')");
     93    shouldBeTrue("getHeight('input-checkbox-75') != '0px'");
     94    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
     95    is75PercentOf("getHeight('input-checkbox-75')", "getHeight('input-checkbox-100')");
    6596
    66     shouldBe("getComputedStyleForElement(document.getElementById('input-file-75'), 'width')", "'237px'");
    67     shouldBe("getComputedStyleForElement(document.getElementById('input-file-75'), 'height')", "'13px'");
    68     shouldBe("getComputedStyleForElement(document.getElementById('input-file-100'), 'width')", "'237px'");
    69     shouldBe("getComputedStyleForElement(document.getElementById('input-file-100'), 'height')", "'18px'");
     97    shouldBe("getWidth('input-file-75')", "getWidth('input-file-100')");
     98    shouldBeTrue("getHeight('input-file-75') != '0px'");
     99    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
     100    is75PercentOf("getHeight('input-file-75')", "getHeight('input-file-100')");
    70101
    71     shouldBe("getComputedStyleForElement(document.getElementById('input-image-75'), 'width')", "'75px'");
    72     shouldBe("getComputedStyleForElement(document.getElementById('input-image-75'), 'height')", "'75px'");
    73     shouldBe("getComputedStyleForElement(document.getElementById('input-image-100'), 'width')", "'100px'");
    74     shouldBe("getComputedStyleForElement(document.getElementById('input-image-100'), 'height')", "'100px'");
     102    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
     103    shouldBe("getWidth('input-image-75')", "'75px'");
     104    shouldBe("getHeight('input-image-75')", "'75px'");
     105    shouldBe("getWidth('input-image-100')", "'100px'");
     106    shouldBe("getHeight('input-image-100')", "'100px'");
    75107
    76     shouldBe("getComputedStyleForElement(document.getElementById('input-radio-75'), 'width')", "'12px'");
    77     shouldBe("getComputedStyleForElement(document.getElementById('input-radio-75'), 'height')", "'4px'");
    78     shouldBe("getComputedStyleForElement(document.getElementById('input-radio-100'), 'width')", "'12px'");
    79     shouldBe("getComputedStyleForElement(document.getElementById('input-radio-100'), 'height')", "'6px'");
     108    shouldBe("getWidth('input-radio-75')", "getWidth('input-radio-100')");
     109    shouldBeTrue("getHeight('input-radio-75') != '0px'");
     110    // Note: This behavior doesn't match to Firefox 3.5 and Opera 10.
     111    is75PercentOf("getHeight('input-radio-75')", "getHeight('input-radio-100')");
    80112
    81     shouldBe("getComputedStyleForElement(document.getElementById('input-reset-75'), 'width')", "'45px'");
    82     shouldBe("getComputedStyleForElement(document.getElementById('input-reset-75'), 'height')", "'18px'");
    83     shouldBe("getComputedStyleForElement(document.getElementById('input-reset-100'), 'width')", "'45px'");
    84     shouldBe("getComputedStyleForElement(document.getElementById('input-reset-100'), 'height')", "'18px'");
     113    shouldBe("getWidth('input-reset-75')", "getWidth('input-reset-100')");
     114    shouldBeTrue("getHeight('input-reset-75') != '0px'");
     115    shouldBe("getHeight('input-reset-75')", "getHeight('input-reset-100')");
    85116
    86     shouldBe("getComputedStyleForElement(document.getElementById('input-submit-75'), 'width')", "'54px'");
    87     shouldBe("getComputedStyleForElement(document.getElementById('input-submit-75'), 'height')", "'18px'");
    88     shouldBe("getComputedStyleForElement(document.getElementById('input-submit-100'), 'width')", "'54px'");
    89     shouldBe("getComputedStyleForElement(document.getElementById('input-submit-100'), 'height')", "'18px'");
     117    shouldBe("getWidth('input-submit-75')", "getWidth('input-submit-100')");
     118    shouldBeTrue("getHeight('input-submit-75') != '0px'");
     119    shouldBe("getHeight('input-submit-75')", "getHeight('input-submit-100')");
    90120
    91     shouldBe("getComputedStyleForElement(document.getElementById('select-75'), 'width')", "'68px'");
    92     shouldBe("getComputedStyleForElement(document.getElementById('select-75'), 'height')", "'18px'");
    93     shouldBe("getComputedStyleForElement(document.getElementById('select-100'), 'width')", "'68px'");
    94     shouldBe("getComputedStyleForElement(document.getElementById('select-100'), 'height')", "'18px'");
     121    shouldBe("getWidth('select-75')", "getWidth('select-100')");
     122    shouldBeTrue("getHeight('select-75') != '0px'");
     123    shouldBe("getHeight('select-75')", "getHeight('select-100')");
    95124
    96125    isSuccessfullyParsed();
Note: See TracChangeset for help on using the changeset viewer.