layout/reftests/flexbox/flexbox-minSize-vert-1.xhtml

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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 <!--
michael@0 7 This test checks that we correctly handle flex items with an explicit
michael@0 8 "min-height: -moz-min-content".
michael@0 9
michael@0 10 We check that such flex items can't shrink below their min-content height,
michael@0 11 unless we explicitly reduce their min-height with e.g. "min-height: 0".
michael@0 12 -->
michael@0 13 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 14 <head>
michael@0 15 <style>
michael@0 16 div.flexbox {
michael@0 17 height: 140px;
michael@0 18 display: flex;
michael@0 19 flex-direction: column;
michael@0 20 margin-right: 5px;
michael@0 21 font-size: 8px;
michael@0 22 border: 1px dotted black;
michael@0 23 float: left;
michael@0 24 }
michael@0 25 div.flexbox > * {
michael@0 26 margin-bottom: 20px;
michael@0 27 border: 1px dashed green;
michael@0 28 background: lightblue;
michael@0 29 width: 40px;
michael@0 30 min-height: -moz-min-content; /* not yet supported -- see bug 852367 */
michael@0 31 }
michael@0 32 div.smallSize { height: 5px; }
michael@0 33 div.smallFlexBasis { flex-basis: 2px; }
michael@0 34 div.zeroMinHeight { min-height: 0; }
michael@0 35
michael@0 36 </style>
michael@0 37 </head>
michael@0 38 <body>
michael@0 39
michael@0 40 <!-- Check that we honor "min-height: min-content" as a lower-bound when
michael@0 41 sizing flex items. -->
michael@0 42 <div class="flexbox">
michael@0 43 <div>a b</div>
michael@0 44 <div class="smallSize">a b</div>
michael@0 45 <div class="smallFlexBasis">a b</div>
michael@0 46 </div>
michael@0 47
michael@0 48 <!-- ... EVEN if our flex container is small and we're overflowing. -->
michael@0 49 <div class="flexbox smallSize">
michael@0 50 <div>a b</div>
michael@0 51 <div class="smallSize">a b</div>
michael@0 52 <div class="smallFlexBasis">a b</div>
michael@0 53 </div>
michael@0 54
michael@0 55 <!-- Test that we don't clamp when we've got "min-height: 0" on our
michael@0 56 flex items, though. -->
michael@0 57 <div class="flexbox">
michael@0 58 <div class="zeroMinHeight">a b</div>
michael@0 59 <div class="zeroMinHeight smallSize">a b</div>
michael@0 60 <div class="zeroMinHeight smallFlexBasis">a b</div>
michael@0 61 </div>
michael@0 62
michael@0 63 <!-- ... and similarly, when we have a small flex container and we trigger
michael@0 64 shrinking behavior, flex items with "min-height: 0" are allowed to
michael@0 65 shrink past their min-content height. -->
michael@0 66 <div class="flexbox smallSize">
michael@0 67 <div class="zeroMinHeight">a b</div>
michael@0 68 <div class="zeroMinHeight smallSize">a b</div>
michael@0 69 <div class="zeroMinHeight smallFlexBasis">a b</div>
michael@0 70 </div>
michael@0 71
michael@0 72 </body>
michael@0 73 </html>

mercurial