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

Unified Diff: LayoutTests/fast/sub-pixel/sub-pixel-composited-layers.html

Issue 20723003: Fix pixel snapping issues when layers become composited (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring up to ToT again... Created 6 years, 11 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 | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/sub-pixel/sub-pixel-composited-layers-expected.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/sub-pixel/sub-pixel-composited-layers.html
diff --git a/LayoutTests/fast/sub-pixel/sub-pixel-composited-layers.html b/LayoutTests/fast/sub-pixel/sub-pixel-composited-layers.html
new file mode 100644
index 0000000000000000000000000000000000000000..99789ccfc29422a2d4bb94a797ccf9630b4d9b95
--- /dev/null
+++ b/LayoutTests/fast/sub-pixel/sub-pixel-composited-layers.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ #test {
+ margin: 5px;
+ }
+ #test.composite > .container {
+ -webkit-transform: translateZ(0);
+ opacity: 0.95;
+ }
+ .container {
+ position: absolute;
+ }
+ .shifter {
+ position: absolute;
+ background-color: black;
+ width: 12.5px;
+ height: 12.5px;
+ }
+</style>
+</head>
+<body>
+<div id=test class=composite>
+</div>
+<script>
+ function setupGrid(leftOffset, topOffset, leftFraction, topFraction, multiplier)
+ {
+ var test = document.getElementById('test');
+ for (var i = 0; i < 10; i++) {
+ if (i == 5)
+ topOffset += 5;
+ var leftOffsetj = leftOffset;
+ for (var j = 0; j < 10; j++) {
+ if (j == 5)
+ leftOffsetj += 5;
+ var container = document.createElement("div");
+ var shifter = document.createElement("div");
+ container.setAttribute('class', 'container');
+ shifter.setAttribute('class', 'shifter');
+ container.style.left = (leftOffsetj + j * multiplier + i * leftFraction) + "px"
+ container.style.top = (topOffset + i * multiplier + i * topFraction) + "px"
+ shifter.style.left = (5 + j * leftFraction) + "px"
+ shifter.style.top = (5 + j * topFraction) + "px"
+ container.appendChild(shifter);
+ test.appendChild(container);
+ }
+ }
+ }
+
+ function setupTest()
+ {
+ // Vertical shifts:
+ setupGrid(10, 10, 0, 0.1, 16)
+ // Horizontal shifts:
+ setupGrid(300, 10, 0.1, 0, 16);
+
+ // And in 8x8 (where exactly 0.5 is more common)
+ setupGrid(10, 200, 0, 0.125, 20);
+ setupGrid(300, 200, 0.125, 0, 20);
+ }
+
+ setupTest();
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/sub-pixel/sub-pixel-composited-layers-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698