layout/reftests/w3c-css/submitted/flexbox/flexbox-align-self-baseline-horiz-2.xhtml

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <?xml version="1.0" encoding="UTF-8"?>
michael@0 2 <!--
michael@0 3 Any copyright is dedicated to the Public Domain.
michael@0 4 http://creativecommons.org/publicdomain/zero/1.0/
michael@0 5 -->
michael@0 6 <!-- Testcase for how a baseline-aligned flex item's position is impacted by
michael@0 7 cross-axis margins, in a fixed-size flex container.
michael@0 8 -->
michael@0 9 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 10 <head>
michael@0 11 <title>CSS Test: Baseline alignment of flex items in fixed-size single-line flex container</title>
michael@0 12 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
michael@0 13 <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#baseline-participation"/>
michael@0 14 <link rel="match" href="flexbox-align-self-baseline-horiz-2-ref.xhtml"/>
michael@0 15 <style>
michael@0 16 .flexbox {
michael@0 17 display: flex;
michael@0 18 align-items: baseline;
michael@0 19 width: 40px;
michael@0 20 height: 40px;
michael@0 21 border: 1px solid gray;
michael@0 22 margin: 5px; /* just for visual separation */
michael@0 23 float: left;
michael@0 24 }
michael@0 25
michael@0 26 .flexbox > * {
michael@0 27 background: yellow;
michael@0 28 border: 1px solid black;
michael@0 29 height: 20px;
michael@0 30 flex: 1;
michael@0 31 }
michael@0 32 </style>
michael@0 33 </head>
michael@0 34 <body>
michael@0 35 <!-- ZEROTH ROW: NO MARGINS -->
michael@0 36 <!-- No margins on flex item: -->
michael@0 37 <div class="flexbox">
michael@0 38 <div>a</div>
michael@0 39 </div>
michael@0 40
michael@0 41
michael@0 42 <!-- FIRST ROW: SETTING MARGIN-TOP: -->
michael@0 43 <br style="clear: both"/>
michael@0 44
michael@0 45 <!-- auto: -->
michael@0 46 <div class="flexbox">
michael@0 47 <div style="margin-top: auto">a</div>
michael@0 48 </div>
michael@0 49
michael@0 50 <!-- Negative: -->
michael@0 51 <div class="flexbox">
michael@0 52 <div style="margin-top: -4px">a</div>
michael@0 53 </div>
michael@0 54
michael@0 55 <!-- Small: -->
michael@0 56 <div class="flexbox">
michael@0 57 <div style="margin-top: 4px">a</div>
michael@0 58 </div>
michael@0 59
michael@0 60 <!-- Large (pushing us out of container): -->
michael@0 61 <div class="flexbox">
michael@0 62 <div style="margin-top: 25px">a</div>
michael@0 63 </div>
michael@0 64
michael@0 65
michael@0 66 <!-- SECOND ROW: SETTING MARGIN-BOTTOM: -->
michael@0 67 <br style="clear: both"/>
michael@0 68
michael@0 69 <!-- auto: -->
michael@0 70 <div class="flexbox">
michael@0 71 <div style="margin-bottom: auto">a</div>
michael@0 72 </div>
michael@0 73
michael@0 74 <!-- Negative: -->
michael@0 75 <div class="flexbox">
michael@0 76 <div style="margin-bottom: -4px">a</div>
michael@0 77 </div>
michael@0 78
michael@0 79 <!-- Small: -->
michael@0 80 <div class="flexbox">
michael@0 81 <div style="margin-bottom: 4px">a</div>
michael@0 82 </div>
michael@0 83
michael@0 84 <!-- Large: -->
michael@0 85 <div class="flexbox">
michael@0 86 <div style="margin-bottom: 25px">a</div>
michael@0 87 </div>
michael@0 88
michael@0 89 </body>
michael@0 90 </html>

mercurial