Problem
I want the height of the <img> to be 100% of it's parent's height while proportionally scaling the width of the <img>. This is easy to do when the <img> has position absolute and works as expected.
*, *:before, *:after { box-sizing: border-box;}
body { margin: 0; }
.hero {
border: 2px solid red;
position: relative;
min-height: 360px;
}
.content {
/* Simulate content height */
/* height: 500px; */
}
.background {
border: 2px solid #2EA800;
}
img {
border: 2px solid #0083FF;
position: absolute;
top: 0;
right: 0;
height: 100%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Example 1</title>
</head>
<body>
<div class="hero">
<div class="content">
Hey there
</div>
<div class="background">
<img src="https://via.placeholder.com/200x150" alt="">
</div>
</div>
</body>
</html>

But, when it is inside a parent (image container) <div> with position absolute, the parent's width is incorrectly calculated.
*, *:before, *:after { box-sizing: border-box;}
body { margin: 0; }
.hero {
border: 2px solid red;
position: relative;
min-height: 360px;
}
.content {
/* Simulate content height */
/* height: 500px; */
}
.background {
border: 2px solid #2EA800;
}
.background {
position: absolute;
top: 0;
right: 0;
height: 100%;
}
img {
border: 1px solid red;
height: 100%;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Example 2</title>
</head>
<body>
<div class="hero">
<div class="content">
Hey there
</div>
<div class="background">
<img src="https://via.placeholder.com/200x150" alt="">
</div>
</div>
</body>
</html>

How it should work
This only happens in FireFox. In Chrome, as expected the image container's width is correctly calculated.

Code example in JS Fiddle (to easily open in other browsers)
- Example 1: https://jsbin.com/hababos/edit?html,css,output
- Example 2: https://jsbin.com/jotefel/edit?html,css,output