See attached test case and picture.
Created attachment 10304 [details] reduction
Created attachment 10305 [details] picture
The reduction fails to repaint in shipping WebKit (418.8) as well.
Created attachment 10336 [details] Slightly simplified reduction Got rid of the form, button and iframe and a few unnecessary css properties. This is actually first and foremost an incomplete relayout bug: after you click the button, you get incomplete repainting. You can force repaint and see that the black rectangle has become narrower. But if you force relayout at that point (e.g. by resizing the window), you'll see that it grows back to its original width. I believe that the repainting issue is an artifact of the layout problem.
The problem here is a replaced object with percent width. To compute the width, you need to know the object's y coordinate (then you compute the available width at that y coordindate), but currently layoutInlineChildren tells replaced inline children to layout (and decide their width) before they know their final y position, using their last y position (or 0 if it's the first time). Perhaps you can defer layout of replaced children until findNextLineBreak reaches them, and then at least you can guess the replaced object's y position consistently (you may need to guess and layout again if it doesn't fit and ends up moving down to clear floats or wrapping to the next line).
Created attachment 12125 [details] Another test case for the layout issue Opera and Firefox (when replacing the inline-block div with an img) compute the percentage out of the width of the blue div, ignoring the float.
Created attachment 12126 [details] Test for strict mode The problem is only in present in quirks mode (although I don't understand the behavior in the 4th case in this file). Here is a comment from RenderObject::usesLineWidth() explaining the quirk: // 1. All auto-width objects that avoid floats should always use lineWidth // 2. For objects with a specified width, we match WinIE's behavior: // (a) tables use contentWidth // (b) <hr>s use lineWidth // (c) all other objects use lineWidth in quirks mode and contentWidth in strict mode.
Quirk removed by Hyatt in <http://trac.webkit.org/projects/webkit/changeset/19717>.