WebCore/ChangeLog

 12006-02-21 Adele Peterson <adele@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Tests:
 6 * fast/forms/input-baseline.html
 7 * fast/inline-block/contenteditable-baseline.html
 8
 9 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7330
 10 baselinePosition is wrong for new text field when empty
 11
 12 * rendering/RenderBlock.cpp: (WebCore::RenderBlock::getBaselineOfLastLineBox):
 13 If we're dealing with an empty contenteditable block, then we've added height to the block to make room for the caret,
 14 and there are no children to give us the baseline. Instead, compute the baseline for the block itself, and factor in the border.
 15
1162006-02-21 Vicki Murley <vicki@apple.com>
217
318 Reviewed by Adele.
12928

WebCore/rendering/RenderBlock.cpp

32313231 return RenderFlow::getBaselineOfLastLineBox();
32323232
32333233 if (childrenInline()) {
3234  if (m_lastLineBox)
 3234 if (!firstLineBox() && element() && element()->isContentEditable() && element()->rootEditableElement() == element())
 3235 return RenderObject::baselinePosition(true) + borderTop();
 3236 else if (m_lastLineBox)
32353237 return m_lastLineBox->yPos() + m_lastLineBox->baseline();
32363238 else
32373239 return -1;
12903

LayoutTests/ChangeLog

 12006-02-21 Adele Peterson <adele@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 - Tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=7330
 6 baselinePosition is wrong for new text field when empty
 7
 8 * fast/forms/input-baseline-expected.checksum: Added.
 9 * fast/forms/input-baseline-expected.png: Added.
 10 * fast/forms/input-baseline-expected.txt: Added.
 11 * fast/forms/input-baseline.html: Added.
 12 * fast/inline-block/contenteditable-baseline-expected.checksum: Added.
 13 * fast/inline-block/contenteditable-baseline-expected.png: Added.
 14 * fast/inline-block/contenteditable-baseline-expected.txt: Added.
 15 * fast/inline-block/contenteditable-baseline.html: Added.
 16
1172006-02-21 Alexey Proskuryakov <ap@nypop.com>
218
319 Reviewed by Darin.
12928

LayoutTests/fast/forms/input-baseline-expected.png

INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests.

LayoutTests/fast/forms/input-baseline-expected.checksum

 16906762f47124a634bbc19a028663f57
02\ No newline at end of file
0

LayoutTests/fast/forms/input-baseline-expected.txt

 1layer at (0,0) size 800x600
 2 RenderCanvas at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6 RenderText {TEXT} at (0,0) size 293x18
 7 text run at (0,0) width 293: "This tests that text fields get the right baseline. "
 8 RenderBR {BR} at (0,0) size 0x0
 9 RenderBR {BR} at (0,18) size 0x18
 10 RenderTextField {INPUT} at (2,38) size 186x19
 11 RenderText {TEXT} at (190,38) size 424x18
 12 text run at (190,38) width 424: "This text should line up with the bottom of the text in the text field. "
 13 RenderBR {BR} at (0,0) size 0x0
 14 RenderBR {BR} at (0,59) size 0x18
 15 RenderTextField {INPUT} at (2,79) size 186x132
 16 RenderText {TEXT} at (190,171) size 420x18
 17 text run at (190,171) width 420: "This text should line up with the bottom of the text in the text field."
 18layer at (13,49) size 180x13
 19 RenderBlock {DIV} at (3,3) size 180x13
 20layer at (13,90) size 180x126
 21 RenderBlock {DIV} at (3,3) size 180x126
0

LayoutTests/fast/forms/input-baseline.html

 1<style>
 2input#ip:first-line { font-size: 80pt }
 3</style>
 4This tests that text fields get the right baseline.
 5<br><br>
 6<input style="-khtml-appearance:textfield; vertical-align: baseline"></input>This text should line up with the bottom of the text in the text field.
 7<br><br>
 8<input id="ip" style="-khtml-appearance:textfield; vertical-align: baseline"></input>This text should line up with the bottom of the text in the text field.
0

LayoutTests/fast/inline-block/contenteditable-baseline.html

 1<style>
 2DIV#tc:first-line { font-size: 80pt }
 3input:first-line { font-size: 80pt }
 4</style>
 5This tests that contenteditable elements, with no children, get the right baseline.
 6<br><br>
 7<div style="display:inline-block; border: solid thin red;"><div contenteditable style="border: solid thin green; width:150px; vertical-align: baseline"></div></div>This text should line up with the bottom of the text in the editable div.
 8<br><br>
 9<div style="display:inline-block; border: solid 10px red;">text<div contenteditable style="border: solid 20px green; width:150px; vertical-align: baseline"></div></div>This text should line up with the bottom of the text in the editable div.
 10<br><br>
 11<div style="display:inline-block; border: solid 5px red;"><div contenteditable id="tc" style="border: solid 10px green; width:150px; vertical-align: baseline"></div></div>This text should line up with the bottom of the text in the editable div.
0

LayoutTests/fast/inline-block/contenteditable-baseline-expected.png

INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests.

LayoutTests/fast/inline-block/contenteditable-baseline-expected.checksum

 13b578708be6df76af5726f7f52a2573c
02\ No newline at end of file
0

LayoutTests/fast/inline-block/contenteditable-baseline-expected.txt

 1layer at (0,0) size 800x600
 2 RenderCanvas at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6 RenderText {TEXT} at (0,0) size 501x18
 7 text run at (0,0) width 501: "This tests that contenteditable elements, with no children, get the right baseline. "
 8 RenderBR {BR} at (0,0) size 0x0
 9 RenderBR {BR} at (0,18) size 0x18
 10 RenderBlock {DIV} at (0,36) size 154x22 [border: (1px solid #FF0000)]
 11 RenderBlock {DIV} at (1,1) size 152x20 [border: (1px solid #008000)]
 12 RenderText {TEXT} at (154,38) size 442x18
 13 text run at (154,38) width 442: "This text should line up with the bottom of the text in the editable div. "
 14 RenderBR {BR} at (0,0) size 0x0
 15 RenderBR {BR} at (0,58) size 0x18
 16 RenderBlock {DIV} at (0,76) size 210x96 [border: (10px solid #FF0000)]
 17 RenderBlock (anonymous) at (10,10) size 190x18
 18 RenderText {TEXT} at (0,0) size 23x18
 19 text run at (0,0) width 23: "text"
 20 RenderBlock {DIV} at (10,28) size 190x58 [border: (20px solid #008000)]
 21 RenderText {TEXT} at (210,124) size 442x18
 22 text run at (210,124) width 442: "This text should line up with the bottom of the text in the editable div. "
 23 RenderBR {BR} at (0,0) size 0x0
 24 RenderBR {BR} at (0,172) size 0x18
 25 RenderBlock {DIV} at (0,190) size 180x153 [border: (5px solid #FF0000)]
 26 RenderBlock {DIV} at (5,5) size 170x143 [border: (10px solid #008000)]
 27 RenderText {TEXT} at (180,287) size 438x18
 28 text run at (180,287) width 438: "This text should line up with the bottom of the text in the editable div."
0