[TablesNG] Fix size of empty table as a grid item

Without the fix, TablesNG pass 2 out of 3 tests in the bug report.

With the fix, NG matches FF, and I think it is what developers would
want.

It seems there are no wpt tests for this. I could port the test
from the bug report. I think it should be inside css-grid directory.
Any suggestions on naming?

Bug: 667785
Change-Id: I81f5d7674edea4fc547e348d00e1477c9134f3d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2776588
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865411}
diff --git a/css/css-grid/table-grid-item-005.html b/css/css-grid/table-grid-item-005.html
new file mode 100644
index 0000000..4f217bc
--- /dev/null
+++ b/css/css-grid/table-grid-item-005.html
@@ -0,0 +1,60 @@
+<!doctype html>
+
+<meta charset="utf-8">
+<title>Table sizing inside a fixed sized grid</title>
+<link rel="help" href="https://crbug.com/667785">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+  .grid {
+    display: grid;
+    width: 400px;
+    height: 400px;
+    border: 1px solid black;
+    background: red;
+  }
+
+  .item {
+    display: table;
+    background: lime;
+  }
+
+  caption {
+    background: grey;
+  }
+
+</style>
+
+<pre>There should be no red areas:</pre>
+
+<p>Table with one cell</p>
+<div class="grid">
+  <div class="item">
+    table cell
+  </div>
+</div>
+
+<p>Empty table with caption</p>
+<div class="grid">
+  <table class="item">
+    <caption>caption</caption>
+  </table>
+</div>
+
+<p>Table with caption and cell</p>
+<div class="grid">
+  <table class="item">
+    <caption>caption</caption>
+    <tr><td>table cell</td></tr>
+  </table>
+</div>
+
+<script>
+  test(_ => {
+    for (let t of Array.from(document.body.querySelectorAll(".item"))) {
+      assert_equals(t.offsetWidth, 400, "table is as wide as the grid");
+      assert_equals(t.offsetHeight, 400, "table is as tall as the grid");
+    }
+  }, "<table> grid items should fill their grid area");
+</script>