Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / style / test / test_reframe_pseudo_element.html
blob0e0b418e8174c71b25b8478ee4d9d4cf9d08556c
1 <!doctype html>
2 <meta charset="utf-8">
3 <title>
4 Test for bug 1376352: We don't reframe all the time a replaced element that
5 matches generated content rules.
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 #flex::before,
11 input::before {
12 content: "Foo";
14 </style>
15 <input type="text">
16 <div id="flex"></div>
17 <script>
18 SimpleTest.waitForExplicitFinish();
19 const utils = SpecialPowers.getDOMWindowUtils(window);
21 function testNoReframe(callback) {
22 document.documentElement.offsetTop;
23 const previousConstructCount = utils.framesConstructed;
24 const previousRestyleGeneration = utils.restyleGeneration;
26 callback();
28 document.documentElement.offsetTop;
29 isnot(previousRestyleGeneration, utils.restyleGeneration,
30 "We should have restyled");
31 is(previousConstructCount, utils.framesConstructed,
32 "We shouldn't have reframed");
35 testNoReframe(function() {
36 const input = document.querySelector('input');
37 input.style.color = "blue";
38 });
40 testNoReframe(function() {
41 const flex = document.getElementById('flex');
42 flex.style.color = "blue";
43 });
45 SimpleTest.finish();
46 </script>