Skip to content

Commit

Permalink
Add/Revise WPT to reflect resolution of calc() in table layout
Browse files Browse the repository at this point in the history
w3c/csswg-drafts#94 made a resolution that

"Any math expression of a complex type is treated as auto. Simple typed
things continue to work as today."

This patch adds new tests and revises existing tests to reflect the
resolution.

Bug: 382725
Change-Id: I522799b51fdd4a7cfa66e137ae31c68aaf2dea73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832619
Commit-Queue: Xiaocheng Hu <[email protected]>
Reviewed-by: Aleks Totic <[email protected]>
Cr-Commit-Position: refs/heads/master@{#701597}
  • Loading branch information
xiaochengh authored and chromium-wpt-export-bot committed Oct 1, 2019
1 parent bec7ffa commit cda40b6
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 2 deletions.
37 changes: 37 additions & 0 deletions css/css-tables/auto-layout-calc-width-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<link rel="author" title="David Grogan" href="[email protected]">
<link rel="author" title="Xiaocheng Hu" href="[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#distributing-width-to-columns">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/94">

<style>
table {
width: 200px;
border-collapse: collapse;
table-layout: auto;
height: 20px;
}

td {
padding: 0px;
background: lime;
outline: 1px solid blue;
}
</style>

<h2>Calc width on col is treated as auto in auto tables</h2>

<table id=theTable>
<col style="width:calc(20% + 80px)">
<tr>
<td data-expected-width=100></td>
<td data-expected-width=100></td>
</tr>
</table>

<script>
checkLayout('#theTable')
</script>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Simple calc expression in table layout</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/94">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3482">
<link rel="match" href="calc-percent-plus-0px-ref.html">
<meta name="assert" content="calc(% + 0px) should be handled as calc(%) in table layout.">
<table border>
<meta name="assert" content="calc(% + 0px) should be handled as calc(%) in auto table layout.">
<table border style="table-layout: auto">
<tr>
<td style="width: calc(50% + 0px)">x</td>
<td style="width: 100px">y</td>
Expand Down
10 changes: 10 additions & 0 deletions css/css-tables/calc-percent-plus-0px-fixed-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Simple calc expression in table layout</title>
<table border style="table-layout: fixed; width: 200px">
<tr>
<td style="width: 50%">x</td>
<td>y</td>
<td>z</td>
</tr>
</table>
14 changes: 14 additions & 0 deletions css/css-tables/calc-percent-plus-0px-fixed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Simple calc expression in table layout</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/94">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3482">
<link rel="match" href="calc-percent-plus-0px-fixed-ref.html">
<meta name="assert" content="calc(% + 0px) should be handled as calc(%) in fixed table layout.">
<table border style="table-layout: fixed; width: 200px">
<tr>
<td style="width: calc(50% + 0px)">x</td>
<td>y</td>
<td>z</td>
</tr>
</table>
1 change: 1 addition & 0 deletions css/css-tables/fixed-layout-calc-width-001.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<script src="/resources/check-layout-th.js"></script>
<link rel="author" title="David Grogan" href="[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#distributing-width-to-columns">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/94">

<style>
table {
Expand Down

0 comments on commit cda40b6

Please sign in to comment.