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

Unified Diff: Source/core/html/HTMLLegendElement.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/HTMLLegendElement.h ('k') | Source/core/html/HTMLOptGroupElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLegendElement.cpp
diff --git a/Source/core/html/HTMLLegendElement.cpp b/Source/core/html/HTMLLegendElement.cpp
index 15e8b1ddd9dedc7242b52d8e1926992ec5848b2d..aad2cccb68cd3a8f48f4984c8758908195debca7 100644
--- a/Source/core/html/HTMLLegendElement.cpp
+++ b/Source/core/html/HTMLLegendElement.cpp
@@ -48,24 +48,24 @@ PassRefPtr<HTMLLegendElement> HTMLLegendElement::create(const QualifiedName& tag
return adoptRef(new HTMLLegendElement(tagName, document));
}
-HTMLFormControlElement* HTMLLegendElement::associatedControl()
+Result<HTMLFormControlElement> HTMLLegendElement::associatedControl()
{
// Check if there's a fieldset belonging to this legend.
Element* fieldset = parentElement();
while (fieldset && !fieldset->hasTagName(fieldsetTag))
fieldset = fieldset->parentElement();
if (!fieldset)
- return 0;
+ return nullptr;
// Find first form element inside the fieldset that is not a legend element.
// FIXME: Should we consider tabindex?
Element* element = fieldset;
while ((element = ElementTraversal::next(element, fieldset))) {
if (element->isFormControlElement())
- return static_cast<HTMLFormControlElement*>(element);
+ return Handle<HTMLFormControlElement>(static_cast<HTMLFormControlElement*>(element));
}
- return 0;
+ return nullptr;
}
void HTMLLegendElement::focus(bool, FocusDirection direction)
@@ -74,13 +74,13 @@ void HTMLLegendElement::focus(bool, FocusDirection direction)
Element::focus(true, direction);
// To match other browsers' behavior, never restore previous selection.
- if (HTMLFormControlElement* control = associatedControl())
+ if (Handle<HTMLFormControlElement> control = associatedControl())
control->focus(false, direction);
}
void HTMLLegendElement::accessKeyAction(bool sendMouseEvents)
{
- if (HTMLFormControlElement* control = associatedControl())
+ if (Handle<HTMLFormControlElement> control = associatedControl())
control->accessKeyAction(sendMouseEvents);
}
« no previous file with comments | « Source/core/html/HTMLLegendElement.h ('k') | Source/core/html/HTMLOptGroupElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698