gecko-dev/testing/web-platform/tests/css/cssom-view/table-with-border-client-width-height.html
Joonghun Park 9e205c9c31 Bug 1575720 [wpt PR 18604] - Make table's clientWidth/Height include its border sizes., a=testonly
Automatic update from web-platform-tests
Make table's clientWidth/Height include its border sizes.

Blink doesn't have table wrapper box currently
while Gecko has it,
so this CL tries to mimic the behavior that
clientWidth/Height refers to table wrapper box
which doesn't have borders applied to itself
and table grid box has the borders.

This CL adds table's border sizes
to clientWidth/Height
at |LayoutBox::PixelSnappedClientWidth/Height|.

As a result of this CL, table's clientWidth/Height
and offsetWidth/Height are equal now, respectively.

The corresponding csswg discussion is
https://github.com/w3c/csswg-drafts/issues/4245.

Bug: 560528, 978019
Change-Id: I2693eaf38b882fe4a41f931ec1312ecf53352f27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1763510
Commit-Queue: Joonghun Park <pjh0718@gmail.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Reviewed-by: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701557}

--

wpt-commits: 7bc2d379af8ead0a92387253540a6ee2915783a8
wpt-pr: 18604
2019-10-14 11:23:19 +00:00

31 lines
973 B
HTML

<!DOCTYPE html>
<title>CSSOM Test: Table with its own specified border's clientWidth/Height</title>
<link rel="help" href="https://www.w3.org/TR/CSS2/tables.html#model" />
<link rel="help" href="https://www.w3.org/TR/CSS2/tables.html#separated-borders" />
<link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface" />
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
table {
border: 8px solid #faa;
}
</style>
<table>
<tbody>
<tr>
<td>a</td>
<td>b</td>
</tr>
<tr>
<td>c</td>
<td>d</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
var table = document.getElementsByTagName('table')[0];
test(function() {
assert_equals(table.clientWidth, table.offsetWidth);
assert_equals(table.clientHeight, table.offsetHeight);
}, "Table's clientWidth/Height and OffsetWidth/Height should be the same");
</script>