Bug 105695 - Abspos Inline block not positioned correctly in text-aligned container
Summary: Abspos Inline block not positioned correctly in text-aligned container
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robert Hogan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-23 11:40 PST by Robert Hogan
Modified: 2013-01-23 12:16 PST (History)
7 users (show)

See Also:


Attachments
Reduction (462 bytes, text/html)
2012-12-23 11:40 PST, Robert Hogan
no flags Details
Patch (6.94 KB, patch)
2012-12-23 14:48 PST, Robert Hogan
no flags Details | Formatted Diff | Diff
Patch (6.90 KB, patch)
2013-01-23 11:32 PST, Robert Hogan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Hogan 2012-12-23 11:40:48 PST
Created attachment 180626 [details]
Reduction

This happens when there's no text in the line to force line layout, so the block only gets positioned by block layout.
Comment 1 Robert Hogan 2012-12-23 14:48:59 PST
Created attachment 180630 [details]
Patch
Comment 2 Ojan Vafai 2013-01-03 15:26:25 PST
Comment on attachment 180630 [details]
Patch

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

I'm a little torn about this because our current behavior matches Opera and IE8/9. Your patch makes us match Firefox. Also, if you remove the p element, then all the browsers agree that the text-align should apply. So, I'm inclined to say that this patch is an improvement, but we'll need to watch to keep an eye out for regressions.

> Source/WebCore/ChangeLog:3
> +        Abspos Inline block not positioned correctly in text-aligned container

nit: s/Inline/inline

> LayoutTests/fast/text/container-align-with-inlines.html:1
> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Can you clean up this test case some?

-Use <!DOCTYPE html>
-use offsetWidth on the container instead of getComputedStyle.
-get rid of id="body"
-don't need to set the font
-make the background a different color than the text, even better, make the p and the reference div have different background colors so it's more clear what's going on

If I were writing this test, I'd also remove the html and head elements, but that's not a universally agreed upon style, so up to you.
Comment 3 Robert Hogan 2013-01-23 11:32:12 PST
Created attachment 184270 [details]
Patch
Comment 4 WebKit Review Bot 2013-01-23 12:16:41 PST
Comment on attachment 184270 [details]
Patch

Clearing flags on attachment: 184270

Committed r140570: <http://trac.webkit.org/changeset/140570>
Comment 5 WebKit Review Bot 2013-01-23 12:16:44 PST
All reviewed patches have been landed.  Closing bug.