title: Image inside flex-item ignores max-height:100% in chrome and firefox - (works in safari)
body: <p>I want an image to fill either the width or height of the window-size/viewport.</p>
  
  <p><strong>For a better understanding</strong> of what i’m trying to do, <a href="http://codepen.io/durchgemacht/pen/WvQvZJ" rel="noreferrer"><strong>i’ve created an example on codepen</strong></a> - please check out and resize the preview. <strong>It works fine in safari</strong> but chrome and firefox seems to have problems. The image ignores the max-height property and overflows the flex-item dimensions.</p>
  
  <p>Any suggestions to get this work in chrome and firefox?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html,
  body {
    height: 100%;
  }
  .flex-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: green;
  }
  .flex-item {
    max-width: 100%;
    max-height: 100%;
  }
  img {
    max-width: 100%;
    max-height: 100%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="flex-container"&gt;
    &lt;div class="flex-item"&gt;
      &lt;img src="http://i.stack.imgur.com/mrEyQ.jpg"&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>