summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_restyle_table_wrapper.html
blob: d8049b142ef8c967ac67eea0a902e3977e43fd60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!doctype html>
<meta charset="utf-8">
<title>
  Test for bug 1371955: We don't incorrectly think that a table wrapper style
  is the main table element style.
</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
/* Test implicitly ::before and ::after too */
span::before, span::after {
  content: "";
  display: table;
}
</style>
<table id="realTable" style="margin: 10px"></table>
<span id="spanTable" style="display: table; padding: 10px;"></span>
<script>
SimpleTest.waitForExplicitFinish();
const utils = SpecialPowers.getDOMWindowUtils(window);
document.documentElement.offsetTop;
for (const element of [realTable, spanTable]) {
  const previousReflowCount = utils.framesReflowed;
  const previousRestyleGeneration = utils.restyleGeneration;
  element.style.color = "blue";
  document.documentElement.offsetTop;
  isnot(previousRestyleGeneration, utils.restyleGeneration,
        "We should have restyled");
  is(previousReflowCount, utils.framesReflowed,
     "We shouldn't have reflowed");
}
SimpleTest.finish();
</script>