Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
* fast/forms/input-readonly-empty-expected.checksum: Added.
* fast/forms/input-readonly-empty-expected.png: Added.
* fast/forms/input-readonly-empty-expected.txt: Added.
* fast/forms/input-readonly-empty.html: Added.
WebCore:
Reviewed by Hyatt.
Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
Test: fast/forms/input-readonly-empty.html
* rendering/RenderBlock.h: Added hasLineIfEmpty.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::hasLineIfEmpty): Added. Checks for rootEditableElement as well as
a shadowNode who has an input element as a parent.
(WebCore::RenderBlock::getBaselineOfLastLineBox): Calls hasLineIfEmpty instead of just checking for the rootEditableElement.
* rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13988
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-04-20 Adele Peterson <adele@apple.com>
+
+ Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
+ REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
+
+ * fast/forms/input-readonly-empty-expected.checksum: Added.
+ * fast/forms/input-readonly-empty-expected.png: Added.
+ * fast/forms/input-readonly-empty-expected.txt: Added.
+ * fast/forms/input-readonly-empty.html: Added.
+
2006-04-19 Adele Peterson <adele@apple.com>
Updated test to use webkit-block-placeholder instead of khtml-block-placeholder.
--- /dev/null
+7f5f321dfc0b30800fd357f2fd274302
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderText {#text} at (0,2) size 476x18
+ text run at (0,2) width 476: "This tests that empty readonly text fields have the right height and baseline. "
+ RenderTextField {INPUT} at (478,2) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+ RenderText {#text} at (0,0) size 0x0
+layer at (489,13) size 142x13
+ RenderBlock {DIV} at (3,3) size 142x13
--- /dev/null
+<html>
+This tests that empty readonly text fields have the right height and baseline. <input readonly>
+</html>
\ No newline at end of file
+2006-04-20 Adele Peterson <adele@apple.com>
+
+ Reviewed by Hyatt.
+
+ Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
+ REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
+
+ Test: fast/forms/input-readonly-empty.html
+
+ * rendering/RenderBlock.h: Added hasLineIfEmpty.
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::hasLineIfEmpty): Added. Checks for rootEditableElement as well as
+ a shadowNode who has an input element as a parent.
+ (WebCore::RenderBlock::getBaselineOfLastLineBox): Calls hasLineIfEmpty instead of just checking for the rootEditableElement.
+ * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): ditto.
+
2006-04-20 Darin Adler <darin@apple.com>
Reviewed by Timothy.
m_maxWidth = max(floatLeftWidth + floatRightWidth, m_maxWidth);
}
+bool RenderBlock::hasLineIfEmpty() const
+{
+ return element() && (element()->isContentEditable() && element()->rootEditableElement() == element() ||
+ element()->isShadowNode() && element()->shadowParentNode()->hasTagName(inputTag));
+}
+
short RenderBlock::lineHeight(bool b, bool isRootLineBox) const
{
// Inline blocks are replaced elements. Otherwise, just pass off to
return RenderFlow::getBaselineOfLastLineBox();
if (childrenInline()) {
- if (!firstLineBox() && element() && element()->isContentEditable() && element()->rootEditableElement() == element())
+ if (!firstLineBox() && hasLineIfEmpty())
return RenderFlow::baselinePosition(true) + borderTop() + paddingTop();
if (m_lastLineBox)
return m_lastLineBox->yPos() + m_lastLineBox->baseline();
Position positionForBox(InlineBox *box, bool start=true) const;
Position positionForRenderer(RenderObject *renderer, bool start=true) const;
+ bool hasLineIfEmpty() const;
+
protected:
struct FloatingObject {
enum Type {
repaintRect.intersect(IntRect(0, 0, m_width, m_height));
}
- if (!firstLineBox() && element() && element()->isContentEditable() && element()->rootEditableElement() == element())
+ if (!firstLineBox() && hasLineIfEmpty())
m_height += lineHeight(true);
// See if we have any lines that spill out of our block. If we do, then we will possibly need to