Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint.html

Issue 2321183002: Move repaint tests (except for svg/) to paint/invalidation (Closed)
Patch Set: - Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint.html
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint.html b/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint.html
new file mode 100644
index 0000000000000000000000000000000000000000..7b6a7d8b64ea930008dd052727330ae16545c6b7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/flexbox/repaint.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<style>
+#flexbox {
+ display: flex;
+}
+
+#left {
+ flex: 1;
+ background-color: yellow;
+}
+
+#content {
+ flex: 1;
+ background-color: grey;
+}
+</style>
+<script src="../resources/text-based-repaint.js"></script>
+<script>
+// This test makes sure that we repaint the right region of a flexbox when
+// changing the flex values. Only the middle of the test page should be
+// repainted. If the top of the test page (above the flexbox) is repainted,
+// this test fails.
+
+function setFlex(id, animationPercentage, start, end) {
+ var flexValue = start + ((end - start) * animationPercentage);
+ document.getElementById(id).style.flex = flexValue + " 0 0px";
+}
+
+function repaintTest() {
+ window.requestAnimationFrame(function() {
+ setFlex("content", 0.9, 1, 5);
+ window.requestAnimationFrame(function() {
+ setFlex("content", 1, 1, 5);
+ window.requestAnimationFrame(function() {
+ finishRepaintTest();
+ });
+ });
+ });
+}
+
+window.testIsAsync = true;
+window.onload = runRepaintAndPixelTest;
+</script>
+<br><br><br><br><br><br>
+<div id="flexbox">
+<div id="left"></div>
+<div id="content">
+<p style="margin: 0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet. Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula. Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.</p>
+</div>

Powered by Google App Engine
This is Rietveld 408576698