Bug 7330 - baselinePosition is wrong for new text field when empty
Summary: baselinePosition is wrong for new text field when empty
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Adele Peterson
URL:
Keywords:
Depends on:
Blocks: 6986
  Show dependency treegraph
 
Reported: 2006-02-17 17:17 PST by Adele Peterson
Modified: 2006-02-21 15:46 PST (History)
2 users (show)

See Also:


Attachments
test case (136 bytes, text/html)
2006-02-17 17:18 PST, Adele Peterson
no flags Details
test case for inline-block div (148 bytes, text/html)
2006-02-20 19:02 PST, Adele Peterson
no flags Details
test case with thick borders (152 bytes, text/html)
2006-02-21 11:32 PST, Adele Peterson
no flags Details
test case for first-line style (199 bytes, text/html)
2006-02-21 13:31 PST, Adele Peterson
no flags Details
patch (712 bytes, patch)
2006-02-21 14:24 PST, Adele Peterson
no flags Details | Formatted Diff | Diff
new patch w/ changelog & tests (9.41 KB, patch)
2006-02-21 15:12 PST, Adele Peterson
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adele Peterson 2006-02-17 17:17:26 PST
baselinePosition is wrong for new text field when empty
Comment 1 Adele Peterson 2006-02-17 17:18:39 PST
Created attachment 6582 [details]
test case
Comment 2 Adele Peterson 2006-02-20 19:02:38 PST
Created attachment 6633 [details]
test case for inline-block div
Comment 3 Adele Peterson 2006-02-20 19:27:58 PST
the problem appears to be that the inner div is looking for the baseline of the lastLineBox in getBaselineOfLastLineBox, but there isn't a lastLineBox.
Comment 4 Adele Peterson 2006-02-20 19:58:12 PST
In RenderBlock::layoutInlineChildren, we increase the height to make room for the caret.  At the same time, maybe we should set a flag for this weird case?  Or can we actually give it a real last line box?
Comment 5 Dave Hyatt 2006-02-21 01:52:44 PST
We only expand editable divs with no children at all, so you can just use the same check that was originally used to decide to expand in the first place.
Comment 6 Adele Peterson 2006-02-21 11:32:14 PST
Created attachment 6646 [details]
test case with thick borders
Comment 7 Adele Peterson 2006-02-21 13:31:39 PST
Created attachment 6649 [details]
test case for first-line style
Comment 8 Adele Peterson 2006-02-21 14:24:00 PST
Created attachment 6651 [details]
patch

This patch matches the empty behavior to the non-empty behavior....but when I looked at WinIE, it looks like the baseline is at the bottom.

Beth mentioned that she thought we might have done our baselines differently on purpose... Hyatt, can you comment?
Comment 9 Dave Hyatt 2006-02-21 14:44:44 PST
Yeah, WinIE doesn't baselne-align form controls.  Safari and Firefox do because it looks nicer.
Comment 10 Adele Peterson 2006-02-21 15:12:52 PST
Created attachment 6652 [details]
new patch w/ changelog & tests
Comment 11 Dave Hyatt 2006-02-21 15:16:15 PST
Comment on attachment 6652 [details]
new patch w/ changelog & tests

(1) Can remove the elses in the chain of ifs, since they're all just returning anyway.

(2) Need to add in paddingTop() as well as borderTop().

(3) Add a testcase that tests padding-top.

r=me