blob: 1b7e5a3a5d6d3e067959ed46031310a9cc0a0cc4 [file] [log] [blame]
<!DOCTYPE html>
#firstCell {
border-right: 3px solid #e5ecf9;
width: 12em;
padding: 0.5em .5em .5em 0;
font-size: 95%;
#content {
position: relative;
#fixedTable {
table-layout: fixed;
#firstFixedCell {
width: 21.2px;
margin: 0.3px;
padding: 0.1px;
<script src="../../resources/js-test.js"></script>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody class="collapse">
<td id="firstCell">
<div id="content">
<table cellspacing="0" cellpadding="0">
<th align="left">Cc:</th>
<td width="100%"></td>
<table id="fixedTable">
<td id="firstFixedCell"><div id="fixedContent">foo</div></td>
Tests that setting the width of an element inside a cell to the computed width of said element does not change the width of the cell itself.
var autoEl = document.getElementById("content");
var autoCell = document.getElementById("firstCell");
var autoExpectedWidth = String(autoCell.getBoundingClientRect().width); = autoEl.getBoundingClientRect().width + "px";
if (autoCell.getBoundingClientRect().width == autoExpectedWidth)
testPassed('Cell in AutoTable has expected size');
shouldBe('autoCell.getBoundingClientRect().width', autoExpectedWidth);
var fixedEl = document.getElementById("fixedContent");
var fixedCell = document.getElementById("firstFixedCell");
var fixedExpectedWidth = String(fixedCell.getBoundingClientRect().width); = fixedEl.getBoundingClientRect().width + "px";
if (fixedCell.getBoundingClientRect().width == fixedExpectedWidth)
testPassed('Cell in FixedTable has expected size');
shouldBe('fixedCell.getBoundingClientRect().width', fixedExpectedWidth);