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

Unified Diff: LayoutTests/fast/css-grid-layout/grid-positioned-items-background.html

Issue 637033003: [CSS Grid Layout] Fix positioned grid children position and size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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: LayoutTests/fast/css-grid-layout/grid-positioned-items-background.html
diff --git a/LayoutTests/fast/css-grid-layout/grid-positioned-items-background.html b/LayoutTests/fast/css-grid-layout/grid-positioned-items-background.html
new file mode 100644
index 0000000000000000000000000000000000000000..d4370145962b9535de82ad87ea5ed428c4bb6ee8
--- /dev/null
+++ b/LayoutTests/fast/css-grid-layout/grid-positioned-items-background.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<link href="resources/grid.css" rel="stylesheet">
+<style>
+
+.grid {
+ grid-template-columns: 100px 200px;
+ grid-template-rows: 50px 150px;
+ width: 400px;
+ height: 300px;
+ border: 5px solid black;
+ margin: 30px;
+ padding: 15px;
+ /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */
+ position: relative;
+}
+
+.container {
+ position: relative;
+ float: left;
+}
+
+.absolute {
+ position: absolute;
+}
+
+.grid > div {
+ background-color: green;
+}
+
+.lengthSize {
+ width: 50px;
+ height: 20px;
+}
+
+.percentageSize {
+ width: 50%;
+ height: 20%;
+}
+
+.offsetsSize {
+ left: 25px;
+ right: 30px;
+ top: 35px;
+ bottom: 40px;
+}
+
+.red {
+ background-color: red;
+}
+</style>
+<body>
+
+<p>This test checks that the background of positioned items is painted in the right position.</p>
+
+<p>The test passes if you see 4 green boxes and no red.</p>
+
+<div class="container">
+ <div class="absolute red" style="left: 55px; top: 50px; width: 100px; height: 50px"></div>
+ <div class="absolute red" style="left: 290px; top: 50px; width: 50px; height: 20px"></div>
+ <div class="absolute red" style="left: 50px; top: 115px; width: 50px; height: 30px"></div>
+ <div class="absolute red" style="left: 175px; top: 135px; width: 145px; height: 75px"></div>
+ <div class="grid">
+ <div class="absolute onlyFirstRowOnlyFirstColumn sizedToGridArea"
+ style="left: 5px;">
+ </div>
+ <div class="absolute onlyFirstRowOnlySecondColumn lengthSize"
+ style="right: 10px;">
+ </div>
+ <div class="absolute onlySecondRowOnlyFirstColumn percentageSize"
+ style="top: 15px;">
+ </div>
+ <div class="absolute onlySecondRowOnlySecondColumn offsetsSize"></div>
+ </div>
+</div>
+
+</body>

Powered by Google App Engine
This is Rietveld 408576698