Bug 36084 - baseline of inline-block is not bottom margin edge for overflow other than visible
Summary: baseline of inline-block is not bottom margin edge for overflow other than vi...
Status: RESOLVED DUPLICATE of bug 157293
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL: https://bugs.webkit.org/attachment.cg...
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2010-03-12 21:09 PST by mackyle
Modified: 2016-06-08 11:44 PDT (History)
5 users (show)

See Also:


Attachments
Simple HTML demonstrating bug (233 bytes, text/html)
2010-03-12 21:11 PST, mackyle
no flags Details
Better example. Shows bug and correct and incorrect samples. (2.73 KB, text/html)
2010-03-13 00:07 PST, mackyle
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mackyle 2010-03-12 21:09:38 PST
CSS2.1 Section 10.8.1

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

# The baseline of an 'inline-block' is the baseline of its last line box in
# the normal flow, unless it has either no in-flow line boxes or if its
# 'overflow' property has a computed value other than 'visible', in which
# case the baseline is the bottom margin edge.

1. Nest two inline-block elements with borders in different colors (i.e.
border: 5px solid red and border: 5px solid blue).
2. The outside one should have padding:0
3. The inside one should have margin:0 and overflow:hidden (and use the default vertical-align setting of baseline)
4. Just click on the sample URL for a test case

Actual: The inner border touches the outer border on all four sides.

Expected:  The inner border should touch the outer border everywhere except along the bottom side.  Because the inner inline-block should have had its bottom margin placed on the text baseline of the outer inline-block leaving the space between the text baseline and the bottom border of the outer block empty producing a gap between the inner border and the outer border along the bottom side only.

Firefox and Opera render this correctly with the gap -- view it with one of these browsers to see the gap.

The problem seems to be that WebKit does not implement the quoted part of the specification above which says, "if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge."
Comment 1 mackyle 2010-03-12 21:11:28 PST
Created attachment 50652 [details]
Simple HTML demonstrating bug

View in Firefox to see the correct rendering.
Comment 2 mackyle 2010-03-13 00:07:34 PST
Created attachment 50653 [details]
Better example.  Shows bug and correct and incorrect samples.

This example shows the test displayed by the current browser along with browser independent examples of correct and incorrect rendering.
A 'passed' or 'failed' indication should also be shown indicating whether or not the test was correctly rendered.
Comment 3 Dave Hyatt 2010-11-02 15:41:30 PDT
Not sure what to do with this bug, since it will be a compatibility issue if we try to fix it.  inline-block is used heavily on OS X with text-overflow/overflow-hidden text, and losing the ability to baseline-align those blocks seems like a flaw in the spec to me.
Comment 4 Christian Biesinger 2013-08-01 09:42:40 PDT
https://codereview.chromium.org/21414002/
Comment 5 Myles C. Maxfield 2016-06-08 11:44:12 PDT
I wrote an exhaustive description of what is going on here in https://bugs.webkit.org/show_bug.cgi?id=157293#c4

*** This bug has been marked as a duplicate of bug 157293 ***