Bug 32862

Summary: Background image positioning on RTL text
Product: WebKit Reporter: David Vella <david.vella>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: abarth, commit-queue, eric, mitz, webkit.review.bot, xji, yael
Priority: P3 Keywords: HasReduction
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://extdev.bbc.co.uk/worldservice/testcases/webkit_background_image.shtml
Attachments:
Description Flags
WebArchive of http://extdev.bbc.co.uk/.../webkit_background_image.shtml
none
Patch.
darin: review+
Patch. none

Description David Vella 2009-12-22 02:04:40 PST
Hi there,

We're run into a minor display problem in Webkit where positioning a background image to multiline Right-to-Left text, will position the image to the last line of the text, instead of the top right (as stated by the CSS).

The issue seems to appear only when the style is applied to <a> tags, it works normally on <p> (or other) tags.

The bug has been reproduced on a reducted page:
http://extdev.bbc.co.uk/worldservice/testcases/webkit_background_image.shtml
Comment 1 Daniel Bates 2010-03-27 15:54:38 PDT
Created attachment 51844 [details]
WebArchive of http://extdev.bbc.co.uk/.../webkit_background_image.shtml

For the purpose of preservation, a WebArchive of the reduction <http://extdev.bbc.co.uk/worldservice/testcases/webkit_background_image.shtml>
Comment 2 mitz 2010-10-08 16:02:48 PDT
See also bug 9272.
Comment 3 Yael 2011-02-11 14:53:39 PST
Created attachment 82184 [details]
Patch.

When the style of InlineFlowBox is right-to-left, the strips should be re-arranged in reverse oreder.
Please note that the code change is very small and the patch is big due to the tests :)
Comment 4 Yael 2011-02-11 14:55:39 PST
Sorry, one test is missing, I'll update the patch soon.
Comment 5 Darin Adler 2011-02-11 14:57:21 PST
Comment on attachment 82184 [details]
Patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=82184&action=review

> Source/WebCore/rendering/InlineFlowBox.cpp:1012
> +        int totalLogicalWidth = 0;

No reason to initialize this to zero. It’s set in all code paths below.
Comment 6 Yael 2011-02-11 15:32:50 PST
Created attachment 82196 [details]
Patch.

Removed un-needed initializer and added the missing test.
Comment 7 WebKit Commit Bot 2011-02-11 17:34:47 PST
Comment on attachment 82196 [details]
Patch.

Clearing flags on attachment: 82196

Committed r78396: <http://trac.webkit.org/changeset/78396>
Comment 8 WebKit Commit Bot 2011-02-11 17:34:54 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 WebKit Review Bot 2011-02-13 02:19:45 PST
http://trac.webkit.org/changeset/78396 might have broken SnowLeopard Intel Release (WebKit2 Tests)
The following tests are not passing:
fast/loader/empty-embed-src-attribute.html