File: transformed_scrolling_repaints_3_window.html

package info (click to toggle)
firefox 141.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,550,616 kB
  • sloc: cpp: 7,426,508; javascript: 6,367,238; ansic: 3,707,354; python: 1,368,984; xml: 623,983; asm: 426,916; java: 184,324; sh: 64,488; makefile: 19,203; objc: 13,059; perl: 12,955; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,071; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (46 lines) | stat: -rw-r--r-- 1,571 bytes parent folder | download | duplicates (11)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE HTML>
<html style="overflow: hidden;">
<head>
  <title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
</head>
<!-- Need a timeout here to allow paint unsuppression before we start the test -->
<body onload="setTimeout(startTest,0)" style="background:white;">
<iframe id="t" style="transform: scale(0.48979); transform-origin:top left; width:500px; height:600px;"
        src="transformed_scrolling_repaints_3_window_frame.html">
</iframe>
<pre id="test">
<script type="application/javascript">
var SimpleTest = window.opener.SimpleTest;
var SpecialPowers = window.opener.SpecialPowers;
var is = window.opener.is;
var smoothScrollPref = "general.smoothScroll";

function startTest() {
  SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, runTest);
}

async function runTest() {
  let t = document.getElementById("t");
  let e = t.contentDocument.getElementById("e");
  t.contentWindow.scrollTo(0,0);
  let utils = SpecialPowers.getDOMWindowUtils(window);

  for (let i = 0; i < 15; i++) {
    let painted = utils.checkAndClearPaintedState(e);
    // We ignore the first few scrolls, to ensure we have triggered activity
    // heuristics.
    if (i >= 5) {
      is(painted, false,
         "Fully-visible scrolled element should not have been painted");
    }
    t.contentWindow.scrollByLines(1);
    await promiseAllPaintsDone(null, true);
  }
  SimpleTest.finish();
  window.close();
}
</script>
</pre>
</body>
</html>