Skip to content

Commit

Permalink
svg/compositing/transform-change-repainting-viewBox.html should not e…
Browse files Browse the repository at this point in the history
…nable layer borders

https://bugs.webkit.org/show_bug.cgi?id=267588
rdar://121052864

Reviewed by Tim Nguyen.

Turn off layer borders, remove pixel tolerance, and de-tab.

* LayoutTests/compositing/updates/animation-non-composited.html: Drive-by nit fix.
* LayoutTests/svg/compositing/transform-change-repainting-viewBox-expected.html:
* LayoutTests/svg/compositing/transform-change-repainting-viewBox.html:

Canonical link: https://commits.webkit.org/273090@main
  • Loading branch information
smfr committed Jan 16, 2024
1 parent 9b4ea11 commit 15ebca4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
initialCompositingUpdateCount = internals.compositingUpdateCount();
}
}, 0);
});

test.onanimationend = () => {
if (!window.internals)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,35 @@
transform-origin: 50% 50%;
transform-box: border-box;
transform: translateZ(0);
}
}

.animating2 {
transform-origin: 50% 50%;
transform-box: border-box;
transform: rotate(25deg) translateZ(0);
}
}

.animating3 {
transform-origin: 50% 50%;
transform-box: border-box;
transform: rotate(45deg) translateZ(0);
transform: rotate(45deg) translateZ(0);
fill: green;
}
</style>
<script type="text/javascript">
if (window.testRunner)
testRunner.waitUntilDone();

if (window.internals) {
internals.settings.setShowRepaintCounter(true);
internals.settings.setShowDebugBorders(true);
}

window.addEventListener('load', () => {
requestAnimationFrame(() => {
document.getElementById('rect').setAttribute("class", "animating2");
requestAnimationFrame(() => {
requestAnimationFrame(() => {
document.getElementById('rect').setAttribute("class", "animating3");
if (window.testRunner)
testRunner.notifyDone();
});
});
}, false);
testRunner.notifyDone();
});
});
}, false);
</script>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<!DOCTYPE html> <!-- webkit-test-runner [ LayerBasedSVGEngineEnabled=true ] -->
<html>
<head>
<meta name="fuzzy" content="maxDifference=35; totalPixels=12" />
<title>Tests that SVG documents with viewBox don't trigger unnecessary repaints during animations.</title>
<style>
svg { border: 1px solid black; }

#animating {
transform-origin: 50% 50%;
transform-box: border-box;
transform: translateZ(0);
transform: translateZ(0);

animation: rotation 1s 1s;
animation-fill-mode: forwards;
animation-fill-mode: forwards;
}

@keyframes rotation {
Expand All @@ -31,11 +30,6 @@
["rotation", 1.5, "animating", "webkitTransform", "matrix(0.707107, 0.707107, -0.707107, 0.707107, 0, 0)", 0],
];

if (window.internals) {
internals.settings.setShowRepaintCounter(true);
internals.settings.setShowDebugBorders(true);
}

var doPixelTest = true;
var disablePauseAPI = true;
runAnimationTest(expectedValues, null, undefined, disablePauseAPI, doPixelTest);
Expand All @@ -45,6 +39,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" width="500" height="300">
<rect id="animating" x="10" y="10" width="180" height="180" fill="green"/>
</svg>
<div id="result"/>
<div id="result"></div>
</body>
</html>

0 comments on commit 15ebca4

Please sign in to comment.