Closed
Bug 1449810
Opened 8 years ago
Closed 8 years ago
img element without src has 0 width box
Categories
(Core :: Layout: Images, Video, and HTML Frames, enhancement, P3)
Tracking
()
RESOLVED
DUPLICATE
of bug 851048
| Tracking | Status | |
|---|---|---|
| firefox61 | --- | affected |
People
(Reporter: karlcow, Unassigned)
References
(
URL
)
Details
(Whiteboard: [webcompat] [css])
This is a spin-off of https://webcompat.com/issues/16223
(there might be an already opened bug about this)
Using this CSS
.img-cover {
background-size: cover;
height: 100vw;
width: 100vw;
background-position: 50% 50%;
background-repeat: no-repeat;
transform-origin: 0 0;
}
WORKING (with src="")
=================================
<div style="min-width: 100vw;
min-height: 100vw;">
<img class="square-min img-cover"
style="background-image: url("https://cdn.filipinocupid.com/memphoto/photo1/big/11726201.jpg")"
src="">
</div>
=================================
NOT WORKING (without src)
=================================
<div style="min-width: 100vw;
min-height: 100vw;">
<img class="square-min img-cover"
style="background-image: url("https://cdn.filipinocupid.com/memphoto/photo1/big/11726201.jpg")">
</div>
=================================
The code without src is working in Chrome and the image displays correctly
Flags: webcompat?
Comment 1•8 years ago
|
||
Seems related to bug 851048... haven't looked closely enough to be sure if it's a dupe or not, though.
Comment 2•8 years ago
|
||
Yeah, this is bug 851048.
The reason |src=""| seems to save us here is: it makes us render the "broken image" icon, i.e. it makes it render as a replaced element (which honors height/width) rather than like a <span> (which does not).
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Comment 3•8 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #2)
> The reason |src=""| seems to save us here is: it makes us render the "broken
> image" icon, i.e. it makes it render as a replaced element (which honors
> height/width) rather than like a <span> (which does not).
s/which does not/which does not (in Firefox in particular)/ -- this interop issue is what bug 851048 covers.
Updated•7 years ago
|
Product: Core → Core Graveyard
Updated•7 years ago
|
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•