Skip to content

Commit 37c2d54

Browse files
committed
2 parents ec31af4 + 3436af9 commit 37c2d54

File tree

519 files changed

+26038
-2325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

519 files changed

+26038
-2325
lines changed

LayoutTests/TestExpectations

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ remote-layer-tree [ Skip ]
108108
inspector/page/setScreenSizeOverride.html [ Skip ]
109109
interaction-region [ Skip ]
110110
overlay-region [ Skip ]
111-
pdf/unifiedpdf [ Skip ]
111+
pdf [ Skip ]
112112
ipc/restrictedendpoints/mac [ Skip ]
113113

114114
# Requires async overflow scrolling

LayoutTests/fast/css/aspect-ratio-no-relayout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
if (window.testRunner && window.internals) {
66
testRunner.dumpAsText();
77
document.body.offsetTop;
8-
const layoutCountBefore = internals.layoutCount;
8+
internals.startTrackingLayoutUpdates();
99
target.style.color = "blue";
1010
document.body.offsetTop;
11-
log.textContent = `Layout count: ${internals.layoutCount - layoutCountBefore}`;
11+
log.textContent = `Layout count: ${internals.layoutUpdateCount()}`;
1212
}
1313
</script>

LayoutTests/fast/css/font-size-adjust-none-no-relayout.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
if (window.testRunner && window.internals) {
55
testRunner.dumpAsText();
66
document.body.offsetTop;
7-
const layoutCountBefore = internals.layoutCount;
7+
internals.startTrackingLayoutUpdates();
88
document.documentElement.style.fontSizeAdjust = 'none';
99
document.body.offsetTop;
10-
log.textContent = `Layout count: ${internals.layoutCount - layoutCountBefore}`;
10+
log.textContent = `Layout count: ${internals.layoutUpdateCount()}`;
1111
}
12-
</script>
12+
</script>

LayoutTests/fast/images/animated-gif-no-layout.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
// no layout. If the test passes, there are two green squares. If it fails, then one
44
// or both of the squares is red instead.
55

6-
var layoutCountBeforeTimer;
7-
86
function animationComplete()
97
{
108
if (window.internals && window.testRunner) {
119
internals.updateLayoutAndStyleForAllFrames();
12-
var count = internals.layoutCount - layoutCountBeforeTimer;
13-
if (count == 0) {
10+
if (internals.layoutUpdateCount() == 0) {
1411
var indicator = document.getElementById("indicator");
1512
indicator.addEventListener("load", function() { testRunner.notifyDone(); })
1613
indicator.src = "resources/rgb-jpeg-green.jpg";
@@ -25,7 +22,7 @@
2522
if (window.internals && window.testRunner) {
2623
testRunner.waitUntilDone();
2724
internals.updateLayoutAndStyleForAllFrames();
28-
layoutCountBeforeTimer = internals.layoutCount;
25+
internals.startTrackingLayoutUpdates();
2926
}
3027

3128
// The 200ms value here is longer than the time it takes for gif-loop-count.gif
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Test that layout and render layer updates do not happen for style changes that do not need them.
2+
3+
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4+
5+
6+
PASS result.actualLayoutCount is result.expectedLayoutCount
7+
PASS result.actualLayerUpdateCount is result.expectedLayerUpdateCount
8+
PASS result.actualLayoutCount is result.expectedLayoutCount
9+
PASS result.actualLayerUpdateCount is result.expectedLayerUpdateCount
10+
PASS result.actualLayoutCount is result.expectedLayoutCount
11+
PASS result.actualLayerUpdateCount is result.expectedLayerUpdateCount
12+
PASS result.actualLayoutCount is result.expectedLayoutCount
13+
PASS result.actualLayerUpdateCount is result.expectedLayerUpdateCount
14+
PASS result.actualLayoutCount is result.expectedLayoutCount
15+
PASS result.actualLayerUpdateCount is result.expectedLayerUpdateCount
16+
PASS successfullyParsed is true
17+
18+
TEST COMPLETE
19+
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
body {
6+
height: 5000px;
7+
}
8+
.container > div {
9+
margin: 20px;
10+
width: 100px;
11+
height: 100px;
12+
background-color: blue;
13+
}
14+
</style>
15+
<script src="../../resources/js-test-pre.js"></script>
16+
<script>
17+
description('Test that layout and render layer updates do not happen for style changes that do not need them.');
18+
window.jsTestIsAsync = true;
19+
20+
var results = [];
21+
var result;
22+
23+
// Stash the results during the test, so that we don't mutate layout inserting the output into the document.
24+
function expectLayoutAndLayerUpdateCounts(layoutCount, layerUpdateCount)
25+
{
26+
results.push({
27+
expectedLayoutCount: layoutCount,
28+
actualLayoutCount: internals.layoutUpdateCount(),
29+
expectedLayerUpdateCount: layerUpdateCount,
30+
actualLayerUpdateCount: internals.renderLayerPositionUpdateCount()
31+
});
32+
}
33+
34+
function runTest()
35+
{
36+
internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
37+
internals.startTrackingLayoutUpdates();
38+
internals.startTrackingRenderLayerPositionUpdates();
39+
40+
const boxes = document.querySelectorAll('.box');
41+
42+
// Check that interleaved mutations and getBoundingClientRect don't trigger layer updates.
43+
boxes[0].style.width = "101px";
44+
boxes[0].getBoundingClientRect();
45+
46+
expectLayoutAndLayerUpdateCounts(1, 0);
47+
48+
boxes[1].style.width = "101px";
49+
boxes[1].getBoundingClientRect();
50+
51+
expectLayoutAndLayerUpdateCounts(2, 0);
52+
53+
boxes[2].style.width = "101px";
54+
boxes[2].getBoundingClientRect();
55+
56+
expectLayoutAndLayerUpdateCounts(3, 0);
57+
58+
// Check that getBoundingClientRect without mutations doesn't do any extra work.
59+
for (let box of boxes) {
60+
box.getBoundingClientRect();
61+
}
62+
63+
expectLayoutAndLayerUpdateCounts(3, 0);
64+
65+
// Check that flushing layout via another property results in the layer update happening.
66+
boxes[1].offsetTop;
67+
68+
expectLayoutAndLayerUpdateCounts(4, 1);
69+
70+
for (let i = 0; i < results.length; i++) {
71+
result = results[i];
72+
shouldBe('result.actualLayoutCount', 'result.expectedLayoutCount');
73+
shouldBe('result.actualLayerUpdateCount', 'result.expectedLayerUpdateCount');
74+
}
75+
76+
finishJSTest();
77+
}
78+
79+
window.addEventListener('load', function() {
80+
window.setTimeout(runTest, 200);
81+
}, false);
82+
</script>
83+
</head>
84+
<body>
85+
<div class="container">
86+
<div id="box" class="box"></div>
87+
<div id="box" class="box"></div>
88+
<div id="box" class="box"></div>
89+
<div id="box" class="box"></div>
90+
<div id="box" class="box"></div>
91+
<div id="box" class="box"></div>
92+
<div id="box" class="box"></div>
93+
<div id="box" class="box"></div>
94+
</div>
95+
96+
<script src="../../resources/js-test-post.js"></script>
97+
</body>
98+
</html>

LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Test that clip-path shapes accept different length units
33
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
44

55

6-
PASS innerStyle("-webkit-clip-path", "circle(0 at 0 0)") is "circle(0px at 0% 0%)"
6+
PASS innerStyle("-webkit-clip-path", "circle(0 at 0 0)") is "circle(0px at 0px 0px)"
77
PASS innerStyle("-webkit-clip-path", "circle(1px at -1px +1px)") is "circle(1px at -1px 1px)"
88
PASS innerStyle("-webkit-clip-path", "circle(1.5px at -1.5px +1.5px)") is "circle(1.5px at -1.5px 1.5px)"
99
PASS innerStyle("-webkit-clip-path", "circle(.5px at -.5px +.5px)") is "circle(0.5px at -0.5px 0.5px)"

LayoutTests/fast/masking/parsing-clip-path-shape.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
}
4141

4242
// absolute lengths - number serialization, units
43-
testInner("-webkit-clip-path", "circle(0 at 0 0)", "circle(0px at 0% 0%)");
43+
testInner("-webkit-clip-path", "circle(0 at 0 0)", "circle(0px at 0px 0px)");
4444
testInner("-webkit-clip-path", "circle(1px at -1px +1px)", "circle(1px at -1px 1px)");
4545
testInner("-webkit-clip-path", "circle(1.5px at -1.5px +1.5px)", "circle(1.5px at -1.5px 1.5px)");
4646
testInner("-webkit-clip-path", "circle(.5px at -.5px +.5px)", "circle(0.5px at -0.5px 0.5px)");

LayoutTests/fast/repaint/list-item-equal-style-change-no-repaint.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929

3030
if (window.internals) {
3131
document.body.offsetHeight;
32-
let layoutCountBefore = internals.layoutCount;
32+
internals.startTrackingLayoutUpdates();
3333
// This should not trigger layout.
3434
document.body.classList.add('animated');
3535
document.body.offsetHeight;
36-
let layoutCountAfter = internals.layoutCount;
36+
let layoutCount = internals.layoutUpdateCount();
3737

3838
let pre = document.createElement('pre');
3939
document.body.appendChild(pre);
40-
pre.innerHTML = "Number of layouts triggered: " + (layoutCountAfter - layoutCountBefore);
40+
pre.innerHTML = "Number of layouts triggered: " + layoutCount;
4141
}
4242
</script>
4343
</html>

LayoutTests/fast/repaint/text-emphasis-h.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
<div style="-webkit-text-emphasis: 'm';">
1616
1111
1717
</div>
18-
<div style="-webkit-text-emphasis: 'm'; -webkit-text-emphasis-position: under;">
18+
<div style="-webkit-text-emphasis: 'm'; text-emphasis-position: over left;">
1919
1111
2020
</div>
2121

2222
<div style="-webkit-writing-mode: vertical-rl; -webkit-text-emphasis: 'm';">
2323
1111
2424
</div>
25-
<div style="-webkit-writing-mode: vertical-rl; -webkit-text-emphasis: 'm'; -webkit-text-emphasis-position: under;">
25+
<div style="-webkit-writing-mode: vertical-rl; -webkit-text-emphasis: 'm'; text-emphasis-position: over left">
2626
1111
2727
</div>
2828
</div>

0 commit comments

Comments
 (0)