Index: Source/modules/accessibility/AXMenuListOption.cpp |
diff --git a/Source/modules/accessibility/AXMenuListOption.cpp b/Source/modules/accessibility/AXMenuListOption.cpp |
index d6ee7be4c0485cc6b70362f98e81d5e3feb2e036..ac9822fe77c9b91447e8b4239ddb6ee1cfd59b57 100644 |
--- a/Source/modules/accessibility/AXMenuListOption.cpp |
+++ b/Source/modules/accessibility/AXMenuListOption.cpp |
@@ -26,7 +26,6 @@ |
#include "config.h" |
#include "modules/accessibility/AXMenuListOption.h" |
-#include "core/html/HTMLOptionElement.h" |
#include "modules/accessibility/AXMenuListPopup.h" |
#include "modules/accessibility/AXObjectCacheImpl.h" |
@@ -34,27 +33,28 @@ namespace blink { |
using namespace HTMLNames; |
-AXMenuListOption::AXMenuListOption(AXObjectCacheImpl* axObjectCache) |
+AXMenuListOption::AXMenuListOption(HTMLOptionElement* element, AXObjectCacheImpl* axObjectCache) |
: AXMockObject(axObjectCache) |
+ , m_element(element) |
{ |
} |
-void AXMenuListOption::setElement(HTMLElement* element) |
+void AXMenuListOption::detach() |
{ |
- ASSERT_ARG(element, isHTMLOptionElement(element)); |
- m_element = element; |
+ m_element = nullptr; |
+ AXMockObject::detach(); |
} |
Element* AXMenuListOption::actionElement() const |
{ |
- return m_element.get(); |
+ return m_element; |
} |
bool AXMenuListOption::isEnabled() const |
{ |
// isDisabledFormControl() returns true if the parent <select> element is disabled, |
// which we don't want. |
- return !toHTMLOptionElement(m_element)->ownElementDisabled(); |
+ return !m_element->ownElementDisabled(); |
} |
bool AXMenuListOption::isVisible() const |
@@ -78,7 +78,7 @@ bool AXMenuListOption::isSelected() const |
AXMenuListPopup* parent = static_cast<AXMenuListPopup*>(parentObject()); |
if (parent && !parent->isOffScreen()) |
return parent->activeChild() == this; |
- return toHTMLOptionElement(m_element)->selected(); |
+ return m_element->selected(); |
} |
void AXMenuListOption::setSelected(bool b) |
@@ -86,7 +86,7 @@ void AXMenuListOption::setSelected(bool b) |
if (!canSetSelectedAttribute()) |
return; |
- toHTMLOptionElement(m_element)->setSelected(b); |
+ m_element->setSelected(b); |
} |
bool AXMenuListOption::canSetSelectedAttribute() const |
@@ -112,7 +112,7 @@ LayoutRect AXMenuListOption::elementRect() const |
String AXMenuListOption::stringValue() const |
{ |
- return toHTMLOptionElement(m_element)->text(); |
+ return m_element->text(); |
} |
} // namespace blink |