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); |
} |