| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 
 | <!DOCTYPE html>
<!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
  <meta charset="utf-8">
  <title>CSS Flexbox Test: Testing automatic minimun size of <input> flex items in a row flex container</title>
  <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
  <link rel="author" title="Mozilla" href="https://www.mozilla.org/">
  <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#min-size-auto">
  <link rel="help" href="https://drafts.csswg.org/css-sizing-3/#replaced-percentage-min-contribution">
  <link rel="help" href="https://drafts.csswg.org/css-sizing-3/#min-content-zero">
  <link rel="stylesheet" href="/fonts/ahem.css">
  <meta name="assert" content="This test verifies that an <input> flex item should resolve its percentage part of main size to zero when computing specified size suggestion.">
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="/resources/check-layout-th.js"></script>
  <style>
  .flexbox {
    display: flex;
    width: 300px;
    height: 40px;
    border: 1px solid black;
    margin-bottom: 5px;
  }
  .spacer {
    /* Just to occupy some space, so that the flex algorithm will try to shrink
       the <input> element below its percentage specified width. */
    flex: 0 0 200px;
    background: lightgray;
  }
  input {
    font: 20px/1 Ahem;
    background: lightblue;
    /* Get rid of native theming and UA default styles. */
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
  }
  .test1 {
    width: 100%;
  }
  .test2 {
    width: calc(100%);
  }
  .test3 {
    width: calc(140px + 100%);
  }
  </style>
  <body onload="checkLayout('.flexbox')">
    <p>Test1: "width: 100%"</p>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="text"
             class="test1" data-expected-width="100">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="range"
             class="test1" data-expected-width="100">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="button" value="XXXXXXX"
             class="test1" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="submit" value="XXXXXXX"
             class="test1" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="reset" value="XXXXXXX"
             class="test1" data-expected-width="140">
    </div>
    <p>Test2: "width: calc(100%)"</p>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="text"
             class="test2" data-expected-width="100">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="range"
             class="test2" data-expected-width="100">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="button" value="XXXXXXX"
             class="test2" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="submit" value="XXXXXXX"
             class="test2" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="reset" value="XXXXXXX"
             class="test2" data-expected-width="140">
    </div>
    <p>Test3: "width: calc(140px + 100%)"</p>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="text"
             class="test3" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="range"
             class="test3" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="button" value="XXXXXXX"
             class="test3" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="submit" value="XXXXXXX"
             class="test3" data-expected-width="140">
    </div>
    <div class="flexbox">
      <div class="spacer"></div>
      <input type="reset" value="XXXXXXX"
             class="test3" data-expected-width="140">
    </div>
  </body>
</html>
 |