6 border-right:
3px solid #e5ecf9;
8 padding:
0.5em
.5em
.5em
0;
23 <script src=
"../../resources/js-test.js"></script>
27 <table width=
"100%" cellpadding=
"0" cellspacing=
"0" border=
"0">
28 <tbody class=
"collapse">
32 <table cellspacing=
"0" cellpadding=
"0">
35 <th align=
"left">Cc:
</th>
36 <td>TableLayoutAlgorithmAuto
</td>
42 <td width=
"100%"></td>
47 <table id=
"fixedTable">
49 <td id=
"firstFixedCell"><div id=
"fixedContent">foo
</div></td>
50 <td>TableLayoutAlgorithmFixed
</td>
55 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.
59 var autoEl
= document
.getElementById("content");
60 var autoCell
= document
.getElementById("firstCell");
61 var autoExpectedWidth
= String(autoCell
.getBoundingClientRect().width
);
62 autoEl
.style
.width
= autoEl
.getBoundingClientRect().width
+ "px";
63 if (autoCell
.getBoundingClientRect().width
== autoExpectedWidth
)
64 testPassed('Cell in AutoTable has expected size');
66 shouldBe('autoCell.getBoundingClientRect().width', autoExpectedWidth
);
69 var fixedEl
= document
.getElementById("fixedContent");
70 var fixedCell
= document
.getElementById("firstFixedCell");
71 var fixedExpectedWidth
= String(fixedCell
.getBoundingClientRect().width
);
72 fixedEl
.style
.width
= fixedEl
.getBoundingClientRect().width
+ "px";
73 if (fixedCell
.getBoundingClientRect().width
== fixedExpectedWidth
)
74 testPassed('Cell in FixedTable has expected size');
76 shouldBe('fixedCell.getBoundingClientRect().width', fixedExpectedWidth
);