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> |