Closed
Bug 1023118
Opened 11 years ago
Closed 10 years ago
max-width:100% on image in shrink-wrap situation (inline-block) breaks layout on Bing Blog
Categories
(Core :: Layout: Block and Inline, defect, P4)
Tracking
()
RESOLVED
FIXED
mozilla47
People
(Reporter: sawrubh, Unassigned)
References
()
Details
Attachments
(1 file)
304.78 KB,
image/png
|
Details |
I have visited http://blogs.bing.com/search/2014/02/10/bitcoin-conversion-now-live/ and it's layout is broken in Fennec (the text is cut in half). It works perfectly in Chrome.
Reporter | ||
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
Mike/Kats, can you check if this is an mobile evangelism issue for Microsoft?
Comment 3•11 years ago
|
||
I'm not sure. There's a <main id="main"> which has a computed width of 364px and inside it is an <article id="post-1103"> (which is the top article on the blog URL in comment 0, as of this writing) with a computed width of 780px. Since the article is wider than the body, it is chopped off.
The <article> has a display:inline-block property, and removing that makes the article fit correctly. However I'm not sure what the spec says about display:inline-block so we'd need somebody from layout to comment on whether or not what we're doing is correct.
This is reproducible in desktop FF using the responsive design mode, so bumping over to layout for somebody to investigate.
Component: Readability → Layout: Block and Inline
Product: Firefox for Android → Core
![]() |
||
Comment 4•11 years ago
|
||
Looks like the issue is with shrinkwrapping, right? In particular, doing this:
display:block; width: -moz-fit-content;
makes the <article> too wide just like inline-block does.
And the reason for that is that the <article> contains a <div> which contains a <p> which contains an <img width="760">. So the minimal width when shrink-wrapping is going to be at least 760px.
If Chrome is getting the same markup, I'd expect them to have the same behavior, at least based on their rendering of this testcase:
data:text/html,<!DOCTYPE html><div style="border: 5px solid green; width: 200px"><div style="display: inline-block; border: 5px solid purple"><img src="http://www.mozilla.org/images/mozilla-banner.gif" width="400px"></div></div>
So are they getting the same markup?
Comment 5•11 years ago
|
||
The <img> tag has a max-width:100% property in both Chrome and FF, but in Chrome it appears to resize the image down so that it fits in the available width.
![]() |
||
Comment 6•11 years ago
|
||
A percentage max-width in a shrink-wrap situation means the behavior is undefined per spec, for whatever that's worth...
In any case, sounds like this is a duplicate of bug 441046 or bug 823483?
![]() |
||
Comment 7•11 years ago
|
||
Bug 823483 is the one with useful discussion here, by the way.
Reporter | ||
Comment 8•11 years ago
|
||
http://www.google.com/photos/about/ seems to be broken on Fennec as well, is that also due to this bug or that's a separate bug? This works alright in Chrome btw.
Updated•11 years ago
|
![]() |
||
Comment 9•10 years ago
|
||
Fixed by 823483
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
status-firefox45:
--- → affected
status-firefox46:
--- → fixed
status-firefox47:
--- → fixed
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•