summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp
index 5ba780a..0aefe7f 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp
@@ -71,7 +71,7 @@ using namespace HTMLNames;
const int maxSavedResults = 256;
HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
- : HTMLFormControlElementWithState(tagName, doc, f)
+ : HTMLTextFormControlElement(tagName, doc, f)
, m_xPos(0)
, m_yPos(0)
, m_maxResults(-1)
@@ -257,20 +257,17 @@ bool HTMLInputElement::shouldUseInputMethod() const
return m_type == TEXT || m_type == SEARCH || m_type == ISINDEX;
}
-void HTMLInputElement::dispatchFocusEvent()
+void HTMLInputElement::handleFocusEvent()
{
InputElement::dispatchFocusEvent(this, this);
if (isTextField())
m_autofilled = false;
-
- HTMLFormControlElementWithState::dispatchFocusEvent();
}
-void HTMLInputElement::dispatchBlurEvent()
+void HTMLInputElement::handleBlurEvent()
{
InputElement::dispatchBlurEvent(this, this);
- HTMLFormControlElementWithState::dispatchBlurEvent();
}
void HTMLInputElement::setType(const String& t)
@@ -741,8 +738,7 @@ void HTMLInputElement::parseMappedAttribute(MappedAttribute *attr)
}
setNeedsStyleRecalc();
} else if (attr->name() == placeholderAttr) {
- if (isTextField())
- updatePlaceholderVisibility();
+ updatePlaceholderVisibility(true);
} else if (attr->name() == autosaveAttr ||
attr->name() == incrementalAttr ||
attr->name() == minAttr ||
@@ -814,7 +810,7 @@ RenderObject *HTMLInputElement::createRenderer(RenderArena *arena, RenderStyle *
case TELEPHONE:
case TEXT:
case URL:
- return new (arena) RenderTextControlSingleLine(this);
+ return new (arena) RenderTextControlSingleLine(this, placeholderShouldBeVisible());
}
ASSERT(false);
return 0;
@@ -1111,7 +1107,7 @@ void HTMLInputElement::setValue(const String& value)
else {
m_data.setValue(sanitizeValue(value));
if (isTextField()) {
- InputElement::updatePlaceholderVisibility(this, this);
+ updatePlaceholderVisibility(false);
if (inDocument())
document()->updateStyleIfNeeded();
}
@@ -1151,6 +1147,7 @@ void HTMLInputElement::setValueFromRenderer(const String& value)
{
// File upload controls will always use setFileListFromRenderer.
ASSERT(inputType() != FILE);
+ updatePlaceholderVisibility(false);
InputElement::setValueFromRenderer(m_data, this, this, value);
}
@@ -1790,11 +1787,6 @@ bool HTMLInputElement::willValidate() const
inputType() != BUTTON && inputType() != RESET;
}
-bool HTMLInputElement::placeholderShouldBeVisible() const
-{
- return InputElement::placeholderShouldBeVisible(this, this);
-}
-
bool HTMLInputElement::formStringToDouble(const String& src, double* out)
{
// See HTML5 2.4.4.3 `Real numbers.'