RenderBlock incorrectly calculates pref width when a replaced object follows a RenderInline with width
https://bugs.webkit.org/show_bug.cgi?id=84624

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-10-01
Reviewed by Levi Weintraub.

Source/WebCore:

For the specific scenario, wherein an inline replaced element (image)
follows an inline flow object within a render block, we should allow
for that block to grow to accomodate the replaced element so as to
avoid it's overflow.

This quirk is handled well by other browsers.

Test: fast/block/block-with-inline-replaced-child.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
We should not cause our line to break for the scenario wherein an inline
replaced element follows an inline flow object.

For handling the same have introduced a flag: isPrevChildInlineFlow which
shall be set for an inline flow element.
Based on this, while handling the inline replaced elements, we either
terminate the line (for minWidth calculation) or not depending upon
this flag.

LayoutTests:

* fast/block/block-with-inline-replaced-child-expected.html: Added.
* fast/block/block-with-inline-replaced-child.html: Added.
* fast/block/resources: Added.
* fast/block/resources/50x50.gif: Added.
Added a ref test for verifying that the containing block grows to accomodate the
replaced element (image) when it follows an inline flow object.
Added a new directory under fast/block for resources.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk/LayoutTests@130057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
4 files changed