Commit ea4e9a46 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Modify some fixed-position paint invalidation tests

The assumption of not compositing fixed-position elements was outdated.
It no longer depends on opacity or PreferCompositingToLCDText.

Also convert these tests into ref tests.

Change-Id: I1b022d675858299abda0b0d37768aa3198a4ac76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533872
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827284}
parent 48c4d507
......@@ -25,6 +25,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV class='fixed'",
"bounds": [50, 50],
"contentsOpaque": true,
"backgroundColor": "#00FF00",
"transform": 3
},
......
......@@ -11,6 +11,7 @@ Hi!
"name": "LayoutNGBlockFlow (positioned) DIV id='abs'",
"position": [-360, -90],
"bounds": [360, 90],
"contentsOpaque": true,
"backgroundColor": "#FFFF00",
"transform": 1
},
......
......@@ -24,6 +24,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#008000",
"transform": 3
},
......
......@@ -15,12 +15,14 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#D3D3D3",
"transform": 2
},
{
"name": "LayoutNGBlockFlow (positioned) DIV",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#D3D3D3",
"transform": 3
},
......
......@@ -13,6 +13,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV class='fixed red'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#FF0000",
"transform": 2
},
......
......@@ -10,6 +10,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV id='t'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#008000",
"invalidations": [
[0, 0, 100, 100]
......@@ -38,7 +39,7 @@
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[8, 64, 0, 1]
[8, 100, 0, 1]
]
}
]
......
......@@ -10,6 +10,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV id='toMove'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#008000",
"invalidations": [
[0, 0, 100, 100]
......
......@@ -10,6 +10,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV id='toMove'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#008000",
"invalidations": [
[0, 0, 100, 100]
......
......@@ -10,6 +10,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV id='toMove'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#008000",
"invalidations": [
[0, 0, 100, 100]
......
......@@ -18,6 +18,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV id='fixed'",
"bounds": [100, 200],
"contentsOpaque": true,
"backgroundColor": "#008000",
"invalidations": [
[0, 100, 100, 100]
......
......@@ -18,6 +18,7 @@
{
"name": "LayoutNGBlockFlow (positioned) DIV id='fixed'",
"bounds": [120, 220],
"contentsOpaque": true,
"backgroundColor": "#008000",
"invalidations": [
[0, 0, 120, 220]
......
......@@ -40,7 +40,7 @@
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[8, 64, 0, 1]
[8, 100, 0, 1]
]
}
]
......
......@@ -7,6 +7,11 @@
"backgroundColor": "#FFFFFF",
"transform": 1
},
{
"name": "LayoutBlockFlow (positioned) DIV id='fixedParent'",
"contentsOpaque": true,
"drawsContent": false
},
{
"name": "LayoutBlockFlow (positioned) DIV id='toMove'",
"bounds": [100, 100],
......
......@@ -7,6 +7,11 @@
"backgroundColor": "#FFFFFF",
"transform": 1
},
{
"name": "LayoutBlockFlow (positioned) DIV id='fixedParent'",
"contentsOpaque": true,
"drawsContent": false
},
{
"name": "LayoutBlockFlow (positioned) DIV id='toMove'",
"bounds": [100, 100],
......
<!DOCTYPE html>
<style>
.compositedBehind {
width: 500px;
height: 500px;
background-color: cyan;
}
.containerOverlapsComposited {
position: absolute;
top: 20px;
left: 20px;
width: 100px;
height: 30000px;
background-color: green;
}
.fixed {
position: relative;
top: 125px;
left: 25px;
background-color: lime;
width: 50px;
height: 50px;
}
</style>
<script>
onload = () => {
window.scrollTo(0, 100);
};
</script>
<div class="compositedBehind"> </div>
<div class="containerOverlapsComposited">
<div class="fixed"></div>
</div>
......@@ -24,7 +24,6 @@
.fixed {
position: fixed;
opacity: 0.99; /* Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. */
top: 45px;
left: 45px;
background-color: lime;
......@@ -35,11 +34,6 @@
</style>
<script>
if (window.internals) {
/* Note carefully, compositing for fixed position is _disabled_ here */
internals.settings.setPreferCompositingToLCDTextEnabled(false);
}
function repaintTest() {
window.scrollTo(0, 100);
}
......
......@@ -7,7 +7,6 @@
<style>
#fixed {
position: fixed;
opacity: 0.99; /* Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. */
bottom: 30px;
right: 0px;
}
......
<!DOCTYPE html>
<body onload="scrollBy(0, 200)" style="height: 2000px">
Tests invalidation of fixed element when scrolled in a page with empty root layer. Passes if there is no red.
<div style="
position: absolute;
top: 250px;
left: 0;
width: 100px;
height: 100px;
background: green">
</div>
</body>
......@@ -8,10 +8,8 @@ onload = runRepaintAndPixelTest;
</script>
<body style="height: 2000px">
Tests invalidation of fixed element when scrolled in a page with empty root layer. Passes if there is no red.
<!-- Using 99% opacity on fixed pos element to ensure it is not automatically promoted. -->
<div style="
position: fixed;
opacity: 0.99;
top: 50px;
left: 0;
width: 100px;
......
<!doctype HTML>
<div style="width: 200px; height: 10000px; background: lightblue">
<div style="position: relative; width: 100px; height: 100px; background: lightgray; top: 10px"></div>
</div>
<div style="position: absolute; width: 100px; height: 100px; background: lightgray; top: 110px; left: 100px"></div>
<script>
onload = () => {
document.scrollingElement.scrollTop = 10;
};
</script>
......@@ -6,9 +6,8 @@
</style>
<script src="../resources/text-based-repaint.js"></script>
<html>
<!-- Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. -->
<div style="position: fixed; opacity: 0.99; width: 100px; height: 100px; background: lightgray"></div>
<div style="position: fixed; opacity: 0.99; width: 100px; height: 100px; background: lightgray; top: 100px; left: 100px;"></div>
<div style="position: fixed; width: 100px; height: 100px; background: lightgray"></div>
<div style="position: fixed; width: 100px; height: 100px; background: lightgray; top: 100px; left: 100px;"></div>
<div style="width: 200px; height: 10000px; background: lightblue"></div>
<span id="cvd_extension_svg_filter" hidden="">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
......
......@@ -9,9 +9,6 @@
html {
overflow: scroll;
}
.fixed {
opacity: 0.99; /* Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. */
}
</style>
<script src="../resources/text-based-repaint.js" type="text/javascript"></script>
<script type="text/javascript">
......
<!DOCTYPE html>
<body onload="scrollTo(0, 20)" style="height:2000px;">
<p style="position: absolute; top: 20px;">
Repaint test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=11452">http://bugs.webkit.org/show_bug.cgi?id=11452</a>
REGRESSION (r16736-r16801): Incorrect repaint of fixed boxes</i>.
</p>
<div style="position: absolute; width: 100px; height: 100px; top: 120px; background: green"></div>
</body>
......@@ -15,11 +15,10 @@
</script>
</head>
<body style="height:2000px;">
<p style="position: relative; top: 20px;">
<p style="position: absolute; top: 20px;">
Repaint test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=11452">http://bugs.webkit.org/show_bug.cgi?id=11452</a>
REGRESSION (r16736-r16801): Incorrect repaint of fixed boxes</i>.
</p>
<!-- Using 99% opacity to ensure fixed position is not automatically promoted. -->
<div id="t" style="position: fixed; opacity: 0.99; width: 100px; height: 100px; background: red"></div>
<div id="t" style="position: fixed; top: 100px; width: 100px; height: 100px; background: red"></div>
</body>
</html>
......@@ -11,7 +11,6 @@
bottom: 0;
left: 0;
position: fixed;
opacity: 0.99; /* Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. */
right: 0;
top: 0;
background-color: green;
......@@ -21,7 +20,6 @@
}
input {
position: fixed;
opacity: 0.99; /* Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. */
z-index: 10;
bottom: 0;
}
......
<!DOCTYPE html>
<body onload="scrollBy(0, 200)" style="height: 3000px;">
<p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<div style="position: absolute; top: 270px; left: 0">
<div style="width: 100px; height: 100px; background: green; position: absolute; left: 150px"></div>
<div style="width: 100px; height: 100px; background: yellow; position: absolute; left: 10px"></div>
</div>
</body>
......@@ -7,6 +7,11 @@
"backgroundColor": "#FFFFFF",
"transform": 1
},
{
"name": "LayoutNGBlockFlow (positioned) DIV id='fixedParent'",
"contentsOpaque": true,
"drawsContent": false
},
{
"name": "LayoutNGBlockFlow (positioned) DIV id='toMove'",
"bounds": [100, 100],
......
......@@ -17,11 +17,10 @@
</script>
</head>
<body onload="scrollAndRepaint()" style="height: 3000px;">
<!-- Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. -->
<div style="position: fixed: opacity: 0.99; top: 0; left: 0;">
<p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; opacity: 0.99; top: 70px; left: 10px;"></div>
<div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
<p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<div id="fixedParent" style="position: fixed; top: 0; left: 0;">
<div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 70px; left: 10px;"></div>
</div>
<div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
</body>
</html>
<!DOCTYPE html>
<body onload="scrollBy(0, 200)" style="height: 3000px;">
<p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<div style="position: absolute; top: 270px; left: 0">
<div style="width: 100px; height: 100px; background: green; position: absolute; left: 150px;"></div>
<div style="width: 100px; height: 100px; background: yellow; position: absolute; left: 10px;"></div>
</div>
</body>
......@@ -7,6 +7,11 @@
"backgroundColor": "#FFFFFF",
"transform": 1
},
{
"name": "LayoutNGBlockFlow (positioned) DIV id='fixedParent'",
"contentsOpaque": true,
"drawsContent": false
},
{
"name": "LayoutNGBlockFlow (positioned) DIV id='toMove'",
"bounds": [100, 100],
......
......@@ -16,11 +16,10 @@
</script>
</head>
<body onload="scrollAndRepaint()" style="height: 3000px;">
<!-- Using 99% opacity on fixed pos elements to ensure they are not automatically promoted. -->
<div style="position: fixed: opacity: 0.99; top: 0; left: 0;">
<p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; opacity: 0.99; top: 70px; left: 10px;"></div>
<div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
<p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<div id="fixedParent" style="position: fixed; top: 0; left: 0">
<div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 70px; left: 10px;"></div>
</div>
<div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
</body>
</html>
<!DOCTYPE html>
<body onload="scrollBy(0, 200)" style="height: 3000px;">
<p style="position: absolute; top: 210px">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<div style="position: absolute; top: 270px; left: 0">
<div style="width: 100px; height: 100px; background: green; position: absolute; left: 150px;"></div>
<div style="width: 100px; height: 100px; background: yellow; position: absolute; left: 10px;"></div>
</div>
</body>
......@@ -17,8 +17,7 @@
</head>
<body onload="scrollAndRepaint()" style="height: 3000px;">
<p style="position: absolute; top: 210">You should see a yellow rect on the left, and a green one on the right. No red pixels.</p>
<!-- Using 99% opacity to ensure fixed position is not automatically promoted. -->
<div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 70px; left: 10px; opacity: 0.99;"></div>
<div id="toMove" style="width: 100px; height: 100px; background-color: red; position: fixed; top: 70px; left: 10px;"></div>
<div style="width: 100px; height: 100px; background-color: yellow; position: absolute; top: 270px; left: 10px; z-index: -5;"></div>
</body>
</html>
<!DOCTYPE html>
<script>
onload = function() {
window.scrollTo(0, 400);
};
</script>
Tests paint invalidation of fixed element under a composited absolute element on resize after scrolled.
Passes if there is a 100x200 green rectangle and no red.
<div style="position: absolute; top: 2000px; width: 1px; height: 1px"></div>
<div style="position: absolute; top: 400px; left: 0; width: 100px; height: 200px; background: green"></div>
......@@ -31,8 +31,6 @@ onload = function() {
}
#fixed {
position: fixed;
/* Using 99% opacity to ensure fixed position is not automatically promoted. */
opacity: 0.99;
top: 0;
left: 0;
width: 100px;
......
......@@ -26,8 +26,6 @@ body {
}
#fixed {
position: fixed;
/* Using 99% opacity to ensure fixed position is not automatically promoted. */
opacity: 0.99;
top: 100px;
left: 100px;
width: 200px;
......
<!DOCTYPE html>
<script>
onload = function() {
window.scrollTo(0, 400);
};
</script>
Tests paint invalidation of fixed element under a composited absolute element on resize after scrolled.
Passes if there is a 100x200 green rectangle with blue border and no red.
<div style="position: absolute; top: 2000px; width: 1px; height: 1px"></div>
<div style="position: absolute; top: 400px; left: 0; width: 100px; height: 200px; border: 10px solid blue; background: green"></div>
......@@ -30,8 +30,6 @@ onload = function() {
z-index: 1000;
}
#fixed {
/* Using 99% opacity to ensure fixed position is not automatically promoted. */
opacity: 0.99;
position: fixed;
top: 0;
left: 0;
......
{
"layers": [
{
"name": "Scrolling Contents Layer",
"bounds": [785, 2016],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"transform": 1
},
{
"name": "LayoutNGBlockFlow (positioned) DIV id='t'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#008000",
"invalidations": [
[0, 0, 100, 100]
],
"transform": 2
},
{
"name": "ContentsLayer for Vertical Scrollbar Layer",
"position": [785, 0],
"bounds": [15, 600],
"contentsOpaque": true
}
],
"transforms": [
{
"id": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, -20, 0, 1]
]
},
{
"id": 2,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[8, 64, 0, 1]
]
}
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment