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

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

Issue 19510005: [oilpan] Completely move HTMLFormControlElement's hierarchy to the managed heap Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 5 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/HTMLFormControlElementWithState.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 5b2b9652f610d42dd7d905ac1994f3756ab47b6f..e13c027b7a030c8b5f5b68be8e3cec708e846145 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -103,13 +103,13 @@ bool HTMLFormControlElement::formNoValidate() const
void HTMLFormControlElement::updateAncestorDisabledState() const
{
- HTMLFieldSetElement* fieldSetAncestor = 0;
+ Handle<HTMLFieldSetElement> fieldSetAncestor;
ContainerNode* legendAncestor = 0;
for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
if (!legendAncestor && ancestor->hasTagName(legendTag))
legendAncestor = ancestor;
if (ancestor->hasTagName(fieldsetTag)) {
- fieldSetAncestor = static_cast<HTMLFieldSetElement*>(ancestor);
+ fieldSetAncestor = Handle<HTMLFieldSetElement>(static_cast<HTMLFieldSetElement*>(ancestor));
break;
}
}
@@ -170,7 +170,7 @@ void HTMLFormControlElement::requiredAttributeChanged()
setNeedsStyleRecalc();
}
-static bool shouldAutofocus(HTMLFormControlElement* element)
+static bool shouldAutofocus(Handle<HTMLFormControlElement> element)
{
if (!element->fastHasAttribute(autofocusAttr))
return false;
@@ -189,7 +189,7 @@ static bool shouldAutofocus(HTMLFormControlElement* element)
// FIXME: Should this set of hasTagName checks be replaced by a
// virtual member function?
if (element->hasTagName(inputTag))
- return !static_cast<HTMLInputElement*>(element)->isInputTypeHidden();
+ return !Handle<HTMLInputElement>::cast(element)->isInputTypeHidden();
if (element->hasTagName(selectTag))
return true;
if (element->hasTagName(keygenTag))
@@ -220,7 +220,7 @@ void HTMLFormControlElement::attach()
if (renderer())
renderer()->updateFromElement();
- if (shouldAutofocus(this)) {
+ if (shouldAutofocus(Handle<HTMLFormControlElement>(this))) {
setAutofocused();
ref();
queuePostAttachCallback(focusPostAttach, this);
@@ -398,7 +398,7 @@ void HTMLFormControlElement::updateVisibleValidationMessage()
if (renderer() && willValidate())
message = validationMessage().stripWhiteSpace();
if (!m_validationMessage)
- m_validationMessage = ValidationMessage::create(this);
+ m_validationMessage = ValidationMessage::create(Handle<HTMLFormControlElement>(this));
m_validationMessage->updateValidationMessage(message);
}
@@ -473,13 +473,13 @@ bool HTMLFormControlElement::isDefaultButtonForForm() const
return isSuccessfulSubmitButton() && form() && form()->defaultButton() == this;
}
-HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node* node)
+Result<HTMLFormControlElement> HTMLFormControlElement::enclosingFormControlElement(Node* node)
{
for (; node; node = node->parentNode()) {
if (node->isElementNode() && toElement(node)->isFormControlElement())
- return static_cast<HTMLFormControlElement*>(node);
+ return Handle<HTMLFormControlElement>(static_cast<HTMLFormControlElement*>(node));
}
- return 0;
+ return nullptr;
}
void HTMLFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
@@ -489,4 +489,9 @@ void HTMLFormControlElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInf
info.addMember(m_validationMessage, "validationMessage");
}
+void HTMLFormControlElement::acceptHeapVisitor(Visitor* visitor) const
+{
+ LabelableElement::acceptHeapVisitor(visitor);
+}
+
} // namespace Webcore
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | Source/core/html/HTMLFormControlElementWithState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698