1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/w3c-css/submitted/flexbox/flexbox-align-self-vert-4-ref.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,96 @@ 1.4 +<?xml version="1.0" encoding="UTF-8"?> 1.5 +<!-- 1.6 + Any copyright is dedicated to the Public Domain. 1.7 + http://creativecommons.org/publicdomain/zero/1.0/ 1.8 +--> 1.9 +<!-- Reference case for align-items / align-self behavior, using blocks in 1.10 + place of flex items and using float and width keywords to emulate the 1.11 + align-items / align-self properties. --> 1.12 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.13 + <head> 1.14 + <title>CSS Reftest Reference</title> 1.15 + <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 1.16 + <style> 1.17 + .flexbox { 1.18 + border: 1px dashed blue; 1.19 + width: 4px; 1.20 + float: left; 1.21 + font-family: sans-serif; 1.22 + font-size: 10px; 1.23 + margin-left: 80px; 1.24 + } 1.25 + 1.26 + .flex-start, .flex-end, .center, .baseline, .stretch { 1.27 + clear: both; 1.28 + margin: 1px 2px 3px 4px; 1.29 + border-width: 2px 3px 4px 5px; 1.30 + padding: 3px 4px 5px 6px; 1.31 + border-style: dotted; 1.32 + } 1.33 + 1.34 + div.big { 1.35 + font-size: 18px; 1.36 + width: 50px; 1.37 + } 1.38 + 1.39 + /* Classes for each of the various align-self values */ 1.40 + .flex-start { 1.41 + background: lime; 1.42 + float: left; 1.43 + } 1.44 + .flex-end { 1.45 + background: orange; 1.46 + float: right; 1.47 + } 1.48 + <!-- We center shrinkwrapped text by putting it into an inline-block, and 1.49 + then wrapping that inline-block in a helper-div that has 1.50 + "text-align:center" set. For this to work, the parent has to be at 1.51 + least as wide as the centered content inside of it, so we make it 1.52 + large with a negative margin such that its center aligns with the 1.53 + 4px-wide container's center. --> 1.54 + .centerParent { 1.55 + text-align: center; 1.56 + width: 100px; 1.57 + margin-left: -48px; 1.58 + } 1.59 + .center { 1.60 + background: lightblue; 1.61 + display: inline-block; 1.62 + text-align: left; /* Keep parent's centering from tweaking my text */ 1.63 + } 1.64 + .baseline { 1.65 + background: teal; 1.66 + float: left; 1.67 + } 1.68 + .stretch { 1.69 + background: pink; 1.70 + } 1.71 + .clearFloats { clear: both } 1.72 + </style> 1.73 + </head> 1.74 + <body> 1.75 + <div class="flexbox"> 1.76 + <div class="flex-start">start</div> 1.77 + <div class="flex-start big">a b</div> 1.78 + <div class="flex-end">end</div> 1.79 + <div class="flex-end big">a b</div> 1.80 + <div class="centerParent"> 1.81 + <div class="center">center</div> 1.82 + </div> 1.83 + <div class="centerParent"> 1.84 + <div class="center big">a b</div> 1.85 + </div> 1.86 + </div> 1.87 + <div class="flexbox"> 1.88 + <div class="baseline">base</div> 1.89 + <div class="baseline big">abc</div> 1.90 + <div class="clearFloats"></div> 1.91 + <div class="stretch">stretch</div> 1.92 + <!-- Force a 3px + 1px = 4px margin between this and the previous div 1.93 + (to thwart the effects of margin-collapsing). This is the only 1.94 + place we need this hack, because everywhere else in this test 1.95 + we use floats or inline-blocks, whose margins don't collapse. --> 1.96 + <div class="stretch big" style="margin-top: 4px">a b</div> 1.97 + </div> 1.98 + </body> 1.99 +</html>