Bug 5160 - REGRESSION: text inside inline-block DIV changes the DIV's baseline for vertical-align:baseline
Summary: REGRESSION: text inside inline-block DIV changes the DIV's baseline for verti...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Dave Hyatt
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2005-09-27 22:26 PDT by mitz
Modified: 2006-12-15 11:26 PST (History)
3 users (show)

See Also:


Attachments
testcase (1.87 KB, text/html)
2005-09-27 22:26 PDT, mitz
darin: review-
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-09-27 22:26:19 PDT
Summary: When vertical-align:baseline is used, a DIV with display:inline-block containing text behaves 
like it has a baseline, which is the baseline of one of its contained inline boxes. It should behave like the 
DIV's bottom is its baseline.

To reproduce: open the testcase.

Expected: The red shapes to be identical to the green shape.

Actual: In the second case, the first lines of contained text are aligned with each other and with the 
bottom of the DIVs not containing text. In the third case, the last lines of contained text are aligned with 
each other and with the bottom of the DIVs not containing text.
Comment 1 mitz 2005-09-27 22:26:58 PDT
Created attachment 4075 [details]
testcase
Comment 2 mitz 2005-09-27 23:04:19 PDT
This is a regression from the last released version.
Comment 3 Dave Hyatt 2005-09-28 11:17:30 PDT
See:

http://www.w3.org/TR/CSS21/visudet.html

Scroll to the very bottom of that document:

"A UA should use the baseline of the last line box in the normal flow in the element as the baseline of 
an 'inline-block', or the element's bottom margin edge, if there is none."

I made this change deliberately to be compliant with this part of the spec (despite the spec being 
pathetically ambiguous and not addressing what to do if the inline block has overflow or the line is 
outside its bounds, etc.).
Comment 4 mitz 2005-09-28 11:33:16 PDT
Heh, I spent an hour staring at the part of the spec just above the last 2 paragraphs, wondering if this was 
a deliberate change or a regression, before opening this bug. I'm not sure why you didn't close it (perhaps 
because in the middle case it uses the first line rather than the last?).
Comment 5 Dave Hyatt 2005-09-28 14:07:04 PDT
I didn't close it because it's kind of an issue.  For example, several Dashboard widgets have been broken 
by this change, despite being in strict mode.  We're going to have to figure something out.

Note this change was necessary for the new button controls, which are inline blocks that need to properly 
support baseline alignment.
Comment 6 Eric Seidel (no email) 2005-12-28 01:44:58 PST
Comment on attachment 4075 [details]
testcase

I'm marking this test case for review.	The bug seems to be already fixed. 
This test case might still be useful however.
Comment 7 Joost de Valk (AlthA) 2005-12-28 07:11:24 PST
The bug is definitly not fixed for me...
Comment 8 Darin Adler 2005-12-28 10:38:15 PST
Comment on attachment 4075 [details]
testcase

It's fine to land this test case, but marking it as review+ is going to
misleadingly put this bug into the "needs commit" query.
Comment 9 Maciej Stachowiak 2005-12-30 00:25:31 PST
The test case doesn't look the way it is describes itself in TOT. While landing a test that documents our 
inline block behavior seems good, we should probably have one that describes our current result as the 
correct one, if we think it is correct.
Comment 10 Alice Liu 2006-01-10 10:35:32 PST
<rdar://problem/4404322>
Comment 11 Darin Adler 2006-01-13 08:55:00 PST
Comment on attachment 4075 [details]
testcase

Given Maciej's comments, I'm setting the patch to review-.

We can land a test for this if we revise it to no longer be misleading.
Comment 12 Joost de Valk (AlthA) 2006-01-22 04:35:22 PST
Adding Regression keyword.
Comment 13 Dave Hyatt 2006-12-14 22:45:04 PST
We're keeping this new behavior.
Comment 14 Darin Adler 2006-12-15 11:25:36 PST
Changing resolution from FIXED to more appropriate one.