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

Unified Diff: LayoutTests/fast/repaint/position-change-keeping-geometry.html

Issue 536183002: Don't always full invalidation on 'position' style change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@FlexAlignRepaint
Patch Set: Fix test (force z-index to avoid it from changing) Created 6 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
« no previous file with comments | « no previous file | LayoutTests/fast/repaint/position-change-keeping-geometry-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/repaint/position-change-keeping-geometry.html
diff --git a/LayoutTests/fast/repaint/position-change-keeping-geometry.html b/LayoutTests/fast/repaint/position-change-keeping-geometry.html
new file mode 100644
index 0000000000000000000000000000000000000000..8901d457e87c11e8bae2c9588092ce9b25dee07d
--- /dev/null
+++ b/LayoutTests/fast/repaint/position-change-keeping-geometry.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<script src="resources/text-based-repaint.js"></script>
+<script>
+function changePositionKeepingGeometry(id, newPosition) {
+ var target = document.getElementById(id);
+ var originalTop = target.offsetTop;
+ var originalLeft = target.offsetLeft;
+ target.style.position = newPosition;
+ target.style.top = originalTop + 'px';
+ target.style.left = originalLeft + 'px';
+}
+
+function repaintTest()
+{
+ changePositionKeepingGeometry('target1', 'absolute');
+ changePositionKeepingGeometry('target2', 'absolute');
+ changePositionKeepingGeometry('target3', 'fixed');
+}
+onload = runRepaintTest;
+</script>
+<style>
+body {
+ margin: 0;
+}
+div {
+ width: 100px;
+ height: 100px;
+ top: 20px;
+ background-color: blue;
+}
+#target1 {
+ left: 20px;
+ position: relative;
+}
+#target2 {
+ left: 220px;
+ position: fixed;
+ z-index: 0;
+}
+#target3 {
+ left: 420px;
+ position: absolute;
+ z-index: 0;
+}
+</style>
+There should be no invalildations on change of position without actual change of position and size.
+<div id="target1"></div>
+<div id="target2"></div>
+<div id="target3"></div>
« no previous file with comments | « no previous file | LayoutTests/fast/repaint/position-change-keeping-geometry-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698