Bug 158441 - Misaligned inline-block due to fractional padding/margin/other vertical spacing
Summary: Misaligned inline-block due to fractional padding/margin/other vertical spacing
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://jsfiddle.net/vu71job4/show
Keywords: BrowserCompat, InRadar
Depends on: 133932
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-06 15:56 PDT by Han
Modified: 2024-02-08 15:26 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Han 2016-06-06 15:56:17 PDT
Tested on WebKit Nightly r201711

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/602.1.36+ (KHTML, like Gecko) Version/9.1.1 Safari/601.6.17

# Example URL:
http://output.jsbin.com/tivuvov

# Steps to reproduce the problem:
1. Open http://output.jsbin.com/tivuvov
2. See misaligned x and 2

# What is the expected behavior?
x and 2 should always line up, because according to the CSS 2.1 spec:

    The baseline of an 'inline-block' is the baseline of its last line box in the normal flow

https://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align

Firefox 46 displays the correct behavior.

# What went wrong?
At certain fractional values of padding or margin, the x and 2 are misaligned, for example .3em.

# Notes

Safari 9.1.1 and Chrome 50 have the same problem, at I think all the same fractional values, but the misalignment is much more severe.
Comment 2 Han 2016-06-06 16:00:09 PDT
Before reporting this bug I did find an existing bug that appears similar, [Subpixel layout: Inline-block is offset from dominant baseline with em based padding](136332), but unlike this bug, 136332 has been fixed in Chrome, whereas this bug is *worse* in Chrome.


[136332]: https://bugs.webkit.org/show_bug.cgi?id=136332
Comment 3 Ahmad Saleem 2023-06-29 16:17:39 PDT
Took reduced test case from Chrome bug: https://jsfiddle.net/vu71job4/show

^ I am able to reproduce using above in WebKit TOT (265630@main). Both Chrome Canary 117 and Firefox Nightly 116 have both 'x' (xx) with proper baseline and no issue in alignment.
Comment 4 Radar WebKit Bug Importer 2024-02-08 15:26:47 PST
<rdar://problem/122587250>