summaryrefslogtreecommitdiff
path: root/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp
index a49e092b1b..af422538ac 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp
@@ -47,7 +47,7 @@ void RenderTextControlMultiLine::subtreeHasChanged()
RenderTextControl::subtreeHasChanged();
HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(node());
textArea->setFormControlValueMatchesRenderer(false);
- textArea->updateValidity();
+ textArea->setNeedsValidityCheck();
if (!node()->focused())
return;
@@ -64,8 +64,8 @@ bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitT
return false;
bool resultIsTextValueOrPlaceholder
- = !m_placeholderVisible && result.innerNode() == innerTextElement()
- || m_placeholderVisible && result.innerNode()->isDescendantOf(innerTextElement());
+ = (!m_placeholderVisible && result.innerNode() == innerTextElement())
+ || (m_placeholderVisible && result.innerNode()->isDescendantOf(innerTextElement()));
if (result.innerNode() == node() || resultIsTextValueOrPlaceholder)
hitInnerTextElement(result, x, y, tx, ty);
@@ -77,6 +77,17 @@ void RenderTextControlMultiLine::forwardEvent(Event* event)
RenderTextControl::forwardEvent(event);
}
+float RenderTextControlMultiLine::getAvgCharWidth(AtomicString family)
+{
+ // Since Lucida Grande is the default font, we want this to match the width
+ // of Courier New, the default font for textareas in IE, Firefox and Safari Win.
+ // 1229 is the avgCharWidth value in the OS/2 table for Courier New.
+ if (family == AtomicString("Lucida Grande"))
+ return scaleEmToUnits(1229);
+
+ return RenderTextControl::getAvgCharWidth(family);
+}
+
int RenderTextControlMultiLine::preferredContentWidth(float charWidth) const
{
int factor = static_cast<HTMLTextAreaElement*>(node())->cols();