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

Unified Diff: LayoutTests/fast/css-grid-layout/grid-item-named-grid-area-resolution.html

Issue 22759002: [CSS Grid Layout] Add support for named grid areas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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/css-grid-layout/grid-item-named-grid-area-resolution-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css-grid-layout/grid-item-named-grid-area-resolution.html
diff --git a/LayoutTests/fast/css-grid-layout/grid-item-named-grid-area-resolution.html b/LayoutTests/fast/css-grid-layout/grid-item-named-grid-area-resolution.html
new file mode 100644
index 0000000000000000000000000000000000000000..61e18a32f2cd10bb02a0c92e04b4e352b278bedc
--- /dev/null
+++ b/LayoutTests/fast/css-grid-layout/grid-item-named-grid-area-resolution.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.testRunner)
+ testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
+</script>
+<link href="resources/grid.css" rel="stylesheet">
+<style>
+.grid {
+ grid-definition-rows: "before" 50px "middle" 100px "after";
+ grid-definition-columns: 40px 80px 160px;
+}
+
+.gridWithoutRepeat {
+ grid-template: "first second third"
+ "fourth fifth sixth";
+}
+
+.gridWithRepeat {
+ grid-template: "first second third"
+ "fourth fourth third";
+}
+
+.gridItemFirstArea {
+ grid-area: first;
+}
+
+.gridItemSecondArea {
+ grid-area: second;
+}
+
+.gridItemThirdArea {
+ grid-area: third;
+}
+
+.gridItemFourthArea {
+ grid-area: fourth;
+}
+
+.gridItemFifthArea {
+ grid-area: fifth;
+}
+
+.gridItemSixthArea {
+ grid-area: sixth;
+}
+
+.gridItemSpan2ThirdArea {
+ grid-row: fourth;
+ grid-column: span 2 / third;
+}
+
+.gridItemNamedGridLineWithArea {
+ grid-row: third / "after";
+ grid-column: 1;
+}
+</style>
+<script src="../../resources/check-layout.js"></script>
+</head>
+<body onload="checkLayout('.grid')">
+
+<p>This test checks that we resolve named grid areas per the specification.</p>
+
+<div style="position: relative">
+ <div class="grid gridWithoutRepeat">
+ <div class="sizedToGridArea gridItemSixthArea" data-offset-x="120" data-offset-y="50" data-expected-width="160" data-expected-height="100"></div>
+ <div class="sizedToGridArea gridItemFifthArea" data-offset-x="40" data-offset-y="50" data-expected-width="80" data-expected-height="100"></div>
+ <div class="sizedToGridArea gridItemFourthArea" data-offset-x="0" data-offset-y="50" data-expected-width="40" data-expected-height="100"></div>
+ <div class="sizedToGridArea gridItemThirdArea" data-offset-x="120" data-offset-y="0" data-expected-width="160" data-expected-height="50"></div>
+ <div class="sizedToGridArea gridItemSecondArea" data-offset-x="40" data-offset-y="0" data-expected-width="80" data-expected-height="50"></div>
+ <div class="sizedToGridArea gridItemFirstArea" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="50"></div>
+
+ <div class="sizedToGridArea gridItemSpan2ThirdArea" data-offset-x="40" data-offset-y="50" data-expected-width="240" data-expected-height="100"></div>
+ <div class="sizedToGridArea gridItemNamedGridLineWithArea" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="150"></div>
+ </div>
+</div>
+
+<div style="position: relative">
+ <div class="grid gridWithRepeat">
+ <!-- fifth and sixth are invalid named grid areas. -->
+ <div class="sizedToGridArea gridItemSixthArea" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="50"></div>
+ <div class="sizedToGridArea gridItemFifthArea" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="50"></div>
+
+ <div class="sizedToGridArea gridItemFourthArea" data-offset-x="0" data-offset-y="50" data-expected-width="120" data-expected-height="100"></div>
+ <div class="sizedToGridArea gridItemThirdArea" data-offset-x="120" data-offset-y="0" data-expected-width="160" data-expected-height="150"></div>
+ <div class="sizedToGridArea gridItemSecondArea" data-offset-x="40" data-offset-y="0" data-expected-width="80" data-expected-height="50"></div>
+ <div class="sizedToGridArea gridItemFirstArea" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="50"></div>
+
+ <div class="sizedToGridArea gridItemSpan2ThirdArea" data-offset-x="40" data-offset-y="50" data-expected-width="240" data-expected-height="100"></div>
+ <div class="sizedToGridArea gridItemNamedGridLineWithArea" data-offset-x="0" data-offset-y="0" data-expected-width="40" data-expected-height="150"></div>
+ </div>
+</div>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/css-grid-layout/grid-item-named-grid-area-resolution-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698