Open Bug 1270883 Opened 8 years ago Updated 2 years ago

container size incorrectly set to width of image file instead of displayed width when using srcset and display:table

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

46 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: moz14, Unassigned)

Details

(Keywords: testcase, Whiteboard: btpp-followup-2016-05-13)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160502172042

Steps to reproduce:

Two <div>'s each contain an <img> with srcset= and sizes=.  One <div> has display:table the other does not.


<!DOCTYPE HTML>
<html>
<head>
<title>img srcset Container Size Error Demo</title>
</head>
<body onload="alert(document.getElementById('container1').clientWidth + ' ' +
                document.getElementById('container2').clientWidth )">
<div id="container1">
<img srcset="srcset.jpg 100w" sizes="100vw">
</div>
<div id="container2" style="display:table">
<img srcset="srcset.jpg 100w" sizes="100vw">
</div>
</body>
</html>




Actual results:

The width of the <div> with display:table is set to the width of the actual image file regardless of the size at which the image is displayed (the image is resized to fit the window)


Expected results:

The width of both <div>s should be the width at which the image is displayed.
Component: Untriaged → DOM: CSS Object Model
Keywords: testcase
Product: Firefox → Core
Josh, wdyt?
Flags: needinfo?(josh)
Whiteboard: btpp-followup-2016-05-13
This sounds like a similar problem to bug 1149357.
Component: DOM: CSS Object Model → Layout: Images
Flags: needinfo?(josh)
Product: Core → Core Graveyard
Product: Core Graveyard → Core
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: