Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1115)

Unified Diff: Source/core/html/HTMLFormControlElement.cpp

Issue 26622007: Move isAutofilled and setAutofilled from HTMLInputElement to HTMLFormControlElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update messaging in test. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | Source/core/html/HTMLInputElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormControlElement.cpp
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index 6f610bbc04af646268e467a57f8569f576eac4a6..3df66ef189b97382390cd0d43608cf3015a8399c 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -48,6 +48,7 @@ using namespace std;
HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
: LabelableElement(tagName, document)
, m_disabled(false)
+ , m_isAutofilled(false)
, m_isReadOnly(false)
, m_isRequired(false)
, m_valueMatchesRenderer(false)
@@ -121,6 +122,12 @@ void HTMLFormControlElement::ancestorDisabledStateWasChanged()
disabledAttributeChanged();
}
+void HTMLFormControlElement::reset()
+{
+ setAutofilled(false);
+ resetImpl();
+}
+
void HTMLFormControlElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == formAttr) {
@@ -200,6 +207,15 @@ bool HTMLFormControlElement::isAutofocusable() const
return false;
}
+void HTMLFormControlElement::setAutofilled(bool autofilled)
+{
+ if (autofilled == m_isAutofilled)
+ return;
+
+ m_isAutofilled = autofilled;
+ setNeedsStyleRecalc();
+}
+
static bool shouldAutofocusOnAttach(const HTMLFormControlElement* element)
{
if (!element->isAutofocusable())
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | Source/core/html/HTMLInputElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698