<!DOCTYPE html>
<html>
<head>
+<script src="../../resources/run-after-display.js"></script>
<style>
.composited {
-webkit-transform: translatez(0);
</style>
<script>
- if (window.testRunner)
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
testRunner.dumpAsText();
+ }
if (window.internals) {
- internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);
+ internals.settings.setPreferCompositingToLCDTextEnabled(true);
internals.settings.setLayerSquashingEnabled(true);
}
if (!window.internals)
return;
- // Case 1
- document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
-
- // Case 2
- window.internals.startTrackingRepaints(document);
- window.scrollTo(0, 80);
- document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
- window.internals.stopTrackingRepaints(document);
-
- // Case 3
- window.internals.startTrackingRepaints(document);
- window.scrollTo(0, 120);
- document.getElementById('Case3').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
- window.internals.stopTrackingRepaints(document);
-
- // Case 4
- window.internals.startTrackingRepaints(document);
- window.scrollTo(0, 170);
- document.getElementById('Case4').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
- window.internals.stopTrackingRepaints(document);
-
- // Display the test results only after test is done so that it does not affect repaint rect results.
- document.getElementById('testResults').style.display = "block";
+ (function() {
+
+ return new Promise(function(resolve) {
+ // Case 1
+ document.getElementById('Case1').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+
+ resolve();
+ });
+
+ })().then(function() {
+
+ return new Promise(function(resolve) {
+
+ // Case 2
+ window.internals.startTrackingRepaints(document);
+ window.scrollTo(0, 80);
+ runAfterDisplay(function() {
+ document.getElementById('Case2').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+ window.internals.stopTrackingRepaints(document);
+
+ resolve();
+ });
+
+ });
+
+ }).then(function() {
+
+ return new Promise(function(resolve) {
+
+ // Case 3
+ window.internals.startTrackingRepaints(document);
+ window.scrollTo(0, 120);
+ runAfterDisplay(function() {
+ document.getElementById('Case3').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+ window.internals.stopTrackingRepaints(document);
+
+ resolve();
+ });
+
+ });
+
+ }).then(function() {
+
+ return new Promise(function(resolve) {
+
+ // Case 4
+ window.internals.startTrackingRepaints(document);
+ window.scrollTo(0, 170);
+ runAfterDisplay(function() {
+ document.getElementById('Case4').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+ window.internals.stopTrackingRepaints(document);
+
+ resolve();
+ });
+
+ });
+
+ }).then(function() {
+
+ // Display the test results only after test is done so that it does not affect repaint rect results.
+ document.getElementById('testResults').style.display = "block";
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+
+ }).catch(function(e) {
+
+ console.error(e);
+
+ });
}
</script>
</head>