User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36
Steps to reproduce:
Image with 'max-width:100%' within an inline-block.
Compare to Google Chrome.
Image does not respect max-width of ancestral context. It breaks out of the containing block element (gray box in test case).
It should not exceed 100% of the width of the ancestral context. It should be bound by the containing block element (gray box in test case).
Confirmed with 2013-11-06-03-02-00-mozilla-central-firefox-28.0a1.en-US.linux-x86_64: 100% translates to the image's real width 300px.
So the inline block has auto width, which means it shrink-wraps its kids. But the width of the kids depends on the width of the inline-block because of the max-width style (which is a percentage of the width of the inline block, not of the gray 200px wide block, in this testcase). The only way in which the 200px width enters the picture is that it's the available width for the shrink-to-fit algorithm.
So the real question here is what the "preferred minimum width" is in this case. That's basically what the discussion in bug 823483 is about.
Note that the CSS specification does not actually define the rendering here, unfortunately, which is why different browsers handle it differently...
Created attachment 828326 [details]
*** Bug 1138406 has been marked as a duplicate of this bug. ***
Created attachment 8582024 [details]
For me (Win7, FF 36) wrapping the image within an element styled like this
fixes the issue.
See also bug 504622, bug 823483.
fixed by bug 823483.