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

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

Issue 99333011: Make sure getAttribute() / setAttribute() callers use AtomicStrings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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/HTMLInputElement.h ('k') | Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index d9f2bf002f57c90967fbd0ed2b4b64f3d16375bf..723a5e6292c8f63c82d1b651ebf7001d1b3dca7b 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -387,7 +387,7 @@ void HTMLInputElement::handleBlurEvent()
m_inputTypeView->handleBlurEvent();
}
-void HTMLInputElement::setType(const String& type)
+void HTMLInputElement::setType(const AtomicString& type)
{
// FIXME: This should just call setAttribute. No reason to handle the empty string specially.
// We should write a test case to show that setting to the empty string does not remove the
@@ -444,7 +444,7 @@ void HTMLInputElement::updateType()
bool willStoreValue = m_inputType->storesValueSeparateFromAttribute();
if (didStoreValue && !willStoreValue && hasDirtyValue()) {
- setAttribute(valueAttr, m_valueIfDirty);
+ setAttribute(valueAttr, AtomicString(m_valueIfDirty));
m_valueIfDirty = String();
}
if (!didStoreValue && willStoreValue) {
@@ -1205,12 +1205,12 @@ bool HTMLInputElement::isURLAttribute(const Attribute& attribute) const
return attribute.name() == srcAttr || attribute.name() == formactionAttr || HTMLTextFormControlElement::isURLAttribute(attribute);
}
-String HTMLInputElement::defaultValue() const
+const AtomicString& HTMLInputElement::defaultValue() const
{
return fastGetAttribute(valueAttr);
}
-void HTMLInputElement::setDefaultValue(const String &value)
+void HTMLInputElement::setDefaultValue(const AtomicString& value)
{
setAttribute(valueAttr, value);
}
@@ -1269,12 +1269,12 @@ Vector<String> HTMLInputElement::acceptFileExtensions()
return parseAcceptAttribute(fastGetAttribute(acceptAttr), isValidFileExtension);
}
-String HTMLInputElement::accept() const
+const AtomicString& HTMLInputElement::accept() const
{
return fastGetAttribute(acceptAttr);
}
-String HTMLInputElement::alt() const
+const AtomicString& HTMLInputElement::alt() const
{
return fastGetAttribute(altAttr);
}
« no previous file with comments | « Source/core/html/HTMLInputElement.h ('k') | Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698