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