1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/w3c-css/submitted/flexbox/flexbox-mbp-horiz-4.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,88 @@ 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 +<!-- Testcase with percent-valued padding and/or margin on flex items. The spec 1.10 + says that percentage values on padding/margin-top and -bottom should be 1.11 + resolved against the flex container's height (not its width, as would 1.12 + be the case in a block). 1.13 +--> 1.14 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.15 + <head> 1.16 + <title>CSS Test: Testing percent-valued padding and margin on flex items</title> 1.17 + <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 1.18 + <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#layout-algorithm"/> 1.19 + <link rel="match" href="flexbox-mbp-horiz-4-ref.xhtml"/> 1.20 + <style> 1.21 + div { border: 0; } 1.22 + div.flexbox { 1.23 + width: 200px; 1.24 + display: flex; 1.25 + margin-bottom: 2px; 1.26 + border: 1px dotted black; 1.27 + } 1.28 + div.height50 { height: 50px; } 1.29 + 1.30 + .marginA { margin: 10% 8% 6% 4%; } 1.31 + .marginB { margin: 8% 10% 12% 14%; } 1.32 + .paddingA { padding: 8% 6% 4% 2%; } 1.33 + .paddingB { padding: 6% 8% 10% 12%; } 1.34 + 1.35 + div.child1 { 1.36 + flex: none; 1.37 + width: 10px; 1.38 + height: 10px; 1.39 + background: lightgreen; 1.40 + } 1.41 + div.child2 { 1.42 + flex: none; 1.43 + width: 10px; 1.44 + height: 10px; 1.45 + background: purple; 1.46 + } 1.47 + 1.48 + div.filler { 1.49 + /* Filler-div to fill up content-box and make padding easier to see. */ 1.50 + height: 10px; 1.51 + width: 100%; 1.52 + background: lightgrey; 1.53 + } 1.54 + 1.55 + </style> 1.56 + </head> 1.57 + <body> 1.58 + <!-- Flex container is auto-height - vertical margin and padding should 1.59 + resolve to 0, since they don't have anything to resolve % against. --> 1.60 + <div class="flexbox" 1.61 + ><div class="child1 paddingA"><div class="filler"/></div 1.62 + ><div class="child2 paddingB"><div class="filler"/></div 1.63 + ><div class="child1 marginA"></div 1.64 + ><div class="child2 marginB"></div 1.65 + ></div> 1.66 + 1.67 + <!-- Flex container has height: 50px - vertical margin and padding should 1.68 + resolve % values against that. --> 1.69 + <div class="flexbox height50" 1.70 + ><div class="child1 paddingA"><div class="filler"/></div 1.71 + ><div class="child2 paddingB"><div class="filler"/></div 1.72 + ><div class="child1 marginA"></div 1.73 + ><div class="child2 marginB"></div 1.74 + ></div> 1.75 + 1.76 + <!-- ...and now with align-items: flex-end, so we can see the margin-bottom 1.77 + in action --> 1.78 + <div class="flexbox height50" style="align-items: flex-end" 1.79 + ><div class="child1 paddingA"><div class="filler"/></div 1.80 + ><div class="child2 paddingB"><div class="filler"/></div 1.81 + ><div class="child1 marginA"></div 1.82 + ><div class="child2 marginB"></div 1.83 + ></div> 1.84 + 1.85 + <!-- ...and finally, with margin and padding applied to the same items --> 1.86 + <div class="flexbox height50" 1.87 + ><div class="child1 paddingA marginA"><div class="filler"/></div 1.88 + ><div class="child2 paddingB marginB"><div class="filler"/></div 1.89 + ></div> 1.90 + </body> 1.91 +</html>